[Orxonox-commit 3384] r8071 - in code/branches/kicklib: . cmake cmake/tools data/gui/scripts src src/external src/external/bullet/BulletCollision/NarrowPhaseCollision src/external/ogreceguirenderer src/external/ois src/external/ois/linux src/external/ois/mac src/external/ois/win32 src/external/openal src/libraries/core src/libraries/core/command src/libraries/core/input src/libraries/network src/libraries/tools src/libraries/util src/modules/designtools src/modules/notifications src/modules/objects src/modules/overlays src/modules/pickup src/modules/pong src/modules/questsystem src/modules/questsystem/effects src/modules/weapons src/orxonox src/orxonox/sound
rgrieder at orxonox.net
rgrieder at orxonox.net
Mon Mar 14 03:53:38 CET 2011
Author: rgrieder
Date: 2011-03-14 03:53:38 +0100 (Mon, 14 Mar 2011)
New Revision: 8071
Added:
code/branches/kicklib/cmake/LibraryConfigOSX.cmake
code/branches/kicklib/cmake/PackageConfigOSX.cmake
code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake
code/branches/kicklib/src/external/ois/OISMultiTouch.h
code/branches/kicklib/src/external/ois/mac/MacJoyStick.cpp
code/branches/kicklib/src/external/ois/mac/MacJoyStick.h
code/branches/kicklib/src/external/openal/
code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h
code/branches/kicklib/src/external/openal/README
code/branches/kicklib/src/external/openal/al.h
code/branches/kicklib/src/external/openal/alc.h
Removed:
code/branches/kicklib/cmake/LibraryConfigApple.cmake
code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h
code/branches/kicklib/src/external/openal/README
code/branches/kicklib/src/external/openal/al.h
code/branches/kicklib/src/external/openal/alc.h
Modified:
code/branches/kicklib/
code/branches/kicklib/CMakeLists.txt
code/branches/kicklib/cmake/CompilerConfigGCC.cmake
code/branches/kicklib/cmake/CompilerConfigMSVC.cmake
code/branches/kicklib/cmake/LibraryConfig.cmake
code/branches/kicklib/cmake/PackageConfig.cmake
code/branches/kicklib/cmake/PackageConfigMSVC.cmake
code/branches/kicklib/cmake/PackageConfigMinGW.cmake
code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake
code/branches/kicklib/cmake/tools/FindALUT.cmake
code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake
code/branches/kicklib/cmake/tools/TargetUtilities.cmake
code/branches/kicklib/data/gui/scripts/AudioMenu.lua
code/branches/kicklib/src/CMakeLists.txt
code/branches/kicklib/src/OrxonoxConfig.cmake
code/branches/kicklib/src/OrxonoxConfig.h.in
code/branches/kicklib/src/SpecialConfig.h.in
code/branches/kicklib/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
code/branches/kicklib/src/external/ogreceguirenderer/CMakeLists.txt
code/branches/kicklib/src/external/ois/CMakeLists.txt
code/branches/kicklib/src/external/ois/OIS.h
code/branches/kicklib/src/external/ois/OISConfig.h
code/branches/kicklib/src/external/ois/OISInputManager.cpp
code/branches/kicklib/src/external/ois/OISKeyboard.h
code/branches/kicklib/src/external/ois/OISPrereqs.h
code/branches/kicklib/src/external/ois/ReadMe.txt
code/branches/kicklib/src/external/ois/VERSION
code/branches/kicklib/src/external/ois/changes_orxonox.diff
code/branches/kicklib/src/external/ois/linux/LinuxInputManager.cpp
code/branches/kicklib/src/external/ois/linux/LinuxInputManager.h
code/branches/kicklib/src/external/ois/linux/LinuxJoyStickEvents.cpp
code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.cpp
code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.h
code/branches/kicklib/src/external/ois/linux/LinuxMouse.cpp
code/branches/kicklib/src/external/ois/linux/LinuxPrereqs.h
code/branches/kicklib/src/external/ois/mac/CMakeLists.txt
code/branches/kicklib/src/external/ois/mac/MacHIDManager.cpp
code/branches/kicklib/src/external/ois/mac/MacHIDManager.h
code/branches/kicklib/src/external/ois/mac/MacInputManager.cpp
code/branches/kicklib/src/external/ois/mac/MacKeyboard.cpp
code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.cpp
code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.h
code/branches/kicklib/src/external/ois/win32/Win32InputManager.cpp
code/branches/kicklib/src/external/ois/win32/Win32InputManager.h
code/branches/kicklib/src/external/ois/win32/Win32JoyStick.cpp
code/branches/kicklib/src/external/ois/win32/Win32JoyStick.h
code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.cpp
code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.h
code/branches/kicklib/src/external/ois/win32/Win32Mouse.cpp
code/branches/kicklib/src/external/ois/win32/Win32Mouse.h
code/branches/kicklib/src/external/ois/win32/Win32Prereqs.h
code/branches/kicklib/src/libraries/core/Core.cc
code/branches/kicklib/src/libraries/core/CorePrereqs.h
code/branches/kicklib/src/libraries/core/DynLib.cc
code/branches/kicklib/src/libraries/core/DynLib.h
code/branches/kicklib/src/libraries/core/GUIManager.cc
code/branches/kicklib/src/libraries/core/GraphicsManager.cc
code/branches/kicklib/src/libraries/core/Identifier.h
code/branches/kicklib/src/libraries/core/OrxonoxClass.h
code/branches/kicklib/src/libraries/core/PathConfig.cc
code/branches/kicklib/src/libraries/core/Super.h
code/branches/kicklib/src/libraries/core/command/Functor.h
code/branches/kicklib/src/libraries/core/input/InputDevice.h
code/branches/kicklib/src/libraries/core/input/InputState.h
code/branches/kicklib/src/libraries/network/LANDiscoverable.cc
code/branches/kicklib/src/libraries/network/NetworkPrereqs.h
code/branches/kicklib/src/libraries/tools/BulletConversions.h
code/branches/kicklib/src/libraries/tools/ToolsPrereqs.h
code/branches/kicklib/src/libraries/util/Convert.h
code/branches/kicklib/src/libraries/util/MathConvert.h
code/branches/kicklib/src/libraries/util/SharedPtr.h
code/branches/kicklib/src/libraries/util/SignalHandler.h
code/branches/kicklib/src/libraries/util/UtilPrereqs.h
code/branches/kicklib/src/modules/designtools/DesignToolsPrereqs.h
code/branches/kicklib/src/modules/notifications/NotificationsPrereqs.h
code/branches/kicklib/src/modules/objects/ObjectsPrereqs.h
code/branches/kicklib/src/modules/overlays/OverlaysPrereqs.h
code/branches/kicklib/src/modules/pickup/PickupPrereqs.h
code/branches/kicklib/src/modules/pong/PongPrereqs.h
code/branches/kicklib/src/modules/questsystem/QuestEffect.cc
code/branches/kicklib/src/modules/questsystem/QuestEffectBeacon.cc
code/branches/kicklib/src/modules/questsystem/QuestsystemPrereqs.h
code/branches/kicklib/src/modules/questsystem/effects/AddReward.cc
code/branches/kicklib/src/modules/weapons/WeaponsPrereqs.h
code/branches/kicklib/src/orxonox/MoodManager.cc
code/branches/kicklib/src/orxonox/OrxonoxPrereqs.h
code/branches/kicklib/src/orxonox/sound/AmbientSound.cc
code/branches/kicklib/src/orxonox/sound/BaseSound.cc
code/branches/kicklib/src/orxonox/sound/SoundBuffer.cc
code/branches/kicklib/src/orxonox/sound/SoundManager.cc
code/branches/kicklib/src/orxonox/sound/SoundStreamer.cc
code/branches/kicklib/src/orxonox/sound/WorldSound.cc
Log:
Merged ois_update branch (before it was renamed to mac_osx) into kicklib branch.
Property changes on: code/branches/kicklib
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/ai:6592-7033
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dynamicmatch:6584-7030
/code/branches/fps:6591-7072
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/lastmanstanding:7479-7644
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890
+ /code/branches/ai:6592-7033
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dynamicmatch:6584-7030
/code/branches/fps:6591-7072
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/lastmanstanding:7479-7644
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890
Modified: code/branches/kicklib/CMakeLists.txt
===================================================================
--- code/branches/kicklib/CMakeLists.txt 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/CMakeLists.txt 2011-03-14 02:53:38 UTC (rev 8071)
@@ -100,14 +100,31 @@
# Enable expensive optimisations: use this for a binary release build
OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
+IF(APPLE)
+ # Set 10.5 as the base SDK by default
+ SET(XCODE_ATTRIBUTE_SDKROOT macosx10.5)
+
+ # 10.6 sets x86_64 as the default architecture.
+ # Because Carbon isn't supported on 64-bit and we still need it, force the architectures to ppc and i386
+ IF(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
+ SET(CMAKE_OSX_ARCHITECTURES "i386")
+ ENDIF()
+ IF(CMAKE_OSX_ARCHITECTURES MATCHES "ppc64")
+ SET(CMAKE_OSX_ARCHITECTURES "ppc")
+ ENDIF()
+ IF(NOT CMAKE_OSX_ARCHITECTURES)
+ SET(CMAKE_OSX_ARCHITECTURES "i386")
+ ENDIF()
+ENDIF()
+
########### Subfolders and Subscripts ###########
+# General build and compiler options and configurations
+INCLUDE(CompilerConfig)
+
# Library finding
INCLUDE(LibraryConfig)
-# General build and compiler options and configurations
-INCLUDE(CompilerConfig)
-
# Configure installation paths and options
INCLUDE(InstallConfig)
Modified: code/branches/kicklib/cmake/CompilerConfigGCC.cmake
===================================================================
--- code/branches/kicklib/cmake/CompilerConfigGCC.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/CompilerConfigGCC.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -25,6 +25,7 @@
INCLUDE(FlagUtilities)
INCLUDE(CompareVersionStrings)
+INCLUDE(CheckCXXCompilerFlag)
# Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC
SET(CMAKE_COMPILER_IS_GNU TRUE)
@@ -36,14 +37,6 @@
OUTPUT_VARIABLE GCC_VERSION
)
-# Complain about incompatibilities
-COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)
-IF(NOT _compare_result LESS 0)
- IF(${Boost_VERSION} LESS 103700)
- MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")
- ENDIF()
-ENDIF()
-
# GCC may not support #pragma GCC system_header correctly when using
# templates. According to Bugzilla, it was fixed March 07 but tests
# have confirmed that GCC 4.0.0 does not pose a problem for our cases.
@@ -71,10 +64,30 @@
ADD_COMPILER_FLAGS("-Os" MinSizeRel CACHE)
# CMake doesn't seem to set the PIC flags right on certain 64 bit systems
+# Todo: MinGW too?
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
ADD_COMPILER_FLAGS("-fPIC" CACHE)
ENDIF()
+# Use SSE if possible
+# Commented because this might not work for cross compiling
+#CHECK_CXX_COMPILER_FLAG(-msse _gcc_have_sse)
+#IF(_gcc_have_sse)
+# ADD_COMPILER_FLAGS("-msse" CACHE)
+#ENDIF()
+
+IF(NOT MINGW)
+ # Have GCC visibility?
+ CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" _gcc_have_visibility)
+ IF(_gcc_have_visibility)
+ # Note: There is a possible bug with the flag in gcc < 4.2 and Debug versions
+ COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.2.0" _compare_result)
+ IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR _compare_result GREATER -1)
+ ADD_COMPILER_FLAGS("-DORXONOX_GCC_VISIBILITY -fvisibility=default -fvisibility-inlines-hidden" CACHE)
+ ENDIF()
+ ENDIF(_gcc_have_visibility)
+ENDIF()
+
# We have some unconformant code, disable an optimisation feature
ADD_COMPILER_FLAGS("-fno-strict-aliasing" CACHE)
Modified: code/branches/kicklib/cmake/CompilerConfigMSVC.cmake
===================================================================
--- code/branches/kicklib/cmake/CompilerConfigMSVC.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/CompilerConfigMSVC.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -59,11 +59,15 @@
ADD_COMPILER_FLAGS("-D_SCL_SECURE_NO_WARNINGS" CACHE)
# Overwrite CMake default flags here for the individual configurations
-SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -RTC1" Debug CACHE)
-SET_COMPILER_FLAGS("-MD -O2 -DNDEBUG" Release CACHE)
-SET_COMPILER_FLAGS("-MD -O2 -Zi -DNDEBUG" RelWithDebInfo CACHE)
-SET_COMPILER_FLAGS("-MD -O1 -DNDEBUG" MinSizeRel CACHE)
+SET_COMPILER_FLAGS("-MDd -Od -Oi -Zi -D_DEBUG -RTC1" Debug CACHE)
+SET_COMPILER_FLAGS("-MD -O2 -DNDEBUG" Release CACHE)
+SET_COMPILER_FLAGS("-MD -O2 -Zi -DNDEBUG" RelWithDebInfo CACHE)
+SET_COMPILER_FLAGS("-MD -O1 -DNDEBUG" MinSizeRel CACHE)
+# Enable non standard floating point optimisations
+# Note: It hasn't been checked yet whether we have code that might break
+#ADD_COMPILER_FLAGS("-fp:fast" CACHE)
+
# No iterator checking for release builds (MSVC 8 dosn't understand this though)
ADD_COMPILER_FLAGS("-D_SECURE_SCL=0" ReleaseAll CACHE)
Modified: code/branches/kicklib/cmake/LibraryConfig.cmake
===================================================================
--- code/branches/kicklib/cmake/LibraryConfig.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/LibraryConfig.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -39,15 +39,15 @@
# On Windows using a package causes way less problems
SET(_option_msg "Set this to true to use precompiled dependecy archives")
-IF(WIN32)
+IF(WIN32 OR APPLE)
OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" ON)
-ELSE(WIN32)
+ELSE()
OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE)
-ENDIF(WIN32)
+ENDIF()
# Scripts for specific library and CMake config
INCLUDE(LibraryConfigTardis)
-INCLUDE(LibraryConfigApple)
+#INCLUDE(LibraryConfigOSX)
IF(DEPENDENCY_PACKAGE_ENABLE)
GET_FILENAME_COMPONENT(_dep_dir_1 ${CMAKE_SOURCE_DIR}/../dependencies ABSOLUTE)
@@ -74,9 +74,13 @@
MESSAGE(STATUS "Warning: Could not find dependency directory."
"Disable LIBRARY_USE_PACKAGE if you have none intalled.")
ELSE()
- INCLUDE(PackageConfigMinGW)
- INCLUDE(PackageConfigMSVC)
- INCLUDE(PackageConfig) # For both msvc and mingw
+ IF(WIN32)
+ INCLUDE(PackageConfigMinGW)
+ INCLUDE(PackageConfigMSVC)
+ INCLUDE(PackageConfig) # For both msvc and mingw
+ ELSEIF(APPLE)
+ INCLUDE(PackageConfigOSX)
+ ENDIF(WIN32)
ENDIF()
ENDIF(DEPENDENCY_PACKAGE_ENABLE)
@@ -151,6 +155,15 @@
ENDIF()
# No auto linking, so this option is useless anyway
MARK_AS_ADVANCED(Boost_LIB_DIAGNOSTIC_DEFINITIONS)
+# Complain about incompatibilities
+IF(GCC_VERSION)
+ COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)
+ IF(NOT _compare_result LESS 0)
+ IF(${Boost_VERSION} LESS 103700)
+ MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")
+ ENDIF()
+ ENDIF()
+ENDIF()
####### Static/Dynamic linking options ##########
Deleted: code/branches/kicklib/cmake/LibraryConfigApple.cmake
===================================================================
--- code/branches/kicklib/cmake/LibraryConfigApple.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/LibraryConfigApple.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -1,43 +0,0 @@
- #
- # ORXONOX - the hottest 3D action shooter ever to exist
- # > www.orxonox.net <
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License along
- # with this program; if not, write to the Free Software Foundation,
- # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- #
- #
- # Author:
- # Yuning Chai
- # Description:
- # Sets necessary library options and paths on Mac.
- #
-
-IF(APPLE)
- MESSAGE(STATUS "Running on Apple. Using customized paths and options.")
-
- SET(ENV{OGRE_HOME} "/Developer/SDKs/OgreSDK/Dependencies")
- SET(ENV{CEGUIDIR} "/Developer/SDKs/OgreSDK/Dependencies")
-
- #MESSAGE(STATUS $ENV{OGRE_HOME})
-
- SET(CMAKE_FIND_FRAMEWORK "FIRST")
-
-# SET(OGRE_LIBRARY_OPTIMIZED "/Developer/SDKs/OgreSDK/Dependencies/Ogre.framework/Ogre")
-
-# SET(CEGUI_LIBRARY_OPTIMIZED "/Developer/SDKs/OgreSDK/Dependencies/CEGUI.framework/CEGUI")
-
-# SET(OGRE_LIBRARY_OPTIMIZED "/Developer/SDKs/OgreSDK/Dependencies/Ogre.framework" CACHE STRING "Ogre lib for OSX")
-# SET(CEGUI_LIBRARY_OPTIMIZED "/Developer/SDKs/OgreSDK/Dependencies/CEGUI.framework" CACHE STRING "CEGUI lib for OSX")
-
-ENDIF(APPLE)
Copied: code/branches/kicklib/cmake/LibraryConfigOSX.cmake (from rev 7788, code/branches/ois_update/cmake/LibraryConfigOSX.cmake)
===================================================================
--- code/branches/kicklib/cmake/LibraryConfigOSX.cmake (rev 0)
+++ code/branches/kicklib/cmake/LibraryConfigOSX.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,29 @@
+ #
+ # ORXONOX - the hottest 3D action shooter ever to exist
+ # > www.orxonox.net <
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+ # as published by the Free Software Foundation; either version 2
+ # of the License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License along
+ # with this program; if not, write to the Free Software Foundation,
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ #
+ #
+ # Author:
+ # Kevin Young
+ # Description:
+ # Sets necessary library options and paths on Mac.
+ #
+
+IF(APPLE)
+ MESSAGE(STATUS "Running on Apple. Using customized paths and options.")
+
+ENDIF(APPLE)
Modified: code/branches/kicklib/cmake/PackageConfig.cmake
===================================================================
--- code/branches/kicklib/cmake/PackageConfig.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/PackageConfig.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -24,51 +24,6 @@
# Library files are treated separately.
#
-# Check package version info
-# MAJOR: Breaking change
-# MINOR: No breaking changes by the dependency package
-# For example any code running on 3.0 should still run on 3.1
-# But you can specify that the code only runs on 3.1 and higher
-# or 4.0 and higher (so both 3.1 and 4.0 will work).
-IF(MSVC)
- SET(ALLOWED_MINIMUM_VERSIONS 4.3 6.0)
-ELSE()
- SET(ALLOWED_MINIMUM_VERSIONS 6.0)
-ENDIF()
-
-IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
- SET(DEPENDENCY_VERSION 1.0)
-ELSE()
- # Get version from file
- FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)
- SET(_match)
- STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})
- IF(_match)
- SET(DEPENDENCY_VERSION ${_match})
- ELSE()
- MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")
- ENDIF()
-ENDIF()
-
-INCLUDE(CompareVersionStrings)
-SET(_version_match FALSE)
-FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})
- # Get major version
- STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")
- COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)
- IF(_result EQUAL 0)
- COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)
- IF(NOT _result LESS 0)
- SET(_version_match TRUE)
- ENDIF()
- ENDIF()
-ENDFOREACH(_version)
-IF(NOT _version_match)
- MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"
- "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"
- "You can get a new version from www.orxonox.net")
-ENDIF()
-
IF(NOT _INTERNAL_PACKAGE_MESSAGE)
MESSAGE(STATUS "Using library package for the dependencies.")
SET(_INTERNAL_PACKAGE_MESSAGE 1 CACHE INTERNAL "Do not edit!" FORCE)
Modified: code/branches/kicklib/cmake/PackageConfigMSVC.cmake
===================================================================
--- code/branches/kicklib/cmake/PackageConfigMSVC.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/PackageConfigMSVC.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -27,6 +27,9 @@
IF(MSVC)
+ INCLUDE(CheckPackageVersion)
+ CHECK_PACKAGE_VERSION(4.3 6.0)
+
# 64 bit system?
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(BINARY_POSTFIX x64)
Modified: code/branches/kicklib/cmake/PackageConfigMinGW.cmake
===================================================================
--- code/branches/kicklib/cmake/PackageConfigMinGW.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/PackageConfigMinGW.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -27,6 +27,9 @@
IF(MINGW)
+ INCLUDE(CheckPackageVersion)
+ CHECK_PACKAGE_VERSION(6.0)
+
# 64 bit system?
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(BINARY_POSTFIX x64)
Copied: code/branches/kicklib/cmake/PackageConfigOSX.cmake (from rev 7788, code/branches/ois_update/cmake/PackageConfigOSX.cmake)
===================================================================
--- code/branches/kicklib/cmake/PackageConfigOSX.cmake (rev 0)
+++ code/branches/kicklib/cmake/PackageConfigOSX.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,92 @@
+ #
+ # ORXONOX - the hottest 3D action shooter ever to exist
+ # > www.orxonox.net <
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+ # as published by the Free Software Foundation; either version 2
+ # of the License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License along
+ # with this program; if not, write to the Free Software Foundation,
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ #
+ #
+ # Author:
+ # Reto Grieder
+ # Description:
+ # OS X package configuration
+ #
+
+INCLUDE(CheckPackageVersion)
+
+CHECK_PACKAGE_VERSION(1.0)
+
+IF(NOT _INTERNAL_PACKAGE_MESSAGE)
+ MESSAGE(STATUS "Using library package for the dependencies.")
+ SET(_INTERNAL_PACKAGE_MESSAGE 1 CACHE INTERNAL "Do not edit!" FORCE)
+ENDIF()
+
+SET(DEP_INCLUDE_DIR ${DEPENDENCY_PACKAGE_DIR}/include)
+SET(DEP_LIBRARY_DIR ${DEPENDENCY_PACKAGE_DIR}/lib)
+SET(DEP_BINARY_DIR ${DEPENDENCY_PACKAGE_DIR}/bin)
+SET(DEP_FRAMEWORK_DIR ${DEPENDENCY_PACKAGE_DIR}/Library/Frameworks)
+
+# Sets the library path for the FIND_LIBRARY
+SET(CMAKE_LIBRARY_PATH ${DEP_LIBRARY_DIR})
+
+# Include paths and other special treatments
+SET(ENV{ALUTDIR} ${DEP_FRAMEWORK_DIR})
+SET(ENV{BOOST_ROOT} ${DEPENDENCY_PACKAGE_DIR})
+SET(ENV{CEGUIDIR} ${DEP_FRAMEWORK_DIR})
+SET(ENV{LUA_DIR} ${DEP_INCLUDE_DIR}/lua)
+SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR})
+SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR})
+SET(ENV{OGRE_HOME} ${DEP_FRAMEWORK_DIR})
+SET(ENV{OGRE_PLUGIN_DIR} ${DEP_BINARY_DIR})
+
+# Xcode won't be able to run the toluabind code generation if we're using the dependency package
+#IF(DEPENDENCY_PACKAGE_ENABLE)
+# IF(${CMAKE_GENERATOR} STREQUAL "Xcode")
+# SET(ENV{DYLD_LIBRARY_PATH} ${DEPENDENCY_PACKAGE_DIR}/lib)
+# SET(ENV{DYLD_FRAMEWORK_PATH} ${DEPENDENCY_PACKAGE_DIR}/Library/Frameworks)
+# ENDIF(${CMAKE_GENERATOR} STREQUAL "Xcode")
+#ENDIF(DEPENDENCY_PACKAGE_ENABLE)
+
+### INSTALL ###
+
+# Tcl script library
+# TODO: How does this work on OS X?
+#INSTALL(
+# DIRECTORY ${DEP_LIBRARY_DIR}/tcl/
+# DESTINATION lib/tcl
+#)
+
+# TODO: Install on OSX
+IF(FALSE)
+ ## DEBUG
+ # When installing a debug version, we really can't know which libraries
+ # are used in released mode because there might be deps of deps.
+ # --> Copy all of them, except the debug databases
+ INSTALL(
+ DIRECTORY ${DEP_BINARY_DIR}/
+ DESTINATION bin
+ CONFIGURATIONS Debug
+ REGEX "^.*\\.pdb$" EXCLUDE
+ )
+
+ ## RELEASE
+ # Try to filter out all the debug libraries. If the regex doesn't do the
+ # job anymore, simply adjust it.
+ INSTALL(
+ DIRECTORY ${DEP_BINARY_DIR}/
+ DESTINATION bin
+ CONFIGURATIONS Release RelWithDebInfo MinSizeRel
+ REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
+ )
+ENDIF()
Modified: code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,12 +52,12 @@
FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_OPTIMIZED
NAMES ${_plugin}
PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
- PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin
+ PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin Ogre.framework/Resources
)
FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG
NAMES ${_plugin}d ${_plugin}_d ${_plugin}
PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
- PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin
+ PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin Ogre.framework/Resources
)
# We only need at least one render system. Check at the end.
IF(NOT ${_plugin} MATCHES "RenderSystem")
Copied: code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake (from rev 7788, code/branches/ois_update/cmake/tools/CheckPackageVersion.cmake)
===================================================================
--- code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake (rev 0)
+++ code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,66 @@
+ #
+ # ORXONOX - the hottest 3D action shooter ever to exist
+ # > www.orxonox.net <
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+ # as published by the Free Software Foundation; either version 2
+ # of the License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License along
+ # with this program; if not, write to the Free Software Foundation,
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ #
+ #
+ # Author:
+ # Reto Grieder
+ # Description:
+ # Check package version info
+ # MAJOR: Breaking change
+ # MINOR: No breaking changes by the dependency package
+ # For example any code running on 3.0 should still run on 3.1
+ # But you can specify that the code only runs on 3.1 and higher
+ # or 4.0 and higher (so both 3.1 and 4.0 will work).
+
+MACRO(CHECK_PACKAGE_VERSION)
+ SET(_allowed_minimum_versions ${ARGN})
+
+ IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
+ SET(DEPENDENCY_VERSION 1.0)
+ ELSE()
+ # Get version from file
+ FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)
+ SET(_match)
+ STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})
+ IF(_match)
+ SET(DEPENDENCY_VERSION ${_match})
+ ELSE()
+ MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")
+ ENDIF()
+ ENDIF()
+
+ INCLUDE(CompareVersionStrings)
+ SET(_version_match FALSE)
+ FOREACH(_version ${_allowed_minimum_versions})
+ # Get major version
+ STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")
+ COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)
+ IF(_result EQUAL 0)
+ COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)
+ IF(NOT _result LESS 0)
+ SET(_version_match TRUE)
+ ENDIF()
+ ENDIF()
+ ENDFOREACH(_version)
+ IF(NOT _version_match)
+ MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"
+ "Possible required versions: ${_allowed_minimum_versions}\n"
+ "You can get a new version from www.orxonox.net")
+ ENDIF()
+
+ENDMACRO(CHECK_PACKAGE_VERSION)
Modified: code/branches/kicklib/cmake/tools/FindALUT.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/FindALUT.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/tools/FindALUT.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -1,80 +1,52 @@
-# - Locate FreeAlut
+# Find ALUT includes and library
+#
# This module defines
-# ALUT_LIBRARY
-# ALUT_FOUND, if false, do not try to link against Alut
-# ALUT_INCLUDE_DIR, where to find the headers
+# ALUT_INCLUDE_DIR
+# ALUT_LIBRARY, the library to link against to use ALUT.
+# ALUT_FOUND, If false, do not try to use ALUT
#
-# $ALUTDIR is an environment variable that would
-# correspond to the ./configure --prefix=$ALUTDIR
-# used in building Alut.
+# Copyright © 2007, Matt Williams
+# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture
+# of the ETH Zurich (removed later on)
#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake module.
-# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
-# ALUT_LIBRARY to override this selection.
-# Tiger will include OpenAL as part of the System.
-# But for now, we have to look around.
-# Other (Unix) systems should be able to utilize the non-framework paths.
+# Redistribution and use is allowed according to the terms of the BSD license.
#
# Several changes and additions by Fabian 'x3n' Landau
-# Some simplifications by Adrian Friedli and Reto Grieder
+# Lots of simplifications by Adrian Friedli
+# Version checking by Reto Grieder
+# Adaption of the OGRE find script to ALUT by Kevin Young
# > www.orxonox.net <
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(FindPackageHandleAdvancedArgs)
INCLUDE(HandleLibraryTypes)
-FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
- PATHS
- $ENV{ALUTDIR}
- ~/Library/Frameworks/OpenAL.framework
- /Library/Frameworks/OpenAL.framework
- /System/Library/Frameworks/OpenAL.framework # Tiger
- PATH_SUFFIXES include include/OpenAL include/AL Headers
+FIND_PATH(ALUT_INCLUDE_DIR alut.h
+ PATHS $ENV{ALUTDIR}
+ PATH_SUFFIXES include include/AL ALUT
)
+FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
+ NAMES ALUT alut
+ PATHS $ENV{ALUTDIR}
+ PATH_SUFFIXES lib bin/Release bin/release Release release ALUT
+)
+FIND_LIBRARY(ALUT_LIBRARY_DEBUG
+ NAMES ALUTD alutd alut_d alutD alut_D
+ PATHS $ENV{ALUTDIR}
+ PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ALUT
+)
-# I'm not sure if I should do a special casing for Apple. It is
-# unlikely that other Unix systems will find the framework path.
-# But if they do ([Next|Open|GNU]Step?),
-# do they want the -framework option also?
-IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
-
- STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
- IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
- OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
- )
- # String is in default search path, don't need to use -F
- SET (ALUT_LIBRARY_OPTIMIZED "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
- ELSE()
- # String is not /Library/Frameworks, need to use -F
- SET(ALUT_LIBRARY_OPTIMIZED "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
- ENDIF()
- # Clear the temp variable so nobody can see it
- SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
-
-ELSE()
- FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
- NAMES alut
- PATHS $ENV{ALUTDIR}
- PATH_SUFFIXES lib libs
- )
- FIND_LIBRARY(ALUT_LIBRARY_DEBUG
- NAMES alutd alut_d alutD alut_D
- PATHS $ENV{ALUTDIR}
- PATH_SUFFIXES lib libs
- )
-ENDIF()
-
# Handle the REQUIRED argument and set ALUT_FOUND
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG
- ALUT_LIBRARY_OPTIMIZED
- ALUT_INCLUDE_DIR
+# Also check the version requirements
+FIND_PACKAGE_HANDLE_ADVANCED_ARGS(ALUT DEFAULT_MSG
+ ALUT_LIBRARY_OPTIMIZED
+ ALUT_INCLUDE_DIR
)
# Collect optimized and debug libraries
HANDLE_LIBRARY_TYPES(ALUT)
MARK_AS_ADVANCED(
- ALUT_INCLUDE_DIR
- ALUT_LIBRARY_OPTIMIZED
- ALUT_LIBRARY_DEBUG
+ ALUT_INCLUDE_DIR
+ ALUT_LIBRARY_OPTIMIZED
+ ALUT_LIBRARY_DEBUG
)
Modified: code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -32,6 +32,16 @@
# RUNTIME_LIBRARY_DIRECTORY - Working directory
#
+# Workaround for XCode: The folder where the bind files are written to has
+# to be present beforehand.
+# We have to do this here because the header files are all stored in a single
+# location per configuration.
+IF(CMAKE_CONFIGURATION_TYPES)
+ FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
+ FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src/toluabind/${_dir}")
+ ENDFOREACH(_dir)
+ENDIF()
+
FUNCTION(GENERATE_TOLUA_BINDINGS _tolua_package _target_source_files)
SET(_tolua_inputfiles ${ARGN})
LIST(REMOVE_ITEM _tolua_inputfiles "INPUTFILES")
Modified: code/branches/kicklib/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/TargetUtilities.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/cmake/tools/TargetUtilities.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -168,6 +168,13 @@
IF(_arg_TOLUA_FILES)
GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
INPUTFILES ${_arg_TOLUA_FILES})
+ # Workaround for XCode: The folder where the bind files are written to has
+ # to be present beforehand.
+ IF(CMAKE_CONFIGURATION_TYPES)
+ FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
+ FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir})
+ ENDFOREACH(_dir)
+ ENDIF()
ENDIF()
# First part (pre target) of precompiled header files
Modified: code/branches/kicklib/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/branches/kicklib/data/gui/scripts/AudioMenu.lua 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/data/gui/scripts/AudioMenu.lua 2011-03-14 02:53:38 UTC (rev 8071)
@@ -31,6 +31,8 @@
local themeList = {}
table.insert(themeList, "Default")
table.insert(themeList, "Drum n' Bass")
+ table.insert(themeList, "8-Bit Style")
+ table.insert(themeList, "Corny Jazz")
for k,v in pairs(themeList) do
item = CEGUI.createListboxTextItem(v)
item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
@@ -38,6 +40,10 @@
end
if orxonox.getConfig("MoodManager", "mood_") == "dnb" then
listboxwindow:setItemSelectState(1,true)
+ elseif orxonox.getConfig("MoodManager", "mood_") == "eightbit" then
+ listboxwindow:setItemSelectState(2,true)
+ elseif orxonox.getConfig("MoodManager", "mood_") == "jazzy" then
+ listboxwindow:setItemSelectState(3,true)
else
listboxwindow:setItemSelectState(0,true)
end
@@ -167,6 +173,10 @@
function P.AudioThemeListbox_changed(e)
if listboxwindow:isItemSelected(1) then
orxonox.config("MoodManager", "mood_", "dnb")
+ elseif listboxwindow:isItemSelected(2) then
+ orxonox.config("MoodManager", "mood_", "eightbit")
+ elseif listboxwindow:isItemSelected(3) then
+ orxonox.config("MoodManager", "mood_", "jazzy")
else
orxonox.config("MoodManager", "mood_", "default")
end
Modified: code/branches/kicklib/src/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/CMakeLists.txt 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/CMakeLists.txt 2011-03-14 02:53:38 UTC (rev 8071)
@@ -68,6 +68,16 @@
# Set the search paths for include files
INCLUDE_DIRECTORIES(
+ # OrxonoxConfig.h
+ ${CMAKE_CURRENT_BINARY_DIR}
+
+ # All includes in "externals" should be prefixed with the path
+ # relative to "external" to avoid conflicts
+ ${CMAKE_CURRENT_SOURCE_DIR}/external
+ # Include directories needed even if only included by Orxonox
+ ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet
+ ${CMAKE_CURRENT_SOURCE_DIR}/external/ois
+
# External
${OGRE_INCLUDE_DIR}
${CEGUI_INCLUDE_DIR}
@@ -83,16 +93,6 @@
${TCL_INCLUDE_PATH}
${DIRECTX_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
-
- # All includes in "externals" should be prefixed with the path
- # relative to "external" to avoid conflicts
- ${CMAKE_CURRENT_SOURCE_DIR}/external
- # Include directories needed even if only included by Orxonox
- ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet
- ${CMAKE_CURRENT_SOURCE_DIR}/external/ois
-
- # OrxonoxConfig.h
- ${CMAKE_CURRENT_BINARY_DIR}
)
IF (DBGHELP_FOUND)
Modified: code/branches/kicklib/src/OrxonoxConfig.cmake
===================================================================
--- code/branches/kicklib/src/OrxonoxConfig.cmake 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/OrxonoxConfig.cmake 2011-03-14 02:53:38 UTC (rev 8071)
@@ -31,7 +31,8 @@
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# Global switch to disable Precompiled Header Files
-IF(PCH_COMPILER_SUPPORT)
+# Note: PCH temporarily disabled on Mac because of severe problems
+IF(PCH_COMPILER_SUPPORT AND NOT APPLE)
OPTION(PCH_ENABLE "Global PCH switch" TRUE)
ENDIF()
@@ -52,13 +53,6 @@
SET(ORXONOX_LITTLE_ENDIAN TRUE)
ENDIF()
-# 32/64 bit system check
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(ORXONOX_ARCH_64 TRUE)
-ELSE()
- SET(ORXONOX_ARCH_32 TRUE)
-ENDIF()
-
# Platforms
SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
SET(ORXONOX_PLATFORM_APPLE ${APPLE})
@@ -74,6 +68,13 @@
CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
ENDIF(MSVC)
+# Part of a woraround for OS X warnings. See OrxonoxConfig.h.in
+IF(HAVE_STDINT_H)
+ SET(HAVE_STDINT_H 1)
+ELSE()
+ SET(HAVE_STDINT_H 0)
+ENDIF()
+
# Check iso646.h include (literal operators)
INCLUDE(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
Modified: code/branches/kicklib/src/OrxonoxConfig.h.in
===================================================================
--- code/branches/kicklib/src/OrxonoxConfig.h.in 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/OrxonoxConfig.h.in 2011-03-14 02:53:38 UTC (rev 8071)
@@ -79,16 +79,19 @@
#cmakedefine ORXONOX_LITTLE_ENDIAN
// Architecture
-#cmakedefine ORXONOX_ARCH_32
-#cmakedefine ORXONOX_ARCH_64
+#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
+# define ORXONOX_ARCH_64
+#else
+# define ORXONOX_ARCH_32
+#endif
// See if we can use __forceinline or if we need to use __inline instead
#cmakedefine HAVE_FORCEINLINE
-#ifndef FORCEINLINE
+#ifndef ORX_FORCEINLINE
# ifdef HAVE_FORCEINLINE
-# define FORCEINLINE __forceinline
+# define ORX_FORCEINLINE __forceinline
# else
-# define FORCEINLINE __inline
+# define ORX_FORCEINLINE __inline
# endif
#endif
@@ -157,8 +160,10 @@
# include <iso646.h>
#endif
-#cmakedefine HAVE_STDINT_H
-#ifdef HAVE_STDINT_H
+// On OS X some headers already define HAVE_STDINT_H and that spits out
+// some warnings. Therefore we use this syntax.
+// Note: This requires some extra code in OrxonoxConfig.cmake
+#if @HAVE_STDINT_H@
# include <stdint.h>
#elif defined(ORXONOX_COMPILER_MSVC)
typedef __int8 int8_t;
Modified: code/branches/kicklib/src/SpecialConfig.h.in
===================================================================
--- code/branches/kicklib/src/SpecialConfig.h.in 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/SpecialConfig.h.in 2011-03-14 02:53:38 UTC (rev 8071)
@@ -91,17 +91,27 @@
const char moduleExtension[] = "@ORXONOX_MODULE_EXTENSION@";
// OGRE PLUGINS
+ // Apple has trouble finding OGRE plugins because of its install-name convention
+ // Adopting the executable_path structure for later use in app bundles
#ifdef NDEBUG
const char ogrePlugins[] = "@OGRE_PLUGINS_RELEASE@";
# ifdef DEPENDENCY_PACKAGE_ENABLE
- const char ogrePluginsDirectory[] = ".";
+# ifdef ORXONOX_PLATFORM_APPLE
+ const char ogrePluginsDirectory[] = "@executable_path/../Plugins";
+# else
+ const char ogrePluginsDirectory[] = ".";
+# endif
# else
const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";
# endif
#else
const char ogrePlugins[] = "@OGRE_PLUGINS_DEBUG@";
# ifdef DEPENDENCY_PACKAGE_ENABLE
- const char ogrePluginsDirectory[] = ".";
+# ifdef ORXONOX_PLATFORM_APPLE
+ const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";
+# else
+ const char ogrePluginsDirectory[] = ".";
+# endif
# else
const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";
# endif
Modified: code/branches/kicklib/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
===================================================================
--- code/branches/kicklib/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -37,6 +37,12 @@
int gNumDeepPenetrationChecks = 0;
int gNumGjkChecks = 0;
+#ifdef check
+struct CompilerError
+{
+ void CompilerError() {}
+};
+#endif
btGjkPairDetector::btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver)
:m_cachedSeparatingAxis(btScalar(0.),btScalar(1.),btScalar(0.)),
Modified: code/branches/kicklib/src/external/ogreceguirenderer/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/external/ogreceguirenderer/CMakeLists.txt 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ogreceguirenderer/CMakeLists.txt 2011-03-14 02:53:38 UTC (rev 8071)
@@ -33,9 +33,10 @@
ORXONOX_EXTERNAL
DEFINE_SYMBOL
"OGRE_GUIRENDERER_EXPORTS"
- VERSION
- 1.4.9
LINK_LIBRARIES
+ ${Boost_SYSTEM_LIBRARY}
+ ${Boost_THREAD_LIBRARY}
+ ${Boost_DATE_TIME_LIBRARY}
${OGRE_LIBRARY}
${CEGUI_LIBRARY}
SOURCE_FILES
Modified: code/branches/kicklib/src/external/ois/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/external/ois/CMakeLists.txt 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/CMakeLists.txt 2011-03-14 02:53:38 UTC (rev 8071)
@@ -30,10 +30,11 @@
OISJoyStick.h
OISKeyboard.h
OISMouse.h
+ OISMultiTouch.h
OISObject.h
OISPrereqs.h
-COMPILATION_BEGIN OISCompilation.cpp
+ #COMPILATION_BEGIN OISCompilation.cpp
OISEffect.cpp
OISException.cpp
OISForceFeedback.cpp
@@ -41,7 +42,7 @@
OISJoyStick.cpp
OISKeyboard.cpp
OISObject.cpp
-COMPILATION_END
+ #COMPILATION_END
)
IF(WIN32)
ADD_SUBDIRECTORY(win32)
@@ -51,8 +52,6 @@
ADD_SUBDIRECTORY(linux)
ENDIF()
-INCLUDE_DIRECTORIES(.)
-
ORXONOX_ADD_LIBRARY(ois_orxonox
ORXONOX_EXTERNAL
DEFINE_SYMBOL
@@ -65,4 +64,6 @@
IF(WIN32)
TARGET_LINK_LIBRARIES(ois_orxonox ${DIRECTX_LIBRARIES})
+ELSEIF(APPLE)
+ TARGET_LINK_LIBRARIES(ois_orxonox "/System/Library/Frameworks/IOKit.framework" "/System/Library/Frameworks/Carbon.framework")
ENDIF()
Modified: code/branches/kicklib/src/external/ois/OIS.h
===================================================================
--- code/branches/kicklib/src/external/ois/OIS.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/OIS.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -28,6 +28,7 @@
#include "OISMouse.h"
#include "OISKeyboard.h"
#include "OISJoyStick.h"
+#include "OISMultiTouch.h"
#include "OISInputManager.h"
#include "OISFactoryCreator.h"
#include "OISException.h"
Modified: code/branches/kicklib/src/external/ois/OISConfig.h
===================================================================
--- code/branches/kicklib/src/external/ois/OISConfig.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/OISConfig.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -69,8 +69,6 @@
/**
@remarks
Build in support for Win32 XInput (Xbox 360 Controller)
- at notes
- Not Yet Implemented
*/
//#define OIS_WIN32_XINPUT_SUPPORT
Modified: code/branches/kicklib/src/external/ois/OISInputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/OISInputManager.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/OISInputManager.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -36,6 +36,8 @@
# include "linux/LinuxInputManager.h"
#elif defined OIS_APPLE_PLATFORM
# include "mac/MacInputManager.h"
+#elif defined OIS_IPHONE_PLATFORM
+# include "iphone/iPhoneInputManager.h"
#elif defined OIS_XBOX_PLATFORM
# include "xbox/XBoxInputManager.h"
#endif
@@ -58,6 +60,8 @@
m_lircSupport(0),
m_wiiMoteSupport(0)
{
+ mFactories.clear();
+ mFactoryObjects.clear();
}
//----------------------------------------------------------------------------//
@@ -110,6 +114,8 @@
im = new LinuxInputManager();
#elif defined OIS_APPLE_PLATFORM
im = new MacInputManager();
+#elif defined OIS_IPHONE_PLATFORM
+ im = new iPhoneInputManager();
#else
OIS_EXCEPT(E_General, "No platform library.. check build platform defines!");
#endif
Modified: code/branches/kicklib/src/external/ois/OISKeyboard.h
===================================================================
--- code/branches/kicklib/src/external/ois/OISKeyboard.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/OISKeyboard.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -183,7 +183,7 @@
class _OISExport KeyEvent : public EventArg
{
public:
- KeyEvent( Object* obj, KeyCode kc, unsigned int txt ) : EventArg(obj), key(kc), text(txt) {}
+ KeyEvent(Object* obj, KeyCode kc, unsigned int txt) : EventArg(obj), key(kc), text(txt) {}
virtual ~KeyEvent() {}
//! KeyCode of event
@@ -200,8 +200,8 @@
{
public:
virtual ~KeyListener() {}
- virtual bool keyPressed( const KeyEvent &arg ) = 0;
- virtual bool keyReleased( const KeyEvent &arg ) = 0;
+ virtual bool keyPressed(const KeyEvent &arg) = 0;
+ virtual bool keyReleased(const KeyEvent &arg) = 0;
};
/**
@@ -219,7 +219,7 @@
@param key
A KeyCode to check
*/
- virtual bool isKeyDown( KeyCode key ) const = 0;
+ virtual bool isKeyDown(KeyCode key) const = 0;
/**
@remarks
@@ -228,7 +228,7 @@
@param keyListener
Send a pointer to a class derived from KeyListener or 0 to clear the callback
*/
- virtual void setEventCallback( KeyListener *keyListener ) { mListener = keyListener;}
+ virtual void setEventCallback(KeyListener *keyListener) { mListener = keyListener;}
/**
@remarks
@@ -253,7 +253,7 @@
@param mode
Off, Unicode, Ascii
*/
- virtual void setTextTranslation( TextTranslationMode mode );
+ virtual void setTextTranslation(TextTranslationMode mode);
/**
@remarks
@@ -271,7 +271,7 @@
@returns
The string as determined from the current locale
*/
- virtual const std::string& getAsString( KeyCode kc ) = 0;
+ virtual const std::string& getAsString(KeyCode kc) = 0;
//! Enum of bit position of modifer
enum Modifier
@@ -285,14 +285,14 @@
@remarks
Check modifier status
*/
- bool isModifierDown( Modifier mod ) const;
+ bool isModifierDown(Modifier mod) const;
/**
@remarks
Copies the state of the keys into the sent buffer
(in the form of 1 is down and 0 is up)
*/
- virtual void copyKeyStates( char keys[256] ) const = 0;
+ virtual void copyKeyStates(char keys[256]) const = 0;
protected:
Keyboard(const std::string &vendor, bool buffered, int devID, InputManager* creator)
Copied: code/branches/kicklib/src/external/ois/OISMultiTouch.h (from rev 7788, code/branches/ois_update/src/external/ois/OISMultiTouch.h)
===================================================================
--- code/branches/kicklib/src/external/ois/OISMultiTouch.h (rev 0)
+++ code/branches/kicklib/src/external/ois/OISMultiTouch.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,169 @@
+/*
+The zlib/libpng License
+
+Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
+
+This software is provided 'as-is', without any express or implied warranty. In no event will
+the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial
+applications, and to alter it and redistribute it freely, subject to the following
+restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not claim that
+ you wrote the original software. If you use this software in a product,
+ an acknowledgment in the product documentation would be appreciated but is
+ not required.
+
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef OIS_MultiTouch_H
+#define OIS_MultiTouch_H
+#include "OISObject.h"
+#include "OISEvents.h"
+
+#include <set>
+#include <vector>
+
+#define OIS_MAX_NUM_TOUCHES 4 // 4 finger touches are probably the highest we'll ever get
+
+namespace OIS
+{
+ /**
+ Represents the state of the multi-touch device
+ All members are valid for both buffered and non buffered mode
+ */
+
+ //! Touch Event type
+ enum MultiTypeEventTypeID
+ {
+ MT_None = 0, MT_Pressed, MT_Released, MT_Moved, MT_Cancelled
+ };
+
+ class _OISExport MultiTouchState
+ {
+ public:
+ MultiTouchState() : width(50), height(50), touchType(MT_None) {};
+
+ /** Represents the height/width of your display area.. used if touch clipping
+ or touch grabbed in case of X11 - defaults to 50.. Make sure to set this
+ and change when your size changes.. */
+ mutable int width, height;
+
+ //! X Axis component
+ Axis X;
+
+ //! Y Axis Component
+ Axis Y;
+
+ //! Z Axis Component
+ Axis Z;
+
+ int touchType;
+
+ inline bool touchIsType( MultiTypeEventTypeID touch ) const
+ {
+ return ((touchType & ( 1L << touch )) == 0) ? false : true;
+ }
+
+ //! Clear all the values
+ void clear()
+ {
+ X.clear();
+ Y.clear();
+ Z.clear();
+ touchType = MT_None;
+ }
+ };
+
+ /** Specialised for multi-touch events */
+ class _OISExport MultiTouchEvent : public EventArg
+ {
+ public:
+ MultiTouchEvent( Object *obj, const MultiTouchState &ms ) : EventArg(obj), state(ms) {}
+ virtual ~MultiTouchEvent() {}
+
+ //! The state of the touch - including axes
+ const MultiTouchState &state;
+ };
+
+ /**
+ To receive buffered touch input, derive a class from this, and implement the
+ methods here. Then set the call back to your MultiTouch instance with MultiTouch::setEventCallback
+ */
+ class _OISExport MultiTouchListener
+ {
+ public:
+ virtual ~MultiTouchListener() {}
+ virtual bool touchMoved( const MultiTouchEvent &arg ) = 0;
+ virtual bool touchPressed( const MultiTouchEvent &arg ) = 0;
+ virtual bool touchReleased( const MultiTouchEvent &arg ) = 0;
+ virtual bool touchCancelled( const MultiTouchEvent &arg ) = 0;
+ };
+
+ /**
+ MultiTouch base class. To be implemented by specific system (ie. iPhone UITouch)
+ This class is useful as you remain OS independent using this common interface.
+ */
+ class _OISExport MultiTouch : public Object
+ {
+ public:
+ virtual ~MultiTouch() {}
+
+ /**
+ @remarks
+ Register/unregister a MultiTouch Listener - Only one allowed for simplicity. If broadcasting
+ is necessary, just broadcast from the callback you registered.
+ @param touchListener
+ Send a pointer to a class derived from MultiTouchListener or 0 to clear the callback
+ */
+ virtual void setEventCallback( MultiTouchListener *touchListener ) {mListener = touchListener;}
+
+ /** @remarks Returns currently set callback.. or 0 */
+ MultiTouchListener* getEventCallback() {return mListener;}
+
+ /** @remarks Clear out the set of input states. Should be called after input has been processed by the application */
+ void clearStates(void) { mStates.clear(); }
+
+ /** @remarks Returns the state of the touch - is valid for both buffered and non buffered mode */
+ std::vector<MultiTouchState> getMultiTouchStates() const { return mStates; }
+
+ /** @remarks Returns the first n touch states. Useful if you know your app only needs to
+ process n touches. The return value is a vector to allow random access */
+ const std::vector<MultiTouchState> getFirstNTouchStates(int n) {
+ std::vector<MultiTouchState> states;
+ for( unsigned int i = 0; i < mStates.size(); i++ ) {
+ if(!(mStates[i].touchIsType(MT_None))) {
+ states.push_back(mStates[i]);
+ }
+ }
+ return states;
+ }
+
+ /** @remarks Returns the first n touch states. Useful if you know your app only needs to
+ process n touches. The return value is a vector to allow random access */
+ const std::vector<MultiTouchState> getMultiTouchStatesOfType(MultiTypeEventTypeID type) {
+ std::vector<MultiTouchState> states;
+ for( unsigned int i = 0; i < mStates.size(); i++ ) {
+ if(mStates[i].touchIsType(type)) {
+ states.push_back(mStates[i]);
+ }
+ }
+ return states;
+ }
+
+ protected:
+ MultiTouch(const std::string &vendor, bool buffered, int devID, InputManager* creator)
+ : Object(vendor, OISMultiTouch, buffered, devID, creator), mListener(0) {}
+
+ //! The state of the touch device, implemented in a vector to store the state from each finger touch
+ std::vector<MultiTouchState> mStates;
+
+ //! Used for buffered/actionmapping callback
+ MultiTouchListener *mListener;
+ };
+}
+#endif
Modified: code/branches/kicklib/src/external/ois/OISPrereqs.h
===================================================================
--- code/branches/kicklib/src/external/ois/OISPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/OISPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -78,9 +78,15 @@
# endif
# endif
#elif defined( __APPLE_CC__ ) // Apple OS X
-# define OIS_APPLE_PLATFORM
-# undef _OISExport
-# define _OISExport __attribute__((visibility("default")))
+ // Device Simulator
+# if __IPHONE_OS_VERSION_MIN_REQUIRED >= 20201 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 20000
+//# if __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000
+# define OIS_IPHONE_PLATFORM
+# else
+# define OIS_APPLE_PLATFORM
+# endif
+# undef _OISExport
+# define _OISExport __attribute__((visibility("default")))
#else //Probably Linux
# define OIS_LINUX_PLATFORM
#endif
@@ -94,9 +100,9 @@
//-------------- Common Classes, Enums, and Typdef's -------------------------//
#define OIS_VERSION_MAJOR 1
-#define OIS_VERSION_MINOR 2
+#define OIS_VERSION_MINOR 4
#define OIS_VERSION_PATCH 0
-#define OIS_VERSION_NAME "Smash"
+#define OIS_VERSION_NAME "1.4.0"
#define OIS_VERSION ((OIS_VERSION_MAJOR << 16) | (OIS_VERSION_MINOR << 8) | OIS_VERSION_PATCH)
@@ -109,8 +115,10 @@
class Keyboard;
class Mouse;
class JoyStick;
+ class MultiTouch;
class KeyListener;
class MouseListener;
+ class MultiTouchListener;
class JoyStickListener;
class Interface;
class ForceFeedback;
@@ -129,11 +137,12 @@
//! Each Input class has a General Type variable, a form of RTTI
enum Type
{
- OISUnknown = 0,
- OISKeyboard = 1,
- OISMouse = 2,
- OISJoyStick = 3,
- OISTablet = 4
+ OISUnknown = 0,
+ OISKeyboard = 1,
+ OISMouse = 2,
+ OISJoyStick = 3,
+ OISTablet = 4,
+ OISMultiTouch = 5
};
//! Map of device objects connected and their respective vendors
Modified: code/branches/kicklib/src/external/ois/ReadMe.txt
===================================================================
--- code/branches/kicklib/src/external/ois/ReadMe.txt 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/ReadMe.txt 2011-03-14 02:53:38 UTC (rev 8071)
@@ -4,7 +4,7 @@
The zlib/libpng License
-Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
+Copyright (c) 2005-2010 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no
event will the authors be held liable for any damages arising from the use of this
@@ -45,21 +45,16 @@
Win32/
Contains Visual Studio .Net Solution Files
- Contains CodeBlocks + MinGW + StlPort project files for OIS
+ Contains CodeBlocks project files for OIS
---- Dependencies ------------------------------------------------------
DirectInput 8
- Ogre & CEGUI 0.4.0 If building CEGUIOgre OIS Demo
- SDL/
- A test bed for an OIS InputManager with SDL as the backend. Not recommended;
- however, useful for platforms with non-native OIS ports for temporary use.
Linux/
---- Dependencies ------------------------------------------------------
X11
- Ogre (GLX Platform) & CEGUI 0.4.0 If building CEGUIOgre OIS Demo
- Newer Linux Kernel (2.6+ ?) for Event API - else, use --disable-joyevents
+ Newer Linux Kernel (2.6+ ?) for Event API
Steps to build on Linux:
./bootstrap
@@ -68,10 +63,8 @@
---- Configure build options --------------------------------------------
./configure --help --- List all configure options
- ./configure --disable-ogre --- Disables CEGUIOgre ActionMapping Demo
- ./configure --disable-joyevents --- Uses /dev/input/jsX instead of
- /dev/input/eventX
+
LinuxCB/
Contains CodeBlock files for building OIS and Demos with codeblocks
This project file looks for Ogre and other dependencies in /usr/local/lib
@@ -79,9 +72,5 @@
settings. It also installs libOIS to ~/libs
Mac/
-
- XCode-1.5/
- Non-complete native OIS port.
-
XCode-2.2/
- Working, complete, OIS port to OSX using SDL as a backend.
\ No newline at end of file
+ Working, mostly complete OSX vackend.
\ No newline at end of file
Modified: code/branches/kicklib/src/external/ois/VERSION
===================================================================
--- code/branches/kicklib/src/external/ois/VERSION 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/VERSION 2011-03-14 02:53:38 UTC (rev 8071)
@@ -1,3 +1,2 @@
-OIS v1_2 CVS updated on 2009/01/24
-Note that this is not CVS HEAD, but v1_2 branch!
-
+OIS SVN trunk updated on 2010/10/07 (revision 26)
+https://wgois.svn.sourceforge.net/svnroot/wgois/ois/trunk/
Modified: code/branches/kicklib/src/external/ois/changes_orxonox.diff
===================================================================
--- code/branches/kicklib/src/external/ois/changes_orxonox.diff 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/changes_orxonox.diff 2011-03-14 02:53:38 UTC (rev 8071)
@@ -9,6 +9,8 @@
# undef _OISExport
//Ignorable Dll interface warning...
# if !defined(OIS_MINGW_COMPILER)
+
+
--- linux/EventHelpers.cpp (revision 5668)
+++ linux/EventHelpers.cpp (working copy)
@@ -35,6 +35,20 @@
@@ -36,7 +38,7 @@
--- win32/Win32ForceFeedback.cpp
+++ win32/Win32ForceFeedback.cpp
@@ -25,7 +25,7 @@
- #include <Math.h>
+ #include <math.h>
// 0 = No trace; 1 = Important traces; 2 = Debug traces
-#define OIS_WIN32_JOYFF_DEBUG 1
@@ -44,3 +46,23 @@
#if (defined (_DEBUG) || defined(OIS_WIN32_JOYFF_DEBUG))
#include <iostream>
+
+
+--- mac/MacHIDManager.cpp
++++ mac/MacHIDManager.cpp
+@@ -406,6 +406,7 @@
+ switch(iType)
+ {
+ case OISJoyStick:
++ {
+ int totalDevs = totalDevices(iType);
+ int freeDevs = freeDevices(iType);
+ int devID = totalDevs - freeDevs;
+@@ -413,6 +414,7 @@
+ obj = new MacJoyStick((*it)->combinedKey, bufferMode, *it, creator, devID);
+ (*it)->inUse = true;
+ return obj;
++ }
+ case OISTablet:
+ //Create MacTablet
+ break;
Modified: code/branches/kicklib/src/external/ois/linux/LinuxInputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxInputManager.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/linux/LinuxInputManager.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -39,7 +39,6 @@
grabKeyboard = true;
hideMouse = true;
mGrabs = true;
- useXRepeat = false;
keyboardUsed = mouseUsed = false;
//Setup our internal factories
@@ -73,11 +72,6 @@
window = strtoul(i->second.c_str(), 0, 10);
//--------- Keyboard Settings ------------//
- i = paramList.find("XAutoRepeatOn");
- if( i != paramList.end() )
- if( i->second == "true" )
- useXRepeat = true;
-
i = paramList.find("x11_keyboard_grab");
if( i != paramList.end() )
if( i->second == "false" )
@@ -171,7 +165,7 @@
case OISKeyboard:
{
if( keyboardUsed == false )
- obj = new LinuxKeyboard(this, bufferMode, grabKeyboard, useXRepeat);
+ obj = new LinuxKeyboard(this, bufferMode, grabKeyboard);
break;
}
case OISMouse:
Modified: code/branches/kicklib/src/external/ois/linux/LinuxInputManager.h
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxInputManager.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/linux/LinuxInputManager.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -100,9 +100,6 @@
bool grabMouse, grabKeyboard;
bool mGrabs;
bool hideMouse;
-
- //! By default, keyboard disables XRepeatRate
- bool useXRepeat;
};
}
#endif
Modified: code/branches/kicklib/src/external/ois/linux/LinuxJoyStickEvents.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxJoyStickEvents.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/linux/LinuxJoyStickEvents.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -95,107 +95,110 @@
//We are in non blocking mode - we just read once, and try to fill up buffer
input_event js[JOY_BUFFERSIZE];
- int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
- if( ret <= 0 )
- return;
-
- //Determine how many whole events re read up
- ret /= sizeof(struct input_event);
- for(int i = 0; i < ret; ++i)
+ while(true)
{
- switch(js[i].type)
- {
- case EV_KEY: //Button
- {
- int button = mButtonMap[js[i].code];
-
- #ifdef OIS_LINUX_JOY_DEBUG
- cout << "\nButton Code: " << js[i].code << ", OIS Value: " << button << endl;
- #endif
-
- //Check to see whether push or released event...
- if(js[i].value)
- {
- mState.mButtons[button] = true;
- if( mBuffered && mListener )
- if(!mListener->buttonPressed(JoyStickEvent(this,mState), button)) return;
- }
- else
- {
- mState.mButtons[button] = false;
- if( mBuffered && mListener )
- if(!mListener->buttonReleased(JoyStickEvent(this,mState), button)) return;
- }
+ int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
+ if( ret < 0 )
break;
- }
- case EV_ABS: //Absolute Axis
+ //Determine how many whole events re read up
+ ret /= sizeof(struct input_event);
+ for(int i = 0; i < ret; ++i)
{
- //A Stick (BrakeDefine is the highest possible Axis)
- if( js[i].code <= ABS_BRAKE )
+ switch(js[i].type)
{
- int axis = mAxisMap[js[i].code];
- assert( axis < 32 && "Too many axes (Max supported is 32). Report this to OIS forums!" );
+ case EV_KEY: //Button
+ {
+ int button = mButtonMap[js[i].code];
- axisMoved[axis] = true;
+ #ifdef OIS_LINUX_JOY_DEBUG
+ cout << "\nButton Code: " << js[i].code << ", OIS Value: " << button << endl;
+ #endif
- //check for rescaling:
- if( mRanges[axis].min == JoyStick::MIN_AXIS && mRanges[axis].max != JoyStick::MAX_AXIS )
- { //Scale is perfect
- mState.mAxes[axis].abs = js[i].value;
+ //Check to see whether push or released event...
+ if(js[i].value)
+ {
+ mState.mButtons[button] = true;
+ if( mBuffered && mListener )
+ if(!mListener->buttonPressed(JoyStickEvent(this,mState), button)) return;
}
else
- { //Rescale
- float proportion = (float)(js[i].value-mRanges[axis].max)/(float)(mRanges[axis].min-mRanges[axis].max);
- mState.mAxes[axis].abs = (int)(32767.0f - (65535.0f * proportion));
+ {
+ mState.mButtons[button] = false;
+ if( mBuffered && mListener )
+ if(!mListener->buttonReleased(JoyStickEvent(this,mState), button)) return;
}
+ break;
}
- else if( js[i].code <= ABS_HAT3Y ) //A POV - Max four POVs allowed
+
+ case EV_ABS: //Absolute Axis
{
- //Normalise the POV to between 0-7
- //Even is X Axis, Odd is Y Axis
- unsigned char LinuxPovNumber = js[i].code - 16;
- short OIS_POVIndex = POV_MASK[LinuxPovNumber];
+ //A Stick (BrakeDefine is the highest possible Axis)
+ if( js[i].code <= ABS_BRAKE )
+ {
+ int axis = mAxisMap[js[i].code];
+ assert( axis < 32 && "Too many axes (Max supported is 32). Report this to OIS forums!" );
- //Handle X Axis first (Even) (left right)
- if((LinuxPovNumber & 0x0001) == 0)
- {
- //Why do this? Because, we use a bit field, and when this axis is east,
- //it can't possibly be west too. So clear out the two X axes, then refil
- //it in with the new direction bit.
- //Clear the East/West Bit Flags first
- mState.mPOV[OIS_POVIndex].direction &= 0x11110011;
- if( js[i].value == -1 ) //Left
- mState.mPOV[OIS_POVIndex].direction |= Pov::West;
- else if( js[i].value == 1 ) //Right
- mState.mPOV[OIS_POVIndex].direction |= Pov::East;
+ axisMoved[axis] = true;
+
+ //check for rescaling:
+ if( mRanges[axis].min == JoyStick::MIN_AXIS && mRanges[axis].max != JoyStick::MAX_AXIS )
+ { //Scale is perfect
+ mState.mAxes[axis].abs = js[i].value;
+ }
+ else
+ { //Rescale
+ float proportion = (float)(js[i].value-mRanges[axis].max)/(float)(mRanges[axis].min-mRanges[axis].max);
+ mState.mAxes[axis].abs = (int)(32767.0f - (65535.0f * proportion));
+ }
}
- //Handle Y Axis (Odd) (up down)
- else
+ else if( js[i].code <= ABS_HAT3Y ) //A POV - Max four POVs allowed
{
- //Clear the North/South Bit Flags first
- mState.mPOV[OIS_POVIndex].direction &= 0x11111100;
- if( js[i].value == -1 ) //Up
- mState.mPOV[OIS_POVIndex].direction |= Pov::North;
- else if( js[i].value == 1 ) //Down
- mState.mPOV[OIS_POVIndex].direction |= Pov::South;
+ //Normalise the POV to between 0-7
+ //Even is X Axis, Odd is Y Axis
+ unsigned char LinuxPovNumber = js[i].code - 16;
+ short OIS_POVIndex = POV_MASK[LinuxPovNumber];
+
+ //Handle X Axis first (Even) (left right)
+ if((LinuxPovNumber & 0x0001) == 0)
+ {
+ //Why do this? Because, we use a bit field, and when this axis is east,
+ //it can't possibly be west too. So clear out the two X axes, then refil
+ //it in with the new direction bit.
+ //Clear the East/West Bit Flags first
+ mState.mPOV[OIS_POVIndex].direction &= 0x11110011;
+ if( js[i].value == -1 ) //Left
+ mState.mPOV[OIS_POVIndex].direction |= Pov::West;
+ else if( js[i].value == 1 ) //Right
+ mState.mPOV[OIS_POVIndex].direction |= Pov::East;
+ }
+ //Handle Y Axis (Odd) (up down)
+ else
+ {
+ //Clear the North/South Bit Flags first
+ mState.mPOV[OIS_POVIndex].direction &= 0x11111100;
+ if( js[i].value == -1 ) //Up
+ mState.mPOV[OIS_POVIndex].direction |= Pov::North;
+ else if( js[i].value == 1 ) //Down
+ mState.mPOV[OIS_POVIndex].direction |= Pov::South;
+ }
+
+ if( mBuffered && mListener )
+ if( mListener->povMoved( JoyStickEvent(this,mState), OIS_POVIndex) == false )
+ return;
}
+ break;
+ }
- if( mBuffered && mListener )
- if( mListener->povMoved( JoyStickEvent(this,mState), OIS_POVIndex) == false )
- return;
+
+ case EV_REL: //Relative Axes (Do any joystick actually have a relative axis?)
+ #ifdef OIS_LINUX_JOY_DEBUG
+ cout << "\nWarning: Relatives axes not supported yet" << endl;
+ #endif
+ break;
+ default: break;
}
- break;
}
-
-
- case EV_REL: //Relative Axes (Do any joystick actually have a relative axis?)
-#ifdef OIS_LINUX_JOY_DEBUG
- cout << "\nWarning: Relatives axes not supported yet" << endl;
-#endif
- break;
- default: break;
- }
}
//All axes and POVs are combined into one movement per pair per captured frame
Modified: code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -32,7 +32,7 @@
using namespace OIS;
#include <iostream>
//-------------------------------------------------------------------//
-LinuxKeyboard::LinuxKeyboard(InputManager* creator, bool buffered, bool grab, bool useXRepeat)
+LinuxKeyboard::LinuxKeyboard(InputManager* creator, bool buffered, bool grab)
: Keyboard(creator->inputSystemName(), buffered, 0, creator)
{
setlocale(LC_CTYPE, ""); //Set the locale to (hopefully) the users LANG UTF-8 Env var
@@ -43,9 +43,6 @@
grabKeyboard = grab;
keyFocusLost = false;
- xAutoRepeat = useXRepeat;
- oldXAutoRepeat = false;
-
//X Key Map to KeyCode
keyConversion.insert(XtoOIS_KeyMap::value_type(XK_1, KC_1));
keyConversion.insert(XtoOIS_KeyMap::value_type(XK_2, KC_2));
@@ -212,20 +209,6 @@
XGrabKeyboard(display,window,True,GrabModeAsync,GrabModeAsync,CurrentTime);
keyFocusLost = false;
-
- if( xAutoRepeat == false )
- {
- //We do not want to blindly turn on autorepeat later when quiting if
- //it was not on to begin with.. So, let us check and see first
- XKeyboardState old;
- XGetKeyboardControl( display, &old );
- oldXAutoRepeat = false;
-
- if( old.global_auto_repeat == AutoRepeatModeOn )
- oldXAutoRepeat = true;
-
- XAutoRepeatOff( display );
- }
}
//-------------------------------------------------------------------//
@@ -233,9 +216,6 @@
{
if( display )
{
- if( oldXAutoRepeat )
- XAutoRepeatOn(display);
-
if( grabKeyboard )
XUngrabKeyboard(display, CurrentTime);
@@ -302,11 +282,12 @@
LinuxInputManager* linMan = static_cast<LinuxInputManager*>(mCreator);
while( XPending(display) > 0 )
- { XNextEvent(display, &event); if( KeyPress == event.type )
+ {
+ XNextEvent(display, &event); if(KeyPress == event.type)
{
unsigned int character = 0;
- if( mTextMode != Off )
+ if(mTextMode != Off)
{
unsigned char buffer[6] = {0,0,0,0,0,0};
XLookupString(&event.xkey, (char*)buffer, 6, &key, 0);
@@ -331,15 +312,19 @@
//Check for Alt-Tab
if( event.xkey.state & Mod1Mask && key == XK_Tab )
linMan->_setGrabState(false);
- } else if( KeyRelease == event.type )
+ }
+ else if(KeyRelease == event.type)
{
- //Mask out the modifier states X sets.. or we will get improper values
- event.xkey.state &= ~ShiftMask;
- event.xkey.state &= ~LockMask;
+ if(!_isKeyRepeat(event))
+ {
+ //Mask out the modifier states X sets.. or we will get improper values
+ event.xkey.state &= ~ShiftMask;
+ event.xkey.state &= ~LockMask;
- //Else, it is a valid key release
- XLookupString(&event.xkey,NULL,0,&key,NULL);
- _injectKeyUp(key); }
+ XLookupString(&event.xkey,NULL,0,&key,NULL);
+ _injectKeyUp(key);
+ }
+ }
}
//If grabbing mode is on.. Handle focus lost/gained via Alt-Tab and mouse clicks
Modified: code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.h
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -33,7 +33,7 @@
class LinuxKeyboard : public Keyboard
{
public:
- LinuxKeyboard(InputManager* creator, bool buffered, bool grab, bool useXRepeat );
+ LinuxKeyboard(InputManager* creator, bool buffered, bool grab);
virtual ~LinuxKeyboard();
/** @copydoc Keyboard::isKeyDown */
@@ -58,6 +58,23 @@
virtual void _initialize();
protected:
+ inline bool _isKeyRepeat(XEvent &event)
+ {
+ //When a key is repeated, there will be two events: released, followed by another immediate pressed. So check to see if another pressed is present
+ if(!XPending(display))
+ return false;
+
+ XEvent e;
+ XPeekEvent(display, &e);
+ if(e.type == KeyPress && e.xkey.keycode == event.xkey.keycode && (e.xkey.time - event.xkey.time) < 2)
+ {
+ XNextEvent(display, &e);
+ return true;
+ }
+
+ return false;
+ }
+
bool _injectKeyDown( KeySym key, int text );
bool _injectKeyUp( KeySym key );
@@ -74,9 +91,6 @@
bool grabKeyboard;
bool keyFocusLost;
- bool xAutoRepeat;
- bool oldXAutoRepeat;
-
std::string mGetString;
};
}
Modified: code/branches/kicklib/src/external/ois/linux/LinuxMouse.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxMouse.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/linux/LinuxMouse.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -172,15 +172,17 @@
}
//Compute this frames Relative X & Y motion
- mState.X.rel = event.xmotion.x - oldXMouseX;
- mState.Y.rel = event.xmotion.y - oldXMouseY;
+ int dx = event.xmotion.x - oldXMouseX;
+ int dy = event.xmotion.y - oldXMouseY;
//Store old values for next time to compute relative motion
oldXMouseX = event.xmotion.x;
oldXMouseY = event.xmotion.y;
- mState.X.abs += mState.X.rel;
- mState.Y.abs += mState.Y.rel;
+ mState.X.abs += dx;
+ mState.Y.abs += dy;
+ mState.X.rel += dx;
+ mState.Y.rel += dy;
//Check to see if we are grabbing the mouse to the window (requires clipping and warping)
if( grabMouse )
Modified: code/branches/kicklib/src/external/ois/linux/LinuxPrereqs.h
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/linux/LinuxPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -31,7 +31,7 @@
#include "OISPrereqs.h"
//! Max number of elements to collect from buffered input
-#define JOY_BUFFERSIZE 10
+#define JOY_BUFFERSIZE 64
namespace OIS
{
Modified: code/branches/kicklib/src/external/ois/mac/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/external/ois/mac/CMakeLists.txt 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/mac/CMakeLists.txt 2011-03-14 02:53:38 UTC (rev 8071)
@@ -2,15 +2,17 @@
MacHelpers.h
MacHIDManager.h
MacInputManager.h
+ MacJoyStick.h
MacKeyboard.h
MacMouse.h
MacPrereqs.h
-COMPILATION_BEGIN OISMacCompilation.cpp
+ #COMPILATION_BEGIN OISMacCompilation.cpp
MacHelpers.cpp
MacHIDManager.cpp
MacInputManager.cpp
+ MacJoyStick.cpp
MacKeyboard.cpp
MacMouse.cpp
-COMPILATION_END
+ #COMPILATION_END
)
Modified: code/branches/kicklib/src/external/ois/mac/MacHIDManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacHIDManager.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/mac/MacHIDManager.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -19,8 +19,9 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
-*/
+ */
#include "mac/MacHIDManager.h"
+#include "mac/MacJoyStick.h"
#include "OISException.h"
#include "OISObject.h"
@@ -41,7 +42,7 @@
CFArrayRef getDictionaryItemAsRef(CFDictionaryRef dict, const char* keyName)
{
CFTypeRef temp = CFDictionaryGetValue(dict, OIS_CFString(keyName));
-
+
if(temp && CFGetTypeID(temp) == CFArrayGetTypeID())
return (CFArrayRef)temp;
else
@@ -52,7 +53,7 @@
CFStringRef getDictionaryItemAsRef(CFDictionaryRef dict, const char* keyName)
{
CFTypeRef temp = CFDictionaryGetValue(dict, OIS_CFString(keyName));
-
+
if(temp && CFGetTypeID(temp) == CFStringGetTypeID())
return (CFStringRef)temp;
else
@@ -63,7 +64,7 @@
CFNumberRef getDictionaryItemAsRef(CFDictionaryRef dict, const char* keyName)
{
CFTypeRef temp = CFDictionaryGetValue(dict, OIS_CFString(keyName));
-
+
if(temp && CFGetTypeID(temp) == CFNumberGetTypeID())
return (CFNumberRef)temp;
else
@@ -82,7 +83,7 @@
CFDictionaryRef getArrayItemAsRef(CFArrayRef array, CFIndex idx)
{
CFTypeRef temp = CFArrayGetValueAtIndex(array, idx);
-
+
if(temp && CFGetTypeID(temp) == CFDictionaryGetTypeID())
return (CFDictionaryRef)temp;
else
@@ -92,10 +93,10 @@
//------------------------------------------------------------------------------------------------------//
int getInt32(CFNumberRef ref)
{
- int r = 0;
- if (r)
- CFNumberGetValue(ref, kCFNumberIntType, &r);
- return r;
+ int r = 0;
+ if (r)
+ CFNumberGetValue(ref, kCFNumberIntType, &r);
+ return r;
}
//--------------------------------------------------------------------------------//
@@ -111,70 +112,97 @@
//------------------------------------------------------------------------------------------------------//
void MacHIDManager::initialize()
{
+ //Make the search more specific by adding usage flags
+ int usage = kHIDUsage_GD_Joystick;
+ int page = kHIDPage_GenericDesktop;
+
+ io_iterator_t iterator = lookUpDevices(usage, page);
+
+ if(iterator)
+ iterateAndOpenDevices(iterator);
+
+ //Doesn't support multiple usage flags, iterate twice
+ usage = kHIDUsage_GD_GamePad;
+ iterator = lookUpDevices(usage, page);
+
+ if(iterator)
+ iterateAndOpenDevices(iterator);
+}
+
+//------------------------------------------------------------------------------------------------------//
+io_iterator_t MacHIDManager::lookUpDevices(int usage, int page)
+{
CFMutableDictionaryRef deviceLookupMap = IOServiceMatching(kIOHIDDeviceKey);
if(!deviceLookupMap)
OIS_EXCEPT(E_General, "Could not setup HID device search parameters");
-
- //Make the search more specific by adding usage flags
- int usage = kHIDUsage_GD_GamePad | kHIDUsage_GD_Joystick,
- page = kHIDPage_GenericDesktop;
-
- CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage),
- pageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page);
-
+
+ CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage);
+ CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page);
+
CFDictionarySetValue(deviceLookupMap, CFSTR(kIOHIDPrimaryUsageKey), usageRef);
CFDictionarySetValue(deviceLookupMap, CFSTR(kIOHIDPrimaryUsagePageKey), pageRef);
-
+
//IOServiceGetMatchingServices consumes the map so we do not have to release it ourself
io_iterator_t iterator = 0;
IOReturn result = IOServiceGetMatchingServices(kIOMasterPortDefault, deviceLookupMap, &iterator);
- if (result == kIOReturnSuccess && iterator)
+
+ CFRelease(usageRef);
+ CFRelease(pageRef);
+
+ if(result == kIOReturnSuccess)
{
- io_object_t hidDevice = 0;
- while ((hidDevice = IOIteratorNext(iterator)) !=0)
+ return iterator;
+ }
+ //TODO: Throw exception instead?
+ else
+ {
+ return 0;
+ }
+}
+
+//------------------------------------------------------------------------------------------------------//
+void MacHIDManager::iterateAndOpenDevices(io_iterator_t iterator)
+{
+ io_object_t hidDevice = 0;
+ while ((hidDevice = IOIteratorNext(iterator)) !=0)
+ {
+ //Get the current registry items property map
+ CFMutableDictionaryRef propertyMap = 0;
+ if (IORegistryEntryCreateCFProperties(hidDevice, &propertyMap, kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS && propertyMap)
{
- //Get the current registry items property map
- CFMutableDictionaryRef propertyMap = 0;
- if (IORegistryEntryCreateCFProperties(hidDevice, &propertyMap, kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS && propertyMap)
+ //Go through device to find all needed info
+ HidInfo* hid = enumerateDeviceProperties(propertyMap);
+
+ if(hid)
{
- //Go through device to find all needed info
- HidInfo* hid = enumerateDeviceProperties(propertyMap);
- if(hid)
- mDeviceList.push_back(hid);
-
//todo - we need to hold an open interface so we do not have to enumerate again later
//should be able to watch for device removals also
-
- /// Testing opening / closing interface
- //IOCFPlugInInterface **pluginInterface = NULL;
- //SInt32 score = 0;
- //if (IOCreatePlugInInterfaceForService(hidDevice, kIOHIDDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &pluginInterface, &score) == kIOReturnSuccess)
- //{
- // IOHIDDeviceInterface **interface;
- // HRESULT pluginResult = (*pluginInterface)->QueryInterface(pluginInterface, CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), (void **)&(interface));
- // if(pluginResult == S_OK)
- // cout << "Successfully created plugin interface for device\n";
- // else
- // cout << "Not able to create plugin interface\n";
-
- // IODestroyPlugInInterface(pluginInterface);
-
- // if ((*interface)->open(interface, 0) == KERN_SUCCESS)
- // cout << "Opened interface.\n";
- // else
- // cout << "Failed to open\n";
-
- // (*interface)->close(interface);
- //}
- //
+
+ // Testing opening / closing interface
+ IOCFPlugInInterface **pluginInterface = NULL;
+ SInt32 score = 0;
+ if (IOCreatePlugInInterfaceForService(hidDevice, kIOHIDDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &pluginInterface, &score) == kIOReturnSuccess)
+ {
+ IOHIDDeviceInterface **interface;
+
+ HRESULT pluginResult = (*pluginInterface)->QueryInterface(pluginInterface, CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), (void **)&(interface));
+
+ if(pluginResult != S_OK)
+ OIS_EXCEPT(E_General, "Not able to create plugin interface");
+
+ IODestroyPlugInInterface(pluginInterface);
+
+ hid->interface = interface;
+
+ //Check for duplicates - some devices have multiple usage
+ if(std::find(mDeviceList.begin(), mDeviceList.end(), hid) == mDeviceList.end())
+ mDeviceList.push_back(hid);
+ }
}
}
-
- IOObjectRelease(iterator);
}
-
- CFRelease(usageRef);
- CFRelease(pageRef);
+
+ IOObjectRelease(iterator);
}
//------------------------------------------------------------------------------------------------------//
@@ -187,19 +215,19 @@
CFStringRef str = getDictionaryItemAsRef<CFStringRef>(propertyMap, kIOHIDManufacturerKey);
if (str)
info->vendor = CFStringGetCStringPtr(str, CFStringGetSystemEncoding());
-
+
str = getDictionaryItemAsRef<CFStringRef>(propertyMap, kIOHIDProductKey);
if (str)
info->productKey = CFStringGetCStringPtr(str, CFStringGetSystemEncoding());
-
+
info->combinedKey = info->vendor + " " + info->productKey;
-
+
//Go through all items in this device (i.e. buttons, hats, sticks, axes, etc)
CFArrayRef array = getDictionaryItemAsRef<CFArrayRef>(propertyMap, kIOHIDElementKey);
if (array)
for (int i = 0; i < CFArrayGetCount(array); i++)
parseDeviceProperties(getArrayItemAsRef<CFDictionaryRef>(array, i));
-
+
return info;
}
@@ -208,7 +236,7 @@
{
if(!properties)
return;
-
+
CFArrayRef array = getDictionaryItemAsRef<CFArrayRef>(properties, kIOHIDElementKey);
if (array)
{
@@ -226,34 +254,34 @@
{
switch(getInt32(getDictionaryItemAsRef<CFNumberRef>(element, kIOHIDElementUsagePageKey)))
{
- case kHIDPage_GenericDesktop:
- switch(getInt32(getDictionaryItemAsRef<CFNumberRef>(element, kIOHIDElementUsageKey)))
+ case kHIDPage_GenericDesktop:
+ switch(getInt32(getDictionaryItemAsRef<CFNumberRef>(element, kIOHIDElementUsageKey)))
{
- case kHIDUsage_GD_Pointer:
- cout << "\tkHIDUsage_GD_Pointer\n";
- parseDevicePropertiesGroup(element);
+ case kHIDUsage_GD_Pointer:
+ cout << "\tkHIDUsage_GD_Pointer\n";
+ parseDevicePropertiesGroup(element);
+ break;
+ case kHIDUsage_GD_X:
+ case kHIDUsage_GD_Y:
+ case kHIDUsage_GD_Z:
+ case kHIDUsage_GD_Rx:
+ case kHIDUsage_GD_Ry:
+ case kHIDUsage_GD_Rz:
+ cout << "\tAxis\n";
+ break;
+ case kHIDUsage_GD_Slider:
+ case kHIDUsage_GD_Dial:
+ case kHIDUsage_GD_Wheel:
+ cout << "\tUnsupported kHIDUsage_GD_Wheel\n";
+ break;
+ case kHIDUsage_GD_Hatswitch:
+ cout << "\tUnsupported - kHIDUsage_GD_Hatswitch\n";
+ break;
+ }
break;
- case kHIDUsage_GD_X:
- case kHIDUsage_GD_Y:
- case kHIDUsage_GD_Z:
- case kHIDUsage_GD_Rx:
- case kHIDUsage_GD_Ry:
- case kHIDUsage_GD_Rz:
- cout << "\tAxis\n";
+ case kHIDPage_Button:
+ cout << "\tkHIDPage_Button\n";
break;
- case kHIDUsage_GD_Slider:
- case kHIDUsage_GD_Dial:
- case kHIDUsage_GD_Wheel:
- cout << "\tUnsupported kHIDUsage_GD_Wheel\n";
- break;
- case kHIDUsage_GD_Hatswitch:
- cout << "\tUnsupported - kHIDUsage_GD_Hatswitch\n";
- break;
- }
- break;
- case kHIDPage_Button:
- cout << "\tkHIDPage_Button\n";
- break;
}
}
}
@@ -266,7 +294,7 @@
{
if(!properties)
return;
-
+
CFArrayRef array = getDictionaryItemAsRef<CFArrayRef>(properties, kIOHIDElementKey);
if(array)
{
@@ -277,29 +305,29 @@
{
switch(getInt32(getDictionaryItemAsRef<CFNumberRef>(element, kIOHIDElementUsagePageKey)))
{
- case kHIDPage_GenericDesktop:
- switch(getInt32(getDictionaryItemAsRef<CFNumberRef>(element, kIOHIDElementUsageKey)))
+ case kHIDPage_GenericDesktop:
+ switch(getInt32(getDictionaryItemAsRef<CFNumberRef>(element, kIOHIDElementUsageKey)))
{
- case kHIDUsage_GD_X:
- case kHIDUsage_GD_Y:
- case kHIDUsage_GD_Z:
- case kHIDUsage_GD_Rx:
- case kHIDUsage_GD_Ry:
- case kHIDUsage_GD_Rz:
- cout << "\t\tAxis\n";
+ case kHIDUsage_GD_X:
+ case kHIDUsage_GD_Y:
+ case kHIDUsage_GD_Z:
+ case kHIDUsage_GD_Rx:
+ case kHIDUsage_GD_Ry:
+ case kHIDUsage_GD_Rz:
+ cout << "\t\tAxis\n";
+ break;
+ case kHIDUsage_GD_Slider:
+ case kHIDUsage_GD_Dial:
+ case kHIDUsage_GD_Wheel:
+ cout << "\tUnsupported - kHIDUsage_GD_Wheel\n";
+ break;
+ case kHIDUsage_GD_Hatswitch:
+ cout << "\tUnsupported - kHIDUsage_GD_Hatswitch\n";
+ break;
+ }
break;
- case kHIDUsage_GD_Slider:
- case kHIDUsage_GD_Dial:
- case kHIDUsage_GD_Wheel:
- cout << "\tUnsupported - kHIDUsage_GD_Wheel\n";
+ case kHIDPage_Button:
break;
- case kHIDUsage_GD_Hatswitch:
- cout << "\tUnsupported - kHIDUsage_GD_Hatswitch\n";
- break;
- }
- break;
- case kHIDPage_Button:
- break;
}
}
}
@@ -316,7 +344,7 @@
if((*it)->inUse == false)
ret.insert(std::make_pair((*it)->type, (*it)->combinedKey));
}
-
+
return ret;
}
@@ -325,7 +353,7 @@
{
int ret = 0;
HidInfoList::iterator it = mDeviceList.begin(), end = mDeviceList.end();
-
+
for(; it != end; ++it)
{
if((*it)->type == iType)
@@ -340,13 +368,13 @@
{
int ret = 0;
HidInfoList::iterator it = mDeviceList.begin(), end = mDeviceList.end();
-
+
for(; it != end; ++it)
{
if((*it)->inUse == false && (*it)->type == iType)
ret++;
}
-
+
return ret;
}
@@ -354,7 +382,7 @@
bool MacHIDManager::vendorExist(Type iType, const std::string & vendor)
{
HidInfoList::iterator it = mDeviceList.begin(), end = mDeviceList.end();
-
+
for(; it != end; ++it)
{
if((*it)->type == iType && (*it)->combinedKey == vendor)
@@ -366,22 +394,36 @@
//--------------------------------------------------------------------------------//
Object* MacHIDManager::createObject(InputManager* creator, Type iType, bool bufferMode,
- const std::string & vendor)
+ const std::string & vendor)
{
Object *obj = 0;
-
+
HidInfoList::iterator it = mDeviceList.begin(), end = mDeviceList.end();
for(; it != end; ++it)
{
if((*it)->inUse == false && (*it)->type == iType && (vendor == "" || (*it)->combinedKey == vendor))
{
- //create device
+ switch(iType)
+ {
+ case OISJoyStick:
+ {
+ int totalDevs = totalDevices(iType);
+ int freeDevs = freeDevices(iType);
+ int devID = totalDevs - freeDevs;
+
+ obj = new MacJoyStick((*it)->combinedKey, bufferMode, *it, creator, devID);
+ (*it)->inUse = true;
+ return obj;
+ }
+ case OISTablet:
+ //Create MacTablet
+ break;
+ default:
+ break;
+ }
}
}
-
- if( obj == 0 )
- OIS_EXCEPT(E_InputDeviceNonExistant, "No devices match requested type.");
-
+
return obj;
}
Modified: code/branches/kicklib/src/external/ois/mac/MacHIDManager.h
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacHIDManager.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/mac/MacHIDManager.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -69,6 +69,9 @@
~MacHIDManager();
void initialize();
+
+ void iterateAndOpenDevices(io_iterator_t iterator);
+ io_iterator_t lookUpDevices(int usage, int page);
//FactoryCreator Overrides
/** @copydoc FactoryCreator::deviceList */
Modified: code/branches/kicklib/src/external/ois/mac/MacInputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacInputManager.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/mac/MacInputManager.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -187,8 +187,11 @@
break;
}
default:
+ {
+ obj = mHIDManager->createObject(creator, iType, bufferMode, vendor);
break;
}
+ }
if( obj == 0 )
OIS_EXCEPT(E_InputDeviceNonExistant, "No devices match requested type.");
Copied: code/branches/kicklib/src/external/ois/mac/MacJoyStick.cpp (from rev 7788, code/branches/ois_update/src/external/ois/mac/MacJoyStick.cpp)
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacJoyStick.cpp (rev 0)
+++ code/branches/kicklib/src/external/ois/mac/MacJoyStick.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,325 @@
+/*
+ The zlib/libpng License
+
+ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
+
+ This software is provided 'as-is', without any express or implied warranty. In no event will
+ the authors be held liable for any damages arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose, including commercial
+ applications, and to alter it and redistribute it freely, subject to the following
+ restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not claim that
+ you wrote the original software. If you use this software in a product,
+ an acknowledgment in the product documentation would be appreciated but is
+ not required.
+
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "mac/MacJoyStick.h"
+#include "mac/MacHIDManager.h"
+#include "mac/MacInputManager.h"
+#include "OISEvents.h"
+#include "OISException.h"
+
+#include <cassert>
+
+using namespace OIS;
+
+//--------------------------------------------------------------------------------------------------//
+MacJoyStick::MacJoyStick(const std::string &vendor, bool buffered, HidInfo* info, InputManager* creator, int devID) :
+JoyStick(vendor, buffered, devID, creator), mInfo(info)
+{
+
+}
+
+//--------------------------------------------------------------------------------------------------//
+MacJoyStick::~MacJoyStick()
+{
+ //TODO: check if the queue has been started first?
+ //(*mQueue)->stop(mQueue);
+ (*mQueue)->dispose(mQueue);
+ (*mQueue)->Release(mQueue);
+
+
+ //TODO: check if the interface has been opened first?
+ (*mInfo->interface)->close(mInfo->interface);
+ (*mInfo->interface)->Release(mInfo->interface);
+}
+
+//--------------------------------------------------------------------------------------------------//
+void MacJoyStick::_initialize()
+{
+ assert(mInfo && "Given HidInfo invalid");
+ assert(mInfo->interface && "Joystick interface invalid");
+
+ //TODO: Is this necessary?
+ //Clear old state
+ mState.mAxes.clear();
+
+ if ((*mInfo->interface)->open(mInfo->interface, 0) != KERN_SUCCESS)
+ OIS_EXCEPT(E_General, "MacJoyStick::_initialize() >> Could not initialize joy device!");
+
+ mState.clear();
+
+ _enumerateCookies();
+
+ mState.mButtons.resize(mInfo->numButtons);
+ mState.mAxes.resize(mInfo->numAxes);
+
+ mQueue = _createQueue();
+}
+
+class FindAxisCookie : public std::unary_function<std::pair<IOHIDElementCookie, AxisInfo>&, bool>
+{
+public:
+ FindAxisCookie(IOHIDElementCookie cookie) : m_Cookie(cookie) {}
+ bool operator()(const std::pair<IOHIDElementCookie, AxisInfo>& pair) const
+ {
+ return pair.first == m_Cookie;
+ }
+private:
+ IOHIDElementCookie m_Cookie;
+};
+
+//--------------------------------------------------------------------------------------------------//
+void MacJoyStick::capture()
+{
+ assert(mQueue && "Queue must be initialized before calling MacJoyStick::capture()");
+
+ AbsoluteTime zeroTime = {0,0};
+
+ IOHIDEventStruct event;
+ IOReturn result = (*mQueue)->getNextEvent(mQueue, &event, zeroTime, 0);
+ while(result == kIOReturnSuccess)
+ {
+ switch(event.type)
+ {
+ case kIOHIDElementTypeInput_Button:
+ {
+ std::vector<IOHIDElementCookie>::iterator buttonIt = std::find(mCookies.buttonCookies.begin(), mCookies.buttonCookies.end(), event.elementCookie);
+ int button = std::distance(mCookies.buttonCookies.begin(), buttonIt);
+ mState.mButtons[button] = (event.value == 1);
+
+ if(mBuffered && mListener)
+ {
+ if(event.value == 0)
+ mListener->buttonPressed(JoyStickEvent(this, mState), button);
+ else if(event.value == 1)
+ mListener->buttonReleased(JoyStickEvent(this, mState), button);
+ }
+ break;
+ }
+ case kIOHIDElementTypeInput_Misc:
+ //TODO: It's an axis! - kind of - for gamepads - or should this be a pov?
+ case kIOHIDElementTypeInput_Axis:
+ std::map<IOHIDElementCookie, AxisInfo>::iterator axisIt = std::find_if(mCookies.axisCookies.begin(), mCookies.axisCookies.end(), FindAxisCookie(event.elementCookie));
+ int axis = std::distance(mCookies.axisCookies.begin(), axisIt);
+
+ //Copied from LinuxJoyStickEvents.cpp, line 149
+ const AxisInfo& axisInfo = axisIt->second;
+ float proportion = (float) (event.value - axisInfo.max) / (float) (axisInfo.min - axisInfo.max);
+ mState.mAxes[axis].abs = -JoyStick::MIN_AXIS - (JoyStick::MAX_AXIS * 2 * proportion);
+
+ if(mBuffered && mListener) mListener->axisMoved(JoyStickEvent(this, mState), axis);
+ break;
+ }
+
+ result = (*mQueue)->getNextEvent(mQueue, &event, zeroTime, 0);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------//
+void MacJoyStick::setBuffered(bool buffered)
+{
+ mBuffered = buffered;
+}
+
+//--------------------------------------------------------------------------------------------------//
+Interface* MacJoyStick::queryInterface(Interface::IType type)
+{
+ //Thought about using covariant return type here.. however,
+ //some devices may allow LED light changing, or other interface stuff
+
+ //f( ff_device && type == Interface::ForceFeedback )
+ //return ff_device;
+ //else
+ return 0;
+}
+
+//--------------------------------------------------------------------------------------------------//
+void MacJoyStick::_enumerateCookies()
+{
+ assert(mInfo && "Given HidInfo invalid");
+ assert(mInfo->interface && "Joystick interface invalid");
+
+ CFTypeRef object;
+ long number;
+ IOHIDElementCookie cookie;
+ long usage;
+ long usagePage;
+ int min;
+ int max;
+
+ CFDictionaryRef element;
+
+ // Copy all elements, since we're grabbing most of the elements
+ // for this device anyway, and thus, it's faster to iterate them
+ // ourselves. When grabbing only one or two elements, a matching
+ // dictionary should be passed in here instead of NULL.
+ CFArrayRef elements;
+ IOReturn success = reinterpret_cast<IOHIDDeviceInterface122*>(*mInfo->interface)->copyMatchingElements(mInfo->interface, NULL, &elements);
+
+ if (success == kIOReturnSuccess)
+ {
+ const CFIndex numOfElements = CFArrayGetCount(elements);
+ for (CFIndex i = 0; i < numOfElements; ++i)
+ {
+ element = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(elements, i));
+
+ //Get cookie
+ object = (CFDictionaryGetValue(element,
+ CFSTR(kIOHIDElementCookieKey)));
+ if (object == 0 || CFGetTypeID(object) != CFNumberGetTypeID())
+ continue;
+ if(!CFNumberGetValue((CFNumberRef) object, kCFNumberLongType,
+ &number))
+ continue;
+ cookie = (IOHIDElementCookie) number;
+
+ //Get usage
+ object = CFDictionaryGetValue(element,
+ CFSTR(kIOHIDElementUsageKey));
+ if (object == 0 || CFGetTypeID(object) != CFNumberGetTypeID())
+ continue;
+ if (!CFNumberGetValue((CFNumberRef) object, kCFNumberLongType,
+ &number))
+ continue;
+ usage = number;
+
+ //Get min
+ object = CFDictionaryGetValue(element,
+ CFSTR(kIOHIDElementMinKey)); // kIOHIDElementMinKey or kIOHIDElementScaledMinKey?, no idea ...
+ if (object == 0 || CFGetTypeID(object) != CFNumberGetTypeID())
+ continue;
+ if (!CFNumberGetValue((CFNumberRef) object, kCFNumberIntType,
+ &number))
+ continue;
+ min = number;
+
+ //Get max
+ object = CFDictionaryGetValue(element,
+ CFSTR(kIOHIDElementMaxKey)); // kIOHIDElementMaxKey or kIOHIDElementScaledMaxKey?, no idea ...
+ if (object == 0 || CFGetTypeID(object) != CFNumberGetTypeID())
+ continue;
+ if (!CFNumberGetValue((CFNumberRef) object, kCFNumberIntType,
+ &number))
+ continue;
+ max = number;
+
+ //Get usage page
+ object = CFDictionaryGetValue(element,
+ CFSTR(kIOHIDElementUsagePageKey));
+
+ if (object == 0 || CFGetTypeID(object) != CFNumberGetTypeID())
+ continue;
+
+ if (!CFNumberGetValue((CFNumberRef) object, kCFNumberLongType,
+ &number))
+ continue;
+
+ usagePage = number;
+ switch(usagePage)
+ {
+ case kHIDPage_GenericDesktop:
+ switch(usage)
+ {
+ case kHIDUsage_GD_Pointer:
+ break;
+ case kHIDUsage_GD_X:
+ case kHIDUsage_GD_Y:
+ case kHIDUsage_GD_Z:
+ case kHIDUsage_GD_Rx:
+ case kHIDUsage_GD_Ry:
+ case kHIDUsage_GD_Rz:
+ mCookies.axisCookies.insert(std::make_pair(cookie, AxisInfo(min, max)));
+ break;
+ case kHIDUsage_GD_Slider:
+ case kHIDUsage_GD_Dial:
+ case kHIDUsage_GD_Wheel:
+ break;
+ case kHIDUsage_GD_Hatswitch:
+ break;
+ }
+ break;
+ case kHIDPage_Button:
+ mCookies.buttonCookies.push_back(cookie);
+ break;
+ }
+ }
+
+ mInfo->numButtons = mCookies.buttonCookies.size();
+ mInfo->numAxes = mCookies.axisCookies.size();
+
+ }
+ else
+ {
+ OIS_EXCEPT(E_General, "JoyStick elements could not be copied: copyMatchingElements failed with error: " + success);
+ }
+
+}
+
+//--------------------------------------------------------------------------------------------------//
+IOHIDQueueInterface** MacJoyStick::_createQueue(unsigned int depth)
+{
+ assert(mInfo && "Given HidInfo invalid");
+ assert(mInfo->interface && "Joystick interface invalid");
+
+ IOHIDQueueInterface** queue = (*mInfo->interface)->allocQueue(mInfo->interface);
+
+ if (queue)
+ {
+ //create the queue
+ IOReturn result = (*queue)->create(queue, 0, depth);
+
+ if(result == kIOReturnSuccess)
+ {
+ //add elements to the queue
+ std::map<IOHIDElementCookie, AxisInfo>::iterator axisIt = mCookies.axisCookies.begin();
+ for(; axisIt != mCookies.axisCookies.end(); ++axisIt)
+ {
+ result = (*queue)->addElement(queue, axisIt->first, 0);
+ }
+
+ std::vector<IOHIDElementCookie>::iterator buttonIt = mCookies.buttonCookies.begin();
+ for(; buttonIt != mCookies.buttonCookies.end(); ++buttonIt)
+ {
+ result = (*queue)->addElement(queue, (*buttonIt), 0);
+ }
+
+ //start data delivery to queue
+ result = (*queue)->start(queue);
+ if(result == kIOReturnSuccess)
+ {
+ return queue;
+ }
+ else
+ {
+ OIS_EXCEPT(E_General, "Queue could not be started.");
+ }
+ }
+ else
+ {
+ OIS_EXCEPT(E_General, "Queue could not be created.");
+ }
+ }
+ else
+ {
+ OIS_EXCEPT(E_General, "Queue allocation failed.");
+ }
+}
Copied: code/branches/kicklib/src/external/ois/mac/MacJoyStick.h (from rev 7788, code/branches/ois_update/src/external/ois/mac/MacJoyStick.h)
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacJoyStick.h (rev 0)
+++ code/branches/kicklib/src/external/ois/mac/MacJoyStick.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,76 @@
+/*
+ The zlib/libpng License
+
+ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
+
+ This software is provided 'as-is', without any express or implied warranty. In no event will
+ the authors be held liable for any damages arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose, including commercial
+ applications, and to alter it and redistribute it freely, subject to the following
+ restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not claim that
+ you wrote the original software. If you use this software in a product,
+ an acknowledgment in the product documentation would be appreciated but is
+ not required.
+
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source distribution.
+ */
+#ifndef MAC_Joystick_H
+#define MAC_Joystick_H
+#include "OISJoyStick.h"
+#include "mac/MacPrereqs.h"
+#include "mac/MacHIDManager.h"
+
+namespace OIS
+{
+ struct AxisInfo
+ {
+ int min;
+ int max;
+
+ AxisInfo(int min, int max)
+ : min(min), max(max) {}
+ };
+
+ typedef struct cookie_struct
+ {
+ std::map<IOHIDElementCookie, AxisInfo> axisCookies;
+ std::vector<IOHIDElementCookie> buttonCookies;
+ } cookie_struct_t;
+
+ //class HidDeviceInfo
+
+ class MacJoyStick : public JoyStick
+ {
+ public:
+ MacJoyStick(const std::string& vendor, bool buffered, HidInfo* info, InputManager* creator, int devID);
+
+ virtual ~MacJoyStick();
+
+ /** @copydoc Object::setBuffered */
+ virtual void setBuffered(bool buffered);
+
+ /** @copydoc Object::capture */
+ virtual void capture();
+
+ /** @copydoc Object::queryInterface */
+ virtual Interface* queryInterface(Interface::IType type);
+
+ /** @copydoc Object::_initialize */
+ virtual void _initialize();
+
+ void _enumerateCookies();
+
+ IOHIDQueueInterface** _createQueue(unsigned int depth = 8);
+ protected:
+ HidInfo* mInfo;
+ cookie_struct_t mCookies;
+ IOHIDQueueInterface** mQueue;
+ };
+}
+#endif
Modified: code/branches/kicklib/src/external/ois/mac/MacKeyboard.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacKeyboard.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/mac/MacKeyboard.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -198,20 +198,12 @@
UniChar text[10];
char macChar;
- // TODO clean this up
if (mTextMode == Unicode)
{
//get string size
UInt32 stringsize;
- //status = GetEventParameter( theEvent, 'kuni', typeUnicodeText, NULL, 0, &stringsize, NULL);
- //status = GetEventParameter( theEvent, 'kuni', typeUnicodeText, NULL, sizeof(UniChar)*10, NULL, &text );
status = GetEventParameter( theEvent, 'kuni', typeUnicodeText, NULL, sizeof(UniChar) * 10, &stringsize, &text );
- std::cout << "String length: " << stringsize << std::endl;
- //wstring unitext;
- //for (int i=0;i<10;i++) unitext += (wchar_t)text[i];
- //wcout << "Unicode out: " << unitext << endl;
-
if(stringsize > 0)
{
// for each unicode char, send an event
Modified: code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -20,9 +20,9 @@
3. This notice may not be removed or altered from any source distribution.
*/
-#include "Win32/Win32ForceFeedback.h"
+#include "win32/Win32ForceFeedback.h"
#include "OISException.h"
-#include <Math.h>
+#include <math.h>
// 0 = No trace; 1 = Important traces; 2 = Debug traces
#define OIS_WIN32_JOYFF_DEBUG 0
Modified: code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -25,7 +25,7 @@
#include "OISPrereqs.h"
#include "OISForceFeedback.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
namespace OIS
{
Modified: code/branches/kicklib/src/external/ois/win32/Win32InputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32InputManager.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32InputManager.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -20,10 +20,10 @@
3. This notice may not be removed or altered from any source distribution.
*/
-#include "Win32/Win32InputManager.h"
-#include "Win32/Win32Keyboard.h"
-#include "Win32/Win32Mouse.h"
-#include "Win32/Win32JoyStick.h"
+#include "win32/Win32InputManager.h"
+#include "win32/Win32KeyBoard.h"
+#include "win32/Win32Mouse.h"
+#include "win32/Win32JoyStick.h"
#include "OISException.h"
using namespace OIS;
@@ -74,7 +74,7 @@
hInst = GetModuleHandle(0);
- //Create the input system
+ //Create the device
hr = DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&mDirectInput, NULL );
if (FAILED(hr))
OIS_EXCEPT( E_General, "Win32InputManager::Win32InputManager >> Not able to init DirectX8 Input!");
@@ -117,7 +117,20 @@
void Win32InputManager::_enumerateDevices()
{
//Enumerate all attached devices
- mDirectInput->EnumDevices(NULL , _DIEnumDevCallback, this, DIEDFL_ATTACHEDONLY);
+ mDirectInput->EnumDevices(NULL, _DIEnumDevCallback, this, DIEDFL_ATTACHEDONLY);
+
+#ifdef OIS_WIN32_XINPUT_SUPPORT
+ //let's check how many possible XInput devices we may have (max 4)...
+ for(int i = 0; i < 3; ++i)
+ {
+ XINPUT_STATE state;
+ if(XInputGetState(i, &state) != ERROR_DEVICE_NOT_CONNECTED)
+ { //Once we found 1, just check our whole list against devices
+ Win32JoyStick::CheckXInputDevices(unusedJoyStickList);
+ break;
+ }
+ }
+#endif
}
//--------------------------------------------------------------------------------//
@@ -133,6 +146,8 @@
GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_FLIGHT)
{
JoyStickInfo jsInfo;
+ jsInfo.isXInput = false;
+ jsInfo.productGuid = lpddi->guidProduct;
jsInfo.deviceID = lpddi->guidInstance;
jsInfo.vendor = lpddi->tszInstanceName;
jsInfo.devId = _this_->joySticks;
Modified: code/branches/kicklib/src/external/ois/win32/Win32InputManager.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32InputManager.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32InputManager.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -25,7 +25,7 @@
#include "OISInputManager.h"
#include "OISFactoryCreator.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
namespace OIS
{
Modified: code/branches/kicklib/src/external/ois/win32/Win32JoyStick.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32JoyStick.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32JoyStick.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -20,14 +20,29 @@
3. This notice may not be removed or altered from any source distribution.
*/
-#include "Win32/Win32JoyStick.h"
-#include "Win32/Win32InputManager.h"
-#include "Win32/Win32ForceFeedback.h"
+#include "win32/Win32JoyStick.h"
+#include "win32/Win32InputManager.h"
+#include "win32/Win32ForceFeedback.h"
#include "OISEvents.h"
#include "OISException.h"
#include <cassert>
+#include <wbemidl.h>
+#include <oleauto.h>
+//#include <wmsstd.h>
+#ifndef SAFE_RELEASE
+#define SAFE_RELEASE(x) \
+ if(x != NULL) \
+ { \
+ x->Release(); \
+ x = NULL; \
+ }
+#endif
+#ifdef OIS_WIN32_XINPUT_SUPPORT
+# pragma comment(lib, "xinput.lib")
+#endif
+
//DX Only defines macros for the JOYSTICK not JOYSTICK2, so fix it
#undef DIJOFS_BUTTON
#undef DIJOFS_POV
@@ -39,26 +54,26 @@
#define DIJOFS_SLIDER2(n) (FIELD_OFFSET(DIJOYSTATE2, rglASlider)+(n) * sizeof(LONG))
#define DIJOFS_SLIDER3(n) (FIELD_OFFSET(DIJOYSTATE2, rglFSlider)+(n) * sizeof(LONG))
+#define XINPUT_TRANSLATED_BUTTON_COUNT 12
+#define XINPUT_TRANSLATED_AXIS_COUNT 6
+
using namespace OIS;
//--------------------------------------------------------------------------------------------------//
-Win32JoyStick::Win32JoyStick( InputManager* creator, IDirectInput8* pDI,
- bool buffered, DWORD coopSettings, const JoyStickInfo &info )
- : JoyStick(info.vendor, buffered, info.devId, creator)
+Win32JoyStick::Win32JoyStick( InputManager* creator, IDirectInput8* pDI, bool buffered, DWORD coopSettings, const JoyStickInfo &info ) :
+ JoyStick(info.vendor, buffered, info.devId, creator),
+ mDirectInput(pDI),
+ coopSetting(coopSettings),
+ mJoyStick(0),
+ mJoyInfo(info),
+ mFfDevice(0)
{
- mDirectInput = pDI;
- coopSetting = coopSettings;
- mJoyStick = 0;
-
- deviceGuid = info.deviceID;
-
- ff_device = 0;
}
//--------------------------------------------------------------------------------------------------//
Win32JoyStick::~Win32JoyStick()
{
- delete ff_device;
+ delete mFfDevice;
if(mJoyStick)
{
@@ -68,80 +83,86 @@
}
//Return joystick to pool
- JoyStickInfo js;
- js.deviceID = deviceGuid;
- js.devId = mDevID;
- js.vendor = mVendor;
- static_cast<Win32InputManager*>(mCreator)->_returnJoyStick(js);
+ static_cast<Win32InputManager*>(mCreator)->_returnJoyStick(mJoyInfo);
}
//--------------------------------------------------------------------------------------------------//
void Win32JoyStick::_initialize()
{
- //Clear old state
- mState.mAxes.clear();
+ if (mJoyInfo.isXInput)
+ {
+ _enumerate();
+ }
+ else
+ {
+ //Clear old state
+ mState.mAxes.clear();
- if (ff_device)
- {
- delete ff_device;
- ff_device = 0;
- }
+ delete mFfDevice;
+ mFfDevice = 0;
- // Create direct input joystick device.
- if(FAILED(mDirectInput->CreateDevice(deviceGuid, &mJoyStick, NULL)))
- OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> Could not initialize joy device!");
+ DIPROPDWORD dipdw;
- // Set DIJoystick2 data format.
- if(FAILED(mJoyStick->SetDataFormat(&c_dfDIJoystick2)))
- OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> data format error!");
+ dipdw.diph.dwSize = sizeof(DIPROPDWORD);
+ dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
+ dipdw.diph.dwObj = 0;
+ dipdw.diph.dwHow = DIPH_DEVICE;
+ dipdw.dwData = JOYSTICK_DX_BUFFERSIZE;
- // Set cooperative level as specified when creating input manager.
- HWND hwin = ((Win32InputManager*)mCreator)->getWindowHandle();
- if(FAILED(mJoyStick->SetCooperativeLevel( hwin, coopSetting)))
- OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> failed to set cooperation level!");
+ if(FAILED(mDirectInput->CreateDevice(mJoyInfo.deviceID, &mJoyStick, NULL)))
+ OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> Could not initialize joy device!");
- // Set buffer size.
- DIPROPDWORD dipdw;
- dipdw.diph.dwSize = sizeof(DIPROPDWORD);
- dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
- dipdw.diph.dwObj = 0;
- dipdw.diph.dwHow = DIPH_DEVICE;
- dipdw.dwData = JOYSTICK_DX_BUFFERSIZE;
+ if(FAILED(mJoyStick->SetDataFormat(&c_dfDIJoystick2)))
+ OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> data format error!");
- if( FAILED(mJoyStick->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)) )
- OIS_EXCEPT( E_General, "Win32JoyStick::_initialize >> Failed to set buffer size property" );
+ HWND hwin = ((Win32InputManager*)mCreator)->getWindowHandle();
- // Enumerate all axes/buttons/sliders/force feedback/etc before aquiring
- _enumerate();
+ if(FAILED(mJoyStick->SetCooperativeLevel( hwin, coopSetting)))
+ OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> failed to set cooperation level!");
- mState.clear();
+ if( FAILED(mJoyStick->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)) )
+ OIS_EXCEPT( E_General, "Win32Mouse::Win32Mouse >> Failed to set buffer size property" );
- capture();
+ //Enumerate all axes/buttons/sliders/etc before aquiring
+ _enumerate();
+
+ mState.clear();
+
+ capture();
+ }
}
//--------------------------------------------------------------------------------------------------//
void Win32JoyStick::_enumerate()
{
- // Get joystick capabilities.
- mDIJoyCaps.dwSize = sizeof(DIDEVCAPS);
- if( FAILED(mJoyStick->GetCapabilities(&mDIJoyCaps)) )
- OIS_EXCEPT( E_General, "Win32JoyStick::_enumerate >> Failed to get capabilities" );
+ if (mJoyInfo.isXInput)
+ {
+ mPOVs = 1;
- // => Number of POVs
- mPOVs = (short)mDIJoyCaps.dwPOVs;
+ mState.mButtons.resize(XINPUT_TRANSLATED_BUTTON_COUNT);
+ mState.mAxes.resize(XINPUT_TRANSLATED_AXIS_COUNT);
+ }
+ else
+ {
+ // Get joystick capabilities.
+ mDIJoyCaps.dwSize = sizeof(DIDEVCAPS);
+ if( FAILED(mJoyStick->GetCapabilities(&mDIJoyCaps)) )
+ OIS_EXCEPT( E_General, "Win32JoyStick::_enumerate >> Failed to get capabilities" );
- // => Number of buttons and axes.
- mState.mButtons.resize(mDIJoyCaps.dwButtons);
- mState.mAxes.resize(mDIJoyCaps.dwAxes);
+ mPOVs = (short)mDIJoyCaps.dwPOVs;
- // Enumerate all Force Feedback effects (if any)
- mJoyStick->EnumEffects(DIEnumEffectsCallback, this, DIEFT_ALL);
+ mState.mButtons.resize(mDIJoyCaps.dwButtons);
+ mState.mAxes.resize(mDIJoyCaps.dwAxes);
- //Reset the axis mapping enumeration value
- _AxisNumber = 0;
+ //Reset the axis mapping enumeration value
+ _AxisNumber = 0;
- // Enumerate and set axis constraints (and check FF Axes)
- mJoyStick->EnumObjects(DIEnumDeviceObjectsCallback, this, DIDFT_AXIS);
+ //Enumerate Force Feedback (if any)
+ mJoyStick->EnumEffects(DIEnumEffectsCallback, this, DIEFT_ALL);
+
+ //Enumerate and set axis constraints (and check FF Axes)
+ mJoyStick->EnumObjects(DIEnumDeviceObjectsCallback, this, DIDFT_AXIS);
+ }
}
//--------------------------------------------------------------------------------------------------//
@@ -190,19 +211,19 @@
//Check if FF Axes, and if so, increment counter
if((lpddoi->dwFlags & DIDOI_FFACTUATOR) != 0 )
{
- if( _this->ff_device )
+ if( _this->mFfDevice )
{
- _this->ff_device->_addFFAxis();
+ _this->mFfDevice->_addFFAxis();
}
}
//Force the flags for gain and auto-center support to true,
//as DInput has no API to query the device for these capabilities
//(the only way to know is to try them ...)
- if( _this->ff_device )
+ if( _this->mFfDevice )
{
- _this->ff_device->_setGainSupport(true);
- _this->ff_device->_setAutoCenterSupport(true);
+ _this->mFfDevice->_setGainSupport(true);
+ _this->mFfDevice->_setAutoCenterSupport(true);
}
return DIENUM_CONTINUE;
@@ -214,10 +235,10 @@
Win32JoyStick* _this = (Win32JoyStick*)pvRef;
//Create the FF instance only after we know there is at least one effect type
- if( _this->ff_device == 0 )
- _this->ff_device = new Win32ForceFeedback(_this->mJoyStick, &_this->mDIJoyCaps);
+ if( _this->mFfDevice == 0 )
+ _this->mFfDevice = new Win32ForceFeedback(_this->mJoyStick, &_this->mDIJoyCaps);
- _this->ff_device->_addEffectSupport( pdei );
+ _this->mFfDevice->_addEffectSupport(pdei);
return DIENUM_CONTINUE;
}
@@ -225,6 +246,16 @@
//--------------------------------------------------------------------------------------------------//
void Win32JoyStick::capture()
{
+#ifdef OIS_WIN32_XINPUT_SUPPORT
+ //handle xbox controller differently
+ if (mJoyInfo.isXInput)
+ {
+ captureXInput();
+ return;
+ }
+#endif
+
+ //handle directinput based devices
DIDEVICEOBJECTDATA diBuff[JOYSTICK_DX_BUFFERSIZE];
DWORD entries = JOYSTICK_DX_BUFFERSIZE;
@@ -240,7 +271,7 @@
hr = mJoyStick->Acquire();
// Poll the device to read the current state
- mJoyStick->Poll();
+ mJoyStick->Poll();
hr = mJoyStick->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), diBuff, &entries, 0 );
//Perhaps the user just tabbed away
if( FAILED(hr) )
@@ -352,6 +383,118 @@
}
//--------------------------------------------------------------------------------------------------//
+void Win32JoyStick::captureXInput()
+{
+#ifdef OIS_WIN32_XINPUT_SUPPORT
+ XINPUT_STATE inputState;
+ if (XInputGetState((DWORD)mJoyInfo.xInputDev, &inputState) != ERROR_SUCCESS)
+ memset(&inputState, 0, sizeof(inputState));
+
+ //Sticks and triggers
+ int value;
+ bool axisMoved[XINPUT_TRANSLATED_AXIS_COUNT] = {false,false,false,false,false,false};
+
+ //LeftY
+ value = -(int)inputState.Gamepad.sThumbLY;
+ mState.mAxes[0].rel = value - mState.mAxes[0].abs;
+ mState.mAxes[0].abs = value;
+ if(mState.mAxes[0].rel != 0)
+ axisMoved[0] = true;
+
+ //LeftX
+ mState.mAxes[1].rel = inputState.Gamepad.sThumbLX - mState.mAxes[1].abs;
+ mState.mAxes[1].abs = inputState.Gamepad.sThumbLX;
+
+ if(mState.mAxes[1].rel != 0)
+ axisMoved[1] = true;
+
+ //RightY
+ value = -(int)inputState.Gamepad.sThumbRY;
+ mState.mAxes[2].rel = value - mState.mAxes[2].abs;
+ mState.mAxes[2].abs = value;
+ if(mState.mAxes[2].rel != 0)
+ axisMoved[2] = true;
+
+ //RightX
+ mState.mAxes[3].rel = inputState.Gamepad.sThumbRX - mState.mAxes[3].abs;
+ mState.mAxes[3].abs = inputState.Gamepad.sThumbRX;
+ if(mState.mAxes[3].rel != 0)
+ axisMoved[3] = true;
+
+ //Left trigger
+ value = inputState.Gamepad.bLeftTrigger * 129;
+ if(value > JoyStick::MAX_AXIS)
+ value = JoyStick::MAX_AXIS;
+
+ mState.mAxes[4].rel = value - mState.mAxes[4].abs;
+ mState.mAxes[4].abs = value;
+ if(mState.mAxes[4].rel != 0)
+ axisMoved[4] = true;
+
+ //Right trigger
+ value = (int)inputState.Gamepad.bRightTrigger * 129;
+ if(value > JoyStick::MAX_AXIS)
+ value = JoyStick::MAX_AXIS;
+
+ mState.mAxes[5].rel = value - mState.mAxes[5].abs;
+ mState.mAxes[5].abs = value;
+ if(mState.mAxes[5].rel != 0)
+ axisMoved[5] = true;
+
+ //POV
+ int previousPov = mState.mPOV[0].direction;
+ int& pov = mState.mPOV[0].direction;
+ pov = Pov::Centered;
+ if (inputState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP)
+ pov |= Pov::North;
+ else if (inputState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN)
+ pov |= Pov::South;
+ if (inputState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT)
+ pov |= Pov::West;
+ else if (inputState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT)
+ pov |= Pov::East;
+
+ //Buttons - The first 4 buttons don't need to be checked since they represent the dpad
+ bool previousButtons[XINPUT_TRANSLATED_BUTTON_COUNT];
+ std::copy(mState.mButtons.begin(), mState.mButtons.end(), previousButtons);
+ for (size_t i = 0; i < XINPUT_TRANSLATED_BUTTON_COUNT; i++)
+ mState.mButtons[i] = (inputState.Gamepad.wButtons & (1 << (i + 4))) != 0;
+
+ //Send events
+ if (mBuffered && mListener)
+ {
+ JoyStickEvent joystickEvent(this, mState);
+
+ //Axes
+ for (int i = 0; i < XINPUT_TRANSLATED_AXIS_COUNT; i++)
+ {
+ if (axisMoved[i] && !mListener->axisMoved(joystickEvent, i))
+ return;
+ }
+
+ //POV
+ if (previousPov != pov && !mListener->povMoved(joystickEvent, 0))
+ return;
+
+ //Buttons
+ for (int i = 0; i < XINPUT_TRANSLATED_BUTTON_COUNT; i++)
+ {
+ if (!previousButtons[i] && mState.mButtons[i])
+ {
+ if (!mListener->buttonPressed(joystickEvent, i))
+ return;
+ }
+ else if (previousButtons[i] && !mState.mButtons[i])
+ {
+ if (!mListener->buttonReleased(joystickEvent, i))
+ return;
+ }
+ }
+ }
+#endif
+}
+
+//--------------------------------------------------------------------------------------------------//
bool Win32JoyStick::_doButtonClick( int button, DIDEVICEOBJECTDATA& di )
{
if( di.dwData & 0x80 )
@@ -409,11 +552,132 @@
//--------------------------------------------------------------------------------------------------//
Interface* Win32JoyStick::queryInterface(Interface::IType type)
{
- //Thought about using covariant return type here.. however,
- //some devices may allow LED light changing, or other interface stuff
-
- if( ff_device && type == Interface::ForceFeedback )
- return ff_device;
+ if( mFfDevice && type == Interface::ForceFeedback )
+ return mFfDevice;
else
return 0;
}
+
+//--------------------------------------------------------------------------------------------------//
+void Win32JoyStick::CheckXInputDevices(JoyStickInfoList &joys)
+{
+ IWbemLocator* pIWbemLocator = NULL;
+ IEnumWbemClassObject* pEnumDevices = NULL;
+ IWbemClassObject* pDevices[20] = {0};
+ IWbemServices* pIWbemServices = NULL;
+ BSTR bstrNamespace = NULL;
+ BSTR bstrDeviceID = NULL;
+ BSTR bstrClassName = NULL;
+ DWORD uReturned = 0;
+ bool bIsXinputDevice= false;
+ DWORD iDevice = 0;
+ int xDevice = 0;
+ VARIANT var;
+ HRESULT hr;
+
+ if(joys.size() == 0)
+ return;
+
+ // CoInit if needed
+ hr = CoInitialize(NULL);
+ bool bCleanupCOM = SUCCEEDED(hr);
+
+ // Create WMI
+ hr = CoCreateInstance(__uuidof(WbemLocator), NULL, CLSCTX_INPROC_SERVER, __uuidof(IWbemLocator), (LPVOID*)&pIWbemLocator);
+ if( FAILED(hr) || pIWbemLocator == NULL )
+ goto LCleanup;
+
+ bstrNamespace = SysAllocString( L"\\\\.\\root\\cimv2" );
+ if( bstrNamespace == NULL )
+ goto LCleanup;
+
+ bstrClassName = SysAllocString( L"Win32_PNPEntity" );
+ if( bstrClassName == NULL )
+ goto LCleanup;
+
+ bstrDeviceID = SysAllocString( L"DeviceID" );
+ if( bstrDeviceID == NULL )
+ goto LCleanup;
+
+ // Connect to WMI
+ hr = pIWbemLocator->ConnectServer( bstrNamespace, NULL, NULL, 0L, 0L, NULL, NULL, &pIWbemServices );
+ if( FAILED(hr) || pIWbemServices == NULL )
+ goto LCleanup;
+
+ // Switch security level to IMPERSONATE.
+ CoSetProxyBlanket(pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE );
+
+ hr = pIWbemServices->CreateInstanceEnum( bstrClassName, 0, NULL, &pEnumDevices );
+ if( FAILED(hr) || pEnumDevices == NULL )
+ goto LCleanup;
+
+ // Loop over all devices
+ for( ;; )
+ {
+ // Get 20 at a time
+ hr = pEnumDevices->Next(5000, 20, pDevices, &uReturned);
+ if( FAILED(hr) )
+ goto LCleanup;
+
+ if( uReturned == 0 )
+ break;
+
+ for(iDevice = 0; iDevice < uReturned; iDevice++)
+ {
+ // For each device, get its device ID
+ hr = pDevices[iDevice]->Get(bstrDeviceID, 0L, &var, NULL, NULL);
+ if(SUCCEEDED(hr) && var.vt == VT_BSTR && var.bstrVal != NULL)
+ {
+ // Check if the device ID contains "IG_". If it does, then it's an XInput device - This information can not be found from DirectInput
+ if(wcsstr(var.bstrVal, L"IG_"))
+ {
+ // If it does, then get the VID/PID from var.bstrVal
+ DWORD dwPid = 0, dwVid = 0;
+ WCHAR* strVid = wcsstr( var.bstrVal, L"VID_" );
+ if(strVid && swscanf_s( strVid, L"VID_%4X", &dwVid ) != 1)
+ dwVid = 0;
+
+ WCHAR* strPid = wcsstr( var.bstrVal, L"PID_" );
+ if(strPid && swscanf_s( strPid, L"PID_%4X", &dwPid ) != 1)
+ dwPid = 0;
+
+ // Compare the VID/PID to the DInput device
+ DWORD dwVidPid = MAKELONG(dwVid, dwPid);
+ for(JoyStickInfoList::iterator i = joys.begin(); i != joys.end(); ++i)
+ {
+ if(dwVidPid == i->productGuid.Data1)
+ {
+ i->isXInput = true;
+ i->xInputDev = xDevice;
+ }
+ }
+
+ if(joys.size() == 0)
+ goto LCleanup;
+ }
+ }
+
+ SAFE_RELEASE(pDevices[iDevice]);
+ }
+ }
+
+LCleanup:
+ if(bstrNamespace)
+ SysFreeString(bstrNamespace);
+
+ if(bstrDeviceID)
+ SysFreeString(bstrDeviceID);
+
+ if(bstrClassName)
+ SysFreeString(bstrClassName);
+
+ for(iDevice=0; iDevice < 20; iDevice++)
+ SAFE_RELEASE(pDevices[iDevice]);
+
+ SAFE_RELEASE(pEnumDevices);
+ SAFE_RELEASE(pIWbemLocator);
+ SAFE_RELEASE(pIWbemServices);
+
+ if(bCleanupCOM)
+ CoUninitialize();
+}
Modified: code/branches/kicklib/src/external/ois/win32/Win32JoyStick.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32JoyStick.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32JoyStick.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -24,7 +24,7 @@
#define _WIN32_JOYSTICK_H_EADER_
#include "OISJoyStick.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
namespace OIS
{
@@ -40,12 +40,23 @@
/** @copydoc Object::capture */
virtual void capture();
+ //! hanlde xinput
+ void captureXInput();
+
/** @copydoc Object::queryInterface */
virtual Interface* queryInterface(Interface::IType type);
/** @copydoc Object::_initialize */
virtual void _initialize();
+ /**
+ @remarks
+ Enum each PNP device using WMI and check each device ID to see if it contains
+ "IG_" (ex. "VID_045E&PID_028E&IG_00"). If it does, then it's an XInput device
+ Unfortunately this information can not be found by just using DirectInput
+ */
+ static void CheckXInputDevices(JoyStickInfoList &joys);
+
protected:
//! Enumerates all things
void _enumerate();
@@ -60,12 +71,12 @@
IDirectInput8* mDirectInput;
IDirectInputDevice8* mJoyStick;
DIDEVCAPS mDIJoyCaps;
-
DWORD coopSetting;
- GUID deviceGuid;
+ JoyStickInfo mJoyInfo;
+
//! A force feedback device
- Win32ForceFeedback* ff_device;
+ Win32ForceFeedback* mFfDevice;
//! Mapping
int _AxisNumber;
Modified: code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -20,8 +20,8 @@
3. This notice may not be removed or altered from any source distribution.
*/
-#include "Win32/Win32InputManager.h"
-#include "Win32/Win32KeyBoard.h"
+#include "win32/Win32InputManager.h"
+#include "win32/Win32KeyBoard.h"
#include "OISException.h"
#include "OISEvents.h"
#include <sstream>
@@ -286,7 +286,7 @@
}
//--------------------------------------------------------------------------------------------------//
-const std::string& Win32Keyboard::getAsString( KeyCode kc )
+const std::string& Win32Keyboard::getAsString(KeyCode kc)
{
char temp[256];
@@ -296,16 +296,16 @@
prop.diph.dwObj = static_cast<DWORD>(kc);
prop.diph.dwHow = DIPH_BYOFFSET;
- if ( SUCCEEDED( mKeyboard->GetProperty( DIPROP_KEYNAME, &prop.diph ) ) )
+ if (SUCCEEDED(mKeyboard->GetProperty(DIPROP_KEYNAME, &prop.diph)))
{
// convert the WCHAR in "wsz" to multibyte
- if ( WideCharToMultiByte( CP_ACP, 0, prop.wsz, -1, temp, sizeof(temp), NULL, NULL) )
- return mGetString.assign( temp );
+ if (WideCharToMultiByte(CP_ACP, 0, prop.wsz, -1, temp, sizeof(temp), NULL, NULL))
+ return mGetString.assign(temp);
}
std::stringstream ss;
ss << "Key_" << (int)kc;
- return mGetString.assign( ss.str() );
+ return mGetString.assign(ss.str());
}
//--------------------------------------------------------------------------------------------------//
Modified: code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -24,7 +24,7 @@
#define _WIN32_KEYBOARD_H_EADER_
#include "OISKeyboard.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
namespace OIS
{
@@ -41,17 +41,17 @@
@param coopSettings
A combination of DI Flags (see DX Help for info on input device settings)
*/
- Win32Keyboard( InputManager* creator, IDirectInput8* pDI, bool buffered, DWORD coopSettings );
+ Win32Keyboard(InputManager* creator, IDirectInput8* pDI, bool buffered, DWORD coopSettings);
virtual ~Win32Keyboard();
/** @copydoc Keyboard::isKeyDown */
- virtual bool isKeyDown( KeyCode key ) const;
+ virtual bool isKeyDown(KeyCode key) const;
/** @copydoc Keyboard::getAsString */
- virtual const std::string& getAsString( KeyCode kc );
+ virtual const std::string& getAsString(KeyCode kc);
/** @copydoc Keyboard::copyKeyStates */
- virtual void copyKeyStates( char keys[256] ) const;
+ virtual void copyKeyStates(char keys[256]) const;
/** @copydoc Object::setBuffered */
virtual void setBuffered(bool buffered);
Modified: code/branches/kicklib/src/external/ois/win32/Win32Mouse.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32Mouse.cpp 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32Mouse.cpp 2011-03-14 02:53:38 UTC (rev 8071)
@@ -20,8 +20,8 @@
3. This notice may not be removed or altered from any source distribution.
*/
-#include "Win32/Win32Mouse.h"
-#include "Win32/Win32InputManager.h"
+#include "win32/Win32Mouse.h"
+#include "win32/Win32InputManager.h"
#include "OISException.h"
#include "OISEvents.h"
Modified: code/branches/kicklib/src/external/ois/win32/Win32Mouse.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32Mouse.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32Mouse.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -24,7 +24,7 @@
#define _WIN32_MOUSE_H_EADER_
#include "OISMouse.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
namespace OIS
{
Modified: code/branches/kicklib/src/external/ois/win32/Win32Prereqs.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32Prereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/external/ois/win32/Win32Prereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -28,10 +28,14 @@
#include <windows.h>
#include <dinput.h>
+#ifdef OIS_WIN32_XINPUT_SUPPORT
+# include <XInput.h>
+#endif
+
//Max number of elements to collect from buffered DirectInput
#define KEYBOARD_DX_BUFFERSIZE 17
-#define MOUSE_DX_BUFFERSIZE 64
-#define JOYSTICK_DX_BUFFERSIZE 124
+#define MOUSE_DX_BUFFERSIZE 128
+#define JOYSTICK_DX_BUFFERSIZE 129
//MinGW defines
#if defined(OIS_MINGW_COMPILER)
@@ -54,10 +58,13 @@
public:
int devId;
GUID deviceID;
+ GUID productGuid;
std::string vendor;
+ bool isXInput;
+ int xInputDev;
};
- typedef std::vector< JoyStickInfo > JoyStickInfoList;
+ typedef std::vector<JoyStickInfo> JoyStickInfoList;
}
#endif //_WIN32_INPUTSYSTEM_PREREQS_H
Deleted: code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h
===================================================================
--- code/branches/ois_update/src/external/openal/MacOSX_OALExtensions.h 2010-12-21 17:09:09 UTC (rev 7788)
+++ code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -1,197 +0,0 @@
-/**********************************************************************************************************************************
-*
-* OpenAL cross platform audio library
-* Copyright (c) 2006, Apple Computer, Inc., Copyright (c) 2009, Apple Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without modification, are permitted provided
-* that the following conditions are met:
-*
-* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the distribution.
-* 3. Neither the name of Apple Inc. ("Apple") nor the names of its contributors may be used to endorse or promote
-* products derived from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS
-* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*
-**********************************************************************************************************************************/
-
-#ifndef __MAC_OSX_OAL_EXTENSIONS_H__
-#define __MAC_OSX_OAL_EXTENSIONS_H__
-
-#include <OpenAL/al.h>
-#include <OpenAL/alc.h>
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-/*
- Convert Data When Loading.
- Default false, currently applies only to monophonic sounds. Use with alEnable()/alDisable()
-*/
- #define ALC_MAC_OSX_CONVERT_DATA_UPON_LOADING 0xF001
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ALC_EXT_MAC_OSX
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-typedef ALvoid (*alcMacOSXRenderingQualityProcPtr) (const ALint value);
-typedef ALvoid (*alMacOSXRenderChannelCountProcPtr) (const ALint value);
-typedef ALvoid (*alcMacOSXMixerMaxiumumBussesProcPtr) (const ALint value);
-typedef ALvoid (*alcMacOSXMixerOutputRateProcPtr) (const ALdouble value);
-
-typedef ALint (*alcMacOSXGetRenderingQualityProcPtr) ();
-typedef ALint (*alMacOSXGetRenderChannelCountProcPtr) ();
-typedef ALint (*alcMacOSXGetMixerMaxiumumBussesProcPtr) ();
-typedef ALdouble (*alcMacOSXGetMixerOutputRateProcPtr) ();
-
-/* Render Quality. Used with alcMacOSXRenderingQuality() */
-
- #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_HIGH 'rqhi'
- #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_LOW 'rdlo'
-
-/*
- Render Channels. Used with alMacOSXRenderChannelCount()
- Allows a user to force OpenAL to render to stereo, regardless of the audio hardware being used
-*/
- #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_STEREO 'rcst'
- #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_MULTICHANNEL 'rcmc'
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- AL_EXT_STATIC_BUFFER
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ALC_EXT_ASA : Apple Spatial Audio Extension
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-/*
- Used with the ASA API calls: alcASAGetSource(), alcASASetSource(), alcASAGetListener(), alcASASetListener()
-*/
-
-typedef ALenum (*alcASAGetSourceProcPtr) (const ALuint property, ALuint source, ALvoid *data, ALuint* dataSize);
-typedef ALenum (*alcASASetSourceProcPtr) (const ALuint property, ALuint source, ALvoid *data, ALuint dataSize);
-typedef ALenum (*alcASAGetListenerProcPtr) (const ALuint property, ALvoid *data, ALuint* dataSize);
-typedef ALenum (*alcASASetListenerProcPtr) (const ALuint property, ALvoid *data, ALuint dataSize);
-
- /* listener properties */
- #define ALC_ASA_REVERB_ON 'rvon' // type ALboolean
- #define ALC_ASA_REVERB_GLOBAL_LEVEL 'rvgl' // type ALfloat -40.0 db - 40.0 db
-
- #define ALC_ASA_REVERB_ROOM_TYPE 'rvrt' // type ALint
-
- /* reverb room type presets for the ALC_ASA_REVERB_ROOM_TYPE property */
- #define ALC_ASA_REVERB_ROOM_TYPE_SmallRoom 0
- #define ALC_ASA_REVERB_ROOM_TYPE_MediumRoom 1
- #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom 2
- #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall 3
- #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall 4
- #define ALC_ASA_REVERB_ROOM_TYPE_Plate 5
- #define ALC_ASA_REVERB_ROOM_TYPE_MediumChamber 6
- #define ALC_ASA_REVERB_ROOM_TYPE_LargeChamber 7
- #define ALC_ASA_REVERB_ROOM_TYPE_Cathedral 8
- #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom2 9
- #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall2 10
- #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall3 11
- #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall2 12
-
- #define ALC_ASA_REVERB_PRESET 'rvps' // type ALchar* - (set only) path to an au preset file
-
- #define ALC_ASA_REVERB_EQ_GAIN 'rveg' // type ALfloat
- #define ALC_ASA_REVERB_EQ_BANDWITH 'rveb' // type ALfloat
- #define ALC_ASA_REVERB_EQ_FREQ 'rvef' // type ALfloat
-
- #define ALC_ASA_REVERB_QUALITY 'rvqt' // type ALint
-
- /* reverb quality settings for the ALC_ASA_REVERB_QUALITY property */
- #define ALC_ASA_REVERB_QUALITY_Max 0x7F
- #define ALC_ASA_REVERB_QUALITY_High 0x60
- #define ALC_ASA_REVERB_QUALITY_Medium 0x40
- #define ALC_ASA_REVERB_QUALITY_Low 0x20
- #define ALC_ASA_REVERB_QUALITY_Min 0
-
- /* source properties */
- #define ALC_ASA_REVERB_SEND_LEVEL 'rvsl' // type ALfloat 0.0 (dry) - 1.0 (wet) (0-100% dry/wet mix, 0.0 default)
- #define ALC_ASA_OCCLUSION 'occl' // type ALfloat -100.0 db (most occlusion) - 0.0 db (no occlusion, 0.0 default)
- #define ALC_ASA_OBSTRUCTION 'obst' // type ALfloat -100.0 db (most obstruction) - 0.0 db (no obstruction, 0.0 default)
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ALC_EXT_ASA_ROGER_BEEP : Apple Spatial Audio Extension for Roger Beep Effect
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-/*
- Roger Beep : an effect to simulate effects such as Walkie Talkie noise. It is designed to replace the
- source audio data with a specific 'tone' when falling below a specified db threshold for a specified time.
- This Extension will be present when the Roger Beep Audio Unit is present on the system (10.5 or greater)
- Use the alcASAGetSource() and alcASASetSource() APIs in the ALC_EXT_ASA extension.
-*/
-
- /* source properties */
- #define ALC_ASA_ROGER_BEEP_ENABLE 'rben' // type ALboolean - initializes Roger Beep for use - returns error if source is not in a Stopped or Initial state
- #define ALC_ASA_ROGER_BEEP_ON 'rbon' // type ALboolean - set effect on/off (bypass) - default setting is true (on)
- #define ALC_ASA_ROGER_BEEP_GAIN 'rbgn' // type ALfloat - 20.0 (db) apply maximum effect : -80.0(db) apply minimum effect amount
- #define ALC_ASA_ROGER_BEEP_SENSITIVITY 'rbsn' // type ALint - specifiy a predefined sensitivity setting
- #define ALC_ASA_ROGER_BEEP_TYPE 'rbtp' // type ALint - choose predefined specific Roger Beep tone
- #define ALC_ASA_ROGER_BEEP_PRESET 'rbps' // type ALchar* - path to an au preset file (set only)
-
- /* settings for the ALC_ASA_ROGER_BEEP_TYPE property */
- #define ALC_ASA_ROGER_BEEP_TYPE_quindartone 0
- #define ALC_ASA_ROGER_BEEP_TYPE_whitenoise 1
- #define ALC_ASA_ROGER_BEEP_TYPE_walkietalkie 2
-
- /* settings for the ALC_ASA_ROGER_BEEP_SENSITIVITY property */
-
- #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Light 0
- #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Medium 1
- #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Heavy 2
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ALC_EXT_ASA_DISTORTION : Apple Spatial Audio Extension for Distortion Effect
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-/*
- Distortion Effect
- This Extension will be present when the Distortion Audio Unit is present on the system (10.5 or greater)
- Use the alcASAGetSource() and alcASASetSource() APIs in the ALC_EXT_ASA extension.
-*/
-
- /* source properties */
- #define ALC_ASA_DISTORTION_ENABLE 'dsen' // type ALboolean - initializes Distortion for use - returns error if source is not in a Stopped or Initial state
- #define ALC_ASA_DISTORTION_ON 'dson' // type ALboolean - set effect on/off (bypass) - default setting is true (on)
- #define ALC_ASA_DISTORTION_MIX 'dsmx' // type ALfloat - mix balance between dry signal and distortion effect - 0.0 (no effect) - 100.0 (all effect)
- #define ALC_ASA_DISTORTION_TYPE 'dstp' // type ALint - choose predefined distortion settings
- #define ALC_ASA_DISTORTION_PRESET 'dsps' // type ALchar* - path to an au preset file (set only)
-
- /* settings for the ALC_ASA_DISTORTION_TYPE property */
- #define ALC_ASA_DISTORTION_TYPE_BitBrush 0
- #define ALC_ASA_DISTORTION_TYPE_BufferBeats 1
- #define ALC_ASA_DISTORTION_TYPE_LoFi 2
- #define ALC_ASA_DISTORTION_TYPE_BrokenSpeaker 3
- #define ALC_ASA_DISTORTION_TYPE_Cellphone 4
- #define ALC_ASA_DISTORTION_TYPE_Decimated1 5
- #define ALC_ASA_DISTORTION_TYPE_Decimated2 6
- #define ALC_ASA_DISTORTION_TYPE_Decimated3 7
- #define ALC_ASA_DISTORTION_TYPE_Decimated4 8
- #define ALC_ASA_DISTORTION_TYPE_DistortedFunk 9
- #define ALC_ASA_DISTORTION_TYPE_DistortionCubed 10
- #define ALC_ASA_DISTORTION_TYPE_DistortionSquared 11
- #define ALC_ASA_DISTORTION_TYPE_Echo1 12
- #define ALC_ASA_DISTORTION_TYPE_Echo2 13
- #define ALC_ASA_DISTORTION_TYPE_EchoTight1 14
- #define ALC_ASA_DISTORTION_TYPE_EchoTight2 15
- #define ALC_ASA_DISTORTION_TYPE_EverythingBroken 16
- #define ALC_ASA_DISTORTION_TYPE_AlienChatter 17
- #define ALC_ASA_DISTORTION_TYPE_CosmicInteference 18
- #define ALC_ASA_DISTORTION_TYPE_GoldenPi 19
- #define ALC_ASA_DISTORTION_TYPE_RadioTower 20
- #define ALC_ASA_DISTORTION_TYPE_Waves 21
-
-
-
-#endif // __MAC_OSX_OAL_EXTENSIONS_H__
\ No newline at end of file
Copied: code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h (from rev 7788, code/branches/ois_update/src/external/openal/MacOSX_OALExtensions.h)
===================================================================
--- code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h (rev 0)
+++ code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,197 @@
+/**********************************************************************************************************************************
+*
+* OpenAL cross platform audio library
+* Copyright (c) 2006, Apple Computer, Inc., Copyright (c) 2009, Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification, are permitted provided
+* that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the distribution.
+* 3. Neither the name of Apple Inc. ("Apple") nor the names of its contributors may be used to endorse or promote
+* products derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+**********************************************************************************************************************************/
+
+#ifndef __MAC_OSX_OAL_EXTENSIONS_H__
+#define __MAC_OSX_OAL_EXTENSIONS_H__
+
+#include <OpenAL/al.h>
+#include <OpenAL/alc.h>
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+/*
+ Convert Data When Loading.
+ Default false, currently applies only to monophonic sounds. Use with alEnable()/alDisable()
+*/
+ #define ALC_MAC_OSX_CONVERT_DATA_UPON_LOADING 0xF001
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ALC_EXT_MAC_OSX
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+typedef ALvoid (*alcMacOSXRenderingQualityProcPtr) (const ALint value);
+typedef ALvoid (*alMacOSXRenderChannelCountProcPtr) (const ALint value);
+typedef ALvoid (*alcMacOSXMixerMaxiumumBussesProcPtr) (const ALint value);
+typedef ALvoid (*alcMacOSXMixerOutputRateProcPtr) (const ALdouble value);
+
+typedef ALint (*alcMacOSXGetRenderingQualityProcPtr) ();
+typedef ALint (*alMacOSXGetRenderChannelCountProcPtr) ();
+typedef ALint (*alcMacOSXGetMixerMaxiumumBussesProcPtr) ();
+typedef ALdouble (*alcMacOSXGetMixerOutputRateProcPtr) ();
+
+/* Render Quality. Used with alcMacOSXRenderingQuality() */
+
+ #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_HIGH 'rqhi'
+ #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_LOW 'rdlo'
+
+/*
+ Render Channels. Used with alMacOSXRenderChannelCount()
+ Allows a user to force OpenAL to render to stereo, regardless of the audio hardware being used
+*/
+ #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_STEREO 'rcst'
+ #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_MULTICHANNEL 'rcmc'
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ AL_EXT_STATIC_BUFFER
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ALC_EXT_ASA : Apple Spatial Audio Extension
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/*
+ Used with the ASA API calls: alcASAGetSource(), alcASASetSource(), alcASAGetListener(), alcASASetListener()
+*/
+
+typedef ALenum (*alcASAGetSourceProcPtr) (const ALuint property, ALuint source, ALvoid *data, ALuint* dataSize);
+typedef ALenum (*alcASASetSourceProcPtr) (const ALuint property, ALuint source, ALvoid *data, ALuint dataSize);
+typedef ALenum (*alcASAGetListenerProcPtr) (const ALuint property, ALvoid *data, ALuint* dataSize);
+typedef ALenum (*alcASASetListenerProcPtr) (const ALuint property, ALvoid *data, ALuint dataSize);
+
+ /* listener properties */
+ #define ALC_ASA_REVERB_ON 'rvon' // type ALboolean
+ #define ALC_ASA_REVERB_GLOBAL_LEVEL 'rvgl' // type ALfloat -40.0 db - 40.0 db
+
+ #define ALC_ASA_REVERB_ROOM_TYPE 'rvrt' // type ALint
+
+ /* reverb room type presets for the ALC_ASA_REVERB_ROOM_TYPE property */
+ #define ALC_ASA_REVERB_ROOM_TYPE_SmallRoom 0
+ #define ALC_ASA_REVERB_ROOM_TYPE_MediumRoom 1
+ #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom 2
+ #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall 3
+ #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall 4
+ #define ALC_ASA_REVERB_ROOM_TYPE_Plate 5
+ #define ALC_ASA_REVERB_ROOM_TYPE_MediumChamber 6
+ #define ALC_ASA_REVERB_ROOM_TYPE_LargeChamber 7
+ #define ALC_ASA_REVERB_ROOM_TYPE_Cathedral 8
+ #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom2 9
+ #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall2 10
+ #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall3 11
+ #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall2 12
+
+ #define ALC_ASA_REVERB_PRESET 'rvps' // type ALchar* - (set only) path to an au preset file
+
+ #define ALC_ASA_REVERB_EQ_GAIN 'rveg' // type ALfloat
+ #define ALC_ASA_REVERB_EQ_BANDWITH 'rveb' // type ALfloat
+ #define ALC_ASA_REVERB_EQ_FREQ 'rvef' // type ALfloat
+
+ #define ALC_ASA_REVERB_QUALITY 'rvqt' // type ALint
+
+ /* reverb quality settings for the ALC_ASA_REVERB_QUALITY property */
+ #define ALC_ASA_REVERB_QUALITY_Max 0x7F
+ #define ALC_ASA_REVERB_QUALITY_High 0x60
+ #define ALC_ASA_REVERB_QUALITY_Medium 0x40
+ #define ALC_ASA_REVERB_QUALITY_Low 0x20
+ #define ALC_ASA_REVERB_QUALITY_Min 0
+
+ /* source properties */
+ #define ALC_ASA_REVERB_SEND_LEVEL 'rvsl' // type ALfloat 0.0 (dry) - 1.0 (wet) (0-100% dry/wet mix, 0.0 default)
+ #define ALC_ASA_OCCLUSION 'occl' // type ALfloat -100.0 db (most occlusion) - 0.0 db (no occlusion, 0.0 default)
+ #define ALC_ASA_OBSTRUCTION 'obst' // type ALfloat -100.0 db (most obstruction) - 0.0 db (no obstruction, 0.0 default)
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ALC_EXT_ASA_ROGER_BEEP : Apple Spatial Audio Extension for Roger Beep Effect
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+/*
+ Roger Beep : an effect to simulate effects such as Walkie Talkie noise. It is designed to replace the
+ source audio data with a specific 'tone' when falling below a specified db threshold for a specified time.
+ This Extension will be present when the Roger Beep Audio Unit is present on the system (10.5 or greater)
+ Use the alcASAGetSource() and alcASASetSource() APIs in the ALC_EXT_ASA extension.
+*/
+
+ /* source properties */
+ #define ALC_ASA_ROGER_BEEP_ENABLE 'rben' // type ALboolean - initializes Roger Beep for use - returns error if source is not in a Stopped or Initial state
+ #define ALC_ASA_ROGER_BEEP_ON 'rbon' // type ALboolean - set effect on/off (bypass) - default setting is true (on)
+ #define ALC_ASA_ROGER_BEEP_GAIN 'rbgn' // type ALfloat - 20.0 (db) apply maximum effect : -80.0(db) apply minimum effect amount
+ #define ALC_ASA_ROGER_BEEP_SENSITIVITY 'rbsn' // type ALint - specifiy a predefined sensitivity setting
+ #define ALC_ASA_ROGER_BEEP_TYPE 'rbtp' // type ALint - choose predefined specific Roger Beep tone
+ #define ALC_ASA_ROGER_BEEP_PRESET 'rbps' // type ALchar* - path to an au preset file (set only)
+
+ /* settings for the ALC_ASA_ROGER_BEEP_TYPE property */
+ #define ALC_ASA_ROGER_BEEP_TYPE_quindartone 0
+ #define ALC_ASA_ROGER_BEEP_TYPE_whitenoise 1
+ #define ALC_ASA_ROGER_BEEP_TYPE_walkietalkie 2
+
+ /* settings for the ALC_ASA_ROGER_BEEP_SENSITIVITY property */
+
+ #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Light 0
+ #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Medium 1
+ #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Heavy 2
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ALC_EXT_ASA_DISTORTION : Apple Spatial Audio Extension for Distortion Effect
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+/*
+ Distortion Effect
+ This Extension will be present when the Distortion Audio Unit is present on the system (10.5 or greater)
+ Use the alcASAGetSource() and alcASASetSource() APIs in the ALC_EXT_ASA extension.
+*/
+
+ /* source properties */
+ #define ALC_ASA_DISTORTION_ENABLE 'dsen' // type ALboolean - initializes Distortion for use - returns error if source is not in a Stopped or Initial state
+ #define ALC_ASA_DISTORTION_ON 'dson' // type ALboolean - set effect on/off (bypass) - default setting is true (on)
+ #define ALC_ASA_DISTORTION_MIX 'dsmx' // type ALfloat - mix balance between dry signal and distortion effect - 0.0 (no effect) - 100.0 (all effect)
+ #define ALC_ASA_DISTORTION_TYPE 'dstp' // type ALint - choose predefined distortion settings
+ #define ALC_ASA_DISTORTION_PRESET 'dsps' // type ALchar* - path to an au preset file (set only)
+
+ /* settings for the ALC_ASA_DISTORTION_TYPE property */
+ #define ALC_ASA_DISTORTION_TYPE_BitBrush 0
+ #define ALC_ASA_DISTORTION_TYPE_BufferBeats 1
+ #define ALC_ASA_DISTORTION_TYPE_LoFi 2
+ #define ALC_ASA_DISTORTION_TYPE_BrokenSpeaker 3
+ #define ALC_ASA_DISTORTION_TYPE_Cellphone 4
+ #define ALC_ASA_DISTORTION_TYPE_Decimated1 5
+ #define ALC_ASA_DISTORTION_TYPE_Decimated2 6
+ #define ALC_ASA_DISTORTION_TYPE_Decimated3 7
+ #define ALC_ASA_DISTORTION_TYPE_Decimated4 8
+ #define ALC_ASA_DISTORTION_TYPE_DistortedFunk 9
+ #define ALC_ASA_DISTORTION_TYPE_DistortionCubed 10
+ #define ALC_ASA_DISTORTION_TYPE_DistortionSquared 11
+ #define ALC_ASA_DISTORTION_TYPE_Echo1 12
+ #define ALC_ASA_DISTORTION_TYPE_Echo2 13
+ #define ALC_ASA_DISTORTION_TYPE_EchoTight1 14
+ #define ALC_ASA_DISTORTION_TYPE_EchoTight2 15
+ #define ALC_ASA_DISTORTION_TYPE_EverythingBroken 16
+ #define ALC_ASA_DISTORTION_TYPE_AlienChatter 17
+ #define ALC_ASA_DISTORTION_TYPE_CosmicInteference 18
+ #define ALC_ASA_DISTORTION_TYPE_GoldenPi 19
+ #define ALC_ASA_DISTORTION_TYPE_RadioTower 20
+ #define ALC_ASA_DISTORTION_TYPE_Waves 21
+
+
+
+#endif // __MAC_OSX_OAL_EXTENSIONS_H__
\ No newline at end of file
Deleted: code/branches/kicklib/src/external/openal/README
===================================================================
--- code/branches/ois_update/src/external/openal/README 2010-12-21 17:09:09 UTC (rev 7788)
+++ code/branches/kicklib/src/external/openal/README 2011-03-14 02:53:38 UTC (rev 8071)
@@ -1,8 +0,0 @@
-These OpenAL headers are for Mac OS X only!
-Due to a bug in the Mac OS X distribution of
-OpenAL, compilation fails for gcc versions >=4.2.
-Corrections have been applied to these header
-files here.
-
-Kevin Young
-2010.11.24
Copied: code/branches/kicklib/src/external/openal/README (from rev 7788, code/branches/ois_update/src/external/openal/README)
===================================================================
--- code/branches/kicklib/src/external/openal/README (rev 0)
+++ code/branches/kicklib/src/external/openal/README 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,8 @@
+These OpenAL headers are for Mac OS X only!
+Due to a bug in the Mac OS X distribution of
+OpenAL, compilation fails for gcc versions >=4.2.
+Corrections have been applied to these header
+files here.
+
+Kevin Young
+2010.11.24
Deleted: code/branches/kicklib/src/external/openal/al.h
===================================================================
--- code/branches/ois_update/src/external/openal/al.h 2010-12-21 17:09:09 UTC (rev 7788)
+++ code/branches/kicklib/src/external/openal/al.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -1,736 +0,0 @@
-#ifndef AL_AL_H
-#define AL_AL_H
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#if defined(_WIN32) && !defined(_XBOX)
- /* _OPENAL32LIB is deprecated */
- #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB)
- #define AL_API __declspec(dllexport)
- #else
- #define AL_API __declspec(dllimport)
- #endif
-#else
- #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
- #define AL_API __attribute__((visibility("default")))
- #else
- #define AL_API extern
- #endif
-#endif
-
-#if defined(_WIN32)
- #define AL_APIENTRY __cdecl
-#else
- #define AL_APIENTRY
-#endif
-
-/**
- * Commented out in order to surpress warning: "ignoring #pragma export on"
- * This warning is inevitable and does not cause any problems otherwise.
-
-#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
- #pragma export on
-#endif
-
- */
-
-/*
- * The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and
- * AL_ILLEGAL_COMMAND macros are deprecated, but are included for
- * applications porting code from AL 1.0
- */
-#define OPENAL
-#define ALAPI AL_API
-#define ALAPIENTRY AL_APIENTRY
-#define AL_INVALID (-1)
-#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
-#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
-
-#define AL_VERSION_1_0
-#define AL_VERSION_1_1
-
-
-/** 8-bit boolean */
-typedef char ALboolean;
-
-/** character */
-typedef char ALchar;
-
-/** signed 8-bit 2's complement integer */
-typedef char ALbyte;
-
-/** unsigned 8-bit integer */
-typedef unsigned char ALubyte;
-
-/** signed 16-bit 2's complement integer */
-typedef short ALshort;
-
-/** unsigned 16-bit integer */
-typedef unsigned short ALushort;
-
-/** signed 32-bit 2's complement integer */
-typedef int ALint;
-
-/** unsigned 32-bit integer */
-typedef unsigned int ALuint;
-
-/** non-negative 32-bit binary integer size */
-typedef int ALsizei;
-
-/** enumerated 32-bit value */
-typedef int ALenum;
-
-/** 32-bit IEEE754 floating-point */
-typedef float ALfloat;
-
-/** 64-bit IEEE754 floating-point */
-typedef double ALdouble;
-
-/** void type (for opaque pointers only) */
-typedef void ALvoid;
-
-
-/* Enumerant values begin at column 50. No tabs. */
-
-/* "no distance model" or "no buffer" */
-#define AL_NONE 0
-
-/* Boolean False. */
-#define AL_FALSE 0
-
-/** Boolean True. */
-#define AL_TRUE 1
-
-/** Indicate Source has relative coordinates. */
-#define AL_SOURCE_RELATIVE 0x202
-
-
-
-/**
- * Directional source, inner cone angle, in degrees.
- * Range: [0-360]
- * Default: 360
- */
-#define AL_CONE_INNER_ANGLE 0x1001
-
-/**
- * Directional source, outer cone angle, in degrees.
- * Range: [0-360]
- * Default: 360
- */
-#define AL_CONE_OUTER_ANGLE 0x1002
-
-/**
- * Specify the pitch to be applied, either at source,
- * or on mixer results, at listener.
- * Range: [0.5-2.0]
- * Default: 1.0
- */
-#define AL_PITCH 0x1003
-
-/**
- * Specify the current location in three dimensional space.
- * OpenAL, like OpenGL, uses a right handed coordinate system,
- * where in a frontal default view X (thumb) points right,
- * Y points up (index finger), and Z points towards the
- * viewer/camera (middle finger).
- * To switch from a left handed coordinate system, flip the
- * sign on the Z coordinate.
- * Listener position is always in the world coordinate system.
- */
-#define AL_POSITION 0x1004
-
-/** Specify the current direction. */
-#define AL_DIRECTION 0x1005
-
-/** Specify the current velocity in three dimensional space. */
-#define AL_VELOCITY 0x1006
-
-/**
- * Indicate whether source is looping.
- * Type: ALboolean?
- * Range: [AL_TRUE, AL_FALSE]
- * Default: FALSE.
- */
-#define AL_LOOPING 0x1007
-
-/**
- * Indicate the buffer to provide sound samples.
- * Type: ALuint.
- * Range: any valid Buffer id.
- */
-#define AL_BUFFER 0x1009
-
-/**
- * Indicate the gain (volume amplification) applied.
- * Type: ALfloat.
- * Range: ]0.0- ]
- * A value of 1.0 means un-attenuated/unchanged.
- * Each division by 2 equals an attenuation of -6dB.
- * Each multiplicaton with 2 equals an amplification of +6dB.
- * A value of 0.0 is meaningless with respect to a logarithmic
- * scale; it is interpreted as zero volume - the channel
- * is effectively disabled.
- */
-#define AL_GAIN 0x100A
-
-/*
- * Indicate minimum source attenuation
- * Type: ALfloat
- * Range: [0.0 - 1.0]
- *
- * Logarthmic
- */
-#define AL_MIN_GAIN 0x100D
-
-/**
- * Indicate maximum source attenuation
- * Type: ALfloat
- * Range: [0.0 - 1.0]
- *
- * Logarthmic
- */
-#define AL_MAX_GAIN 0x100E
-
-/**
- * Indicate listener orientation.
- *
- * at/up
- */
-#define AL_ORIENTATION 0x100F
-
-/**
- * Source state information.
- */
-#define AL_SOURCE_STATE 0x1010
-#define AL_INITIAL 0x1011
-#define AL_PLAYING 0x1012
-#define AL_PAUSED 0x1013
-#define AL_STOPPED 0x1014
-
-/**
- * Buffer Queue params
- */
-#define AL_BUFFERS_QUEUED 0x1015
-#define AL_BUFFERS_PROCESSED 0x1016
-
-/**
- * Source buffer position information
- */
-#define AL_SEC_OFFSET 0x1024
-#define AL_SAMPLE_OFFSET 0x1025
-#define AL_BYTE_OFFSET 0x1026
-
-/*
- * Source type (Static, Streaming or undetermined)
- * Source is Static if a Buffer has been attached using AL_BUFFER
- * Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
- * Source is undetermined when it has the NULL buffer attached
- */
-#define AL_SOURCE_TYPE 0x1027
-#define AL_STATIC 0x1028
-#define AL_STREAMING 0x1029
-#define AL_UNDETERMINED 0x1030
-
-/** Sound samples: format specifier. */
-#define AL_FORMAT_MONO8 0x1100
-#define AL_FORMAT_MONO16 0x1101
-#define AL_FORMAT_STEREO8 0x1102
-#define AL_FORMAT_STEREO16 0x1103
-
-/**
- * source specific reference distance
- * Type: ALfloat
- * Range: 0.0 - +inf
- *
- * At 0.0, no distance attenuation occurs. Default is
- * 1.0.
- */
-#define AL_REFERENCE_DISTANCE 0x1020
-
-/**
- * source specific rolloff factor
- * Type: ALfloat
- * Range: 0.0 - +inf
- *
- */
-#define AL_ROLLOFF_FACTOR 0x1021
-
-/**
- * Directional source, outer cone gain.
- *
- * Default: 0.0
- * Range: [0.0 - 1.0]
- * Logarithmic
- */
-#define AL_CONE_OUTER_GAIN 0x1022
-
-/**
- * Indicate distance above which sources are not
- * attenuated using the inverse clamped distance model.
- *
- * Default: +inf
- * Type: ALfloat
- * Range: 0.0 - +inf
- */
-#define AL_MAX_DISTANCE 0x1023
-
-/**
- * Sound samples: frequency, in units of Hertz [Hz].
- * This is the number of samples per second. Half of the
- * sample frequency marks the maximum significant
- * frequency component.
- */
-#define AL_FREQUENCY 0x2001
-#define AL_BITS 0x2002
-#define AL_CHANNELS 0x2003
-#define AL_SIZE 0x2004
-
-/**
- * Buffer state.
- *
- * Not supported for public use (yet).
- */
-#define AL_UNUSED 0x2010
-#define AL_PENDING 0x2011
-#define AL_PROCESSED 0x2012
-
-
-/** Errors: No Error. */
-#define AL_NO_ERROR AL_FALSE
-
-/**
- * Invalid Name paramater passed to AL call.
- */
-#define AL_INVALID_NAME 0xA001
-
-/**
- * Invalid parameter passed to AL call.
- */
-#define AL_INVALID_ENUM 0xA002
-
-/**
- * Invalid enum parameter value.
- */
-#define AL_INVALID_VALUE 0xA003
-
-/**
- * Illegal call.
- */
-#define AL_INVALID_OPERATION 0xA004
-
-
-/**
- * No mojo.
- */
-#define AL_OUT_OF_MEMORY 0xA005
-
-
-/** Context strings: Vendor Name. */
-#define AL_VENDOR 0xB001
-#define AL_VERSION 0xB002
-#define AL_RENDERER 0xB003
-#define AL_EXTENSIONS 0xB004
-
-/** Global tweakage. */
-
-/**
- * Doppler scale. Default 1.0
- */
-#define AL_DOPPLER_FACTOR 0xC000
-
-/**
- * Tweaks speed of propagation.
- */
-#define AL_DOPPLER_VELOCITY 0xC001
-
-/**
- * Speed of Sound in units per second
- */
-#define AL_SPEED_OF_SOUND 0xC003
-
-/**
- * Distance models
- *
- * used in conjunction with DistanceModel
- *
- * implicit: NONE, which disances distance attenuation.
- */
-#define AL_DISTANCE_MODEL 0xD000
-#define AL_INVERSE_DISTANCE 0xD001
-#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
-#define AL_LINEAR_DISTANCE 0xD003
-#define AL_LINEAR_DISTANCE_CLAMPED 0xD004
-#define AL_EXPONENT_DISTANCE 0xD005
-#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
-
-/*
- * Renderer State management
- */
-AL_API void AL_APIENTRY alEnable( ALenum capability );
-
-AL_API void AL_APIENTRY alDisable( ALenum capability );
-
-AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
-
-
-/*
- * State retrieval
- */
-AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
-
-AL_API void AL_APIENTRY alGetBooleanv( ALenum param, ALboolean* data );
-
-AL_API void AL_APIENTRY alGetIntegerv( ALenum param, ALint* data );
-
-AL_API void AL_APIENTRY alGetFloatv( ALenum param, ALfloat* data );
-
-AL_API void AL_APIENTRY alGetDoublev( ALenum param, ALdouble* data );
-
-AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param );
-
-AL_API ALint AL_APIENTRY alGetInteger( ALenum param );
-
-AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param );
-
-AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param );
-
-
-/*
- * Error support.
- * Obtain the most recent error generated in the AL state machine.
- */
-AL_API ALenum AL_APIENTRY alGetError( void );
-
-
-/*
- * Extension support.
- * Query for the presence of an extension, and obtain any appropriate
- * function pointers and enum values.
- */
-AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
-
-AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname );
-
-AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
-
-
-/*
- * LISTENER
- * Listener represents the location and orientation of the
- * 'user' in 3D-space.
- *
- * Properties include: -
- *
- * Gain AL_GAIN ALfloat
- * Position AL_POSITION ALfloat[3]
- * Velocity AL_VELOCITY ALfloat[3]
- * Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors)
-*/
-
-/*
- * Set Listener parameters
- */
-AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value );
-
-AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
-
-AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values );
-
-AL_API void AL_APIENTRY alListeneri( ALenum param, ALint value );
-
-AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
-
-AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values );
-
-/*
- * Get Listener parameters
- */
-AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value );
-
-AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
-
-AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values );
-
-AL_API void AL_APIENTRY alGetListeneri( ALenum param, ALint* value );
-
-AL_API void AL_APIENTRY alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
-
-AL_API void AL_APIENTRY alGetListeneriv( ALenum param, ALint* values );
-
-
-/**
- * SOURCE
- * Sources represent individual sound objects in 3D-space.
- * Sources take the PCM data provided in the specified Buffer,
- * apply Source-specific modifications, and then
- * submit them to be mixed according to spatial arrangement etc.
- *
- * Properties include: -
- *
- * Gain AL_GAIN ALfloat
- * Min Gain AL_MIN_GAIN ALfloat
- * Max Gain AL_MAX_GAIN ALfloat
- * Position AL_POSITION ALfloat[3]
- * Velocity AL_VELOCITY ALfloat[3]
- * Direction AL_DIRECTION ALfloat[3]
- * Head Relative Mode AL_SOURCE_RELATIVE ALint (AL_TRUE or AL_FALSE)
- * Reference Distance AL_REFERENCE_DISTANCE ALfloat
- * Max Distance AL_MAX_DISTANCE ALfloat
- * RollOff Factor AL_ROLLOFF_FACTOR ALfloat
- * Inner Angle AL_CONE_INNER_ANGLE ALint or ALfloat
- * Outer Angle AL_CONE_OUTER_ANGLE ALint or ALfloat
- * Cone Outer Gain AL_CONE_OUTER_GAIN ALint or ALfloat
- * Pitch AL_PITCH ALfloat
- * Looping AL_LOOPING ALint (AL_TRUE or AL_FALSE)
- * MS Offset AL_MSEC_OFFSET ALint or ALfloat
- * Byte Offset AL_BYTE_OFFSET ALint or ALfloat
- * Sample Offset AL_SAMPLE_OFFSET ALint or ALfloat
- * Attached Buffer AL_BUFFER ALint
- * State (Query only) AL_SOURCE_STATE ALint
- * Buffers Queued (Query only) AL_BUFFERS_QUEUED ALint
- * Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint
- */
-
-/* Create Source objects */
-AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* sources );
-
-/* Delete Source objects */
-AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* sources );
-
-/* Verify a handle is a valid Source */
-AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid );
-
-/*
- * Set Source parameters
- */
-AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value );
-
-AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
-
-AL_API void AL_APIENTRY alSourcefv( ALuint sid, ALenum param, const ALfloat* values );
-
-AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value );
-
-AL_API void AL_APIENTRY alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
-
-AL_API void AL_APIENTRY alSourceiv( ALuint sid, ALenum param, const ALint* values );
-
-/*
- * Get Source parameters
- */
-AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value );
-
-AL_API void AL_APIENTRY alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
-
-AL_API void AL_APIENTRY alGetSourcefv( ALuint sid, ALenum param, ALfloat* values );
-
-AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value );
-
-AL_API void AL_APIENTRY alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
-
-AL_API void AL_APIENTRY alGetSourceiv( ALuint sid, ALenum param, ALint* values );
-
-
-/*
- * Source vector based playback calls
- */
-
-/* Play, replay, or resume (if paused) a list of Sources */
-AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids );
-
-/* Stop a list of Sources */
-AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids );
-
-/* Rewind a list of Sources */
-AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids );
-
-/* Pause a list of Sources */
-AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids );
-
-/*
- * Source based playback calls
- */
-
-/* Play, replay, or resume a Source */
-AL_API void AL_APIENTRY alSourcePlay( ALuint sid );
-
-/* Stop a Source */
-AL_API void AL_APIENTRY alSourceStop( ALuint sid );
-
-/* Rewind a Source (set playback postiton to beginning) */
-AL_API void AL_APIENTRY alSourceRewind( ALuint sid );
-
-/* Pause a Source */
-AL_API void AL_APIENTRY alSourcePause( ALuint sid );
-
-/*
- * Source Queuing
- */
-AL_API void AL_APIENTRY alSourceQueueBuffers( ALuint sid, ALsizei numEntries, const ALuint *bids );
-
-AL_API void AL_APIENTRY alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids );
-
-
-/**
- * BUFFER
- * Buffer objects are storage space for sample data.
- * Buffers are referred to by Sources. One Buffer can be used
- * by multiple Sources.
- *
- * Properties include: -
- *
- * Frequency (Query only) AL_FREQUENCY ALint
- * Size (Query only) AL_SIZE ALint
- * Bits (Query only) AL_BITS ALint
- * Channels (Query only) AL_CHANNELS ALint
- */
-
-/* Create Buffer objects */
-AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* buffers );
-
-/* Delete Buffer objects */
-AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* buffers );
-
-/* Verify a handle is a valid Buffer */
-AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid );
-
-/* Specify the data to be copied into a buffer */
-AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
-
-/*
- * Set Buffer parameters
- */
-AL_API void AL_APIENTRY alBufferf( ALuint bid, ALenum param, ALfloat value );
-
-AL_API void AL_APIENTRY alBuffer3f( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
-
-AL_API void AL_APIENTRY alBufferfv( ALuint bid, ALenum param, const ALfloat* values );
-
-AL_API void AL_APIENTRY alBufferi( ALuint bid, ALenum param, ALint value );
-
-AL_API void AL_APIENTRY alBuffer3i( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
-
-AL_API void AL_APIENTRY alBufferiv( ALuint bid, ALenum param, const ALint* values );
-
-/*
- * Get Buffer parameters
- */
-AL_API void AL_APIENTRY alGetBufferf( ALuint bid, ALenum param, ALfloat* value );
-
-AL_API void AL_APIENTRY alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
-
-AL_API void AL_APIENTRY alGetBufferfv( ALuint bid, ALenum param, ALfloat* values );
-
-AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value );
-
-AL_API void AL_APIENTRY alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
-
-AL_API void AL_APIENTRY alGetBufferiv( ALuint bid, ALenum param, ALint* values );
-
-
-/*
- * Global Parameters
- */
-AL_API void AL_APIENTRY alDopplerFactor( ALfloat value );
-
-AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value );
-
-AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value );
-
-AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel );
-
-/*
- * Pointer-to-function types, useful for dynamically getting AL entry points.
- */
-typedef void (AL_APIENTRY *LPALENABLE)( ALenum capability );
-typedef void (AL_APIENTRY *LPALDISABLE)( ALenum capability );
-typedef ALboolean (AL_APIENTRY *LPALISENABLED)( ALenum capability );
-typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)( ALenum param );
-typedef void (AL_APIENTRY *LPALGETBOOLEANV)( ALenum param, ALboolean* data );
-typedef void (AL_APIENTRY *LPALGETINTEGERV)( ALenum param, ALint* data );
-typedef void (AL_APIENTRY *LPALGETFLOATV)( ALenum param, ALfloat* data );
-typedef void (AL_APIENTRY *LPALGETDOUBLEV)( ALenum param, ALdouble* data );
-typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)( ALenum param );
-typedef ALint (AL_APIENTRY *LPALGETINTEGER)( ALenum param );
-typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)( ALenum param );
-typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)( ALenum param );
-typedef ALenum (AL_APIENTRY *LPALGETERROR)( void );
-typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar* extname );
-typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)( const ALchar* fname );
-typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)( const ALchar* ename );
-typedef void (AL_APIENTRY *LPALLISTENERF)( ALenum param, ALfloat value );
-typedef void (AL_APIENTRY *LPALLISTENER3F)( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
-typedef void (AL_APIENTRY *LPALLISTENERFV)( ALenum param, const ALfloat* values );
-typedef void (AL_APIENTRY *LPALLISTENERI)( ALenum param, ALint value );
-typedef void (AL_APIENTRY *LPALLISTENER3I)( ALenum param, ALint value1, ALint value2, ALint value3 );
-typedef void (AL_APIENTRY *LPALLISTENERIV)( ALenum param, const ALint* values );
-typedef void (AL_APIENTRY *LPALGETLISTENERF)( ALenum param, ALfloat* value );
-typedef void (AL_APIENTRY *LPALGETLISTENER3F)( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
-typedef void (AL_APIENTRY *LPALGETLISTENERFV)( ALenum param, ALfloat* values );
-typedef void (AL_APIENTRY *LPALGETLISTENERI)( ALenum param, ALint* value );
-typedef void (AL_APIENTRY *LPALGETLISTENER3I)( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
-typedef void (AL_APIENTRY *LPALGETLISTENERIV)( ALenum param, ALint* values );
-typedef void (AL_APIENTRY *LPALGENSOURCES)( ALsizei n, ALuint* sources );
-typedef void (AL_APIENTRY *LPALDELETESOURCES)( ALsizei n, const ALuint* sources );
-typedef ALboolean (AL_APIENTRY *LPALISSOURCE)( ALuint sid );
-typedef void (AL_APIENTRY *LPALSOURCEF)( ALuint sid, ALenum param, ALfloat value);
-typedef void (AL_APIENTRY *LPALSOURCE3F)( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
-typedef void (AL_APIENTRY *LPALSOURCEFV)( ALuint sid, ALenum param, const ALfloat* values );
-typedef void (AL_APIENTRY *LPALSOURCEI)( ALuint sid, ALenum param, ALint value);
-typedef void (AL_APIENTRY *LPALSOURCE3I)( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
-typedef void (AL_APIENTRY *LPALSOURCEIV)( ALuint sid, ALenum param, const ALint* values );
-typedef void (AL_APIENTRY *LPALGETSOURCEF)( ALuint sid, ALenum param, ALfloat* value );
-typedef void (AL_APIENTRY *LPALGETSOURCE3F)( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
-typedef void (AL_APIENTRY *LPALGETSOURCEFV)( ALuint sid, ALenum param, ALfloat* values );
-typedef void (AL_APIENTRY *LPALGETSOURCEI)( ALuint sid, ALenum param, ALint* value );
-typedef void (AL_APIENTRY *LPALGETSOURCE3I)( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
-typedef void (AL_APIENTRY *LPALGETSOURCEIV)( ALuint sid, ALenum param, ALint* values );
-typedef void (AL_APIENTRY *LPALSOURCEPLAYV)( ALsizei ns, const ALuint *sids );
-typedef void (AL_APIENTRY *LPALSOURCESTOPV)( ALsizei ns, const ALuint *sids );
-typedef void (AL_APIENTRY *LPALSOURCEREWINDV)( ALsizei ns, const ALuint *sids );
-typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)( ALsizei ns, const ALuint *sids );
-typedef void (AL_APIENTRY *LPALSOURCEPLAY)( ALuint sid );
-typedef void (AL_APIENTRY *LPALSOURCESTOP)( ALuint sid );
-typedef void (AL_APIENTRY *LPALSOURCEREWIND)( ALuint sid );
-typedef void (AL_APIENTRY *LPALSOURCEPAUSE)( ALuint sid );
-typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, const ALuint *bids );
-typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, ALuint *bids );
-typedef void (AL_APIENTRY *LPALGENBUFFERS)( ALsizei n, ALuint* buffers );
-typedef void (AL_APIENTRY *LPALDELETEBUFFERS)( ALsizei n, const ALuint* buffers );
-typedef ALboolean (AL_APIENTRY *LPALISBUFFER)( ALuint bid );
-typedef void (AL_APIENTRY *LPALBUFFERDATA)( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
-typedef void (AL_APIENTRY *LPALBUFFERF)( ALuint bid, ALenum param, ALfloat value);
-typedef void (AL_APIENTRY *LPALBUFFER3F)( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
-typedef void (AL_APIENTRY *LPALBUFFERFV)( ALuint bid, ALenum param, const ALfloat* values );
-typedef void (AL_APIENTRY *LPALBUFFERI)( ALuint bid, ALenum param, ALint value);
-typedef void (AL_APIENTRY *LPALBUFFER3I)( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
-typedef void (AL_APIENTRY *LPALBUFFERIV)( ALuint bid, ALenum param, const ALint* values );
-typedef void (AL_APIENTRY *LPALGETBUFFERF)( ALuint bid, ALenum param, ALfloat* value );
-typedef void (AL_APIENTRY *LPALGETBUFFER3F)( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
-typedef void (AL_APIENTRY *LPALGETBUFFERFV)( ALuint bid, ALenum param, ALfloat* values );
-typedef void (AL_APIENTRY *LPALGETBUFFERI)( ALuint bid, ALenum param, ALint* value );
-typedef void (AL_APIENTRY *LPALGETBUFFER3I)( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
-typedef void (AL_APIENTRY *LPALGETBUFFERIV)( ALuint bid, ALenum param, ALint* values );
-typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)( ALfloat value );
-typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)( ALfloat value );
-typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)( ALfloat value );
-typedef void (AL_APIENTRY *LPALDISTANCEMODEL)( ALenum distanceModel );
-
-/**
- * Commented out in order to surpress warning: "ignoring #pragma export on"
- * This warning is inevitable and does not cause any problems otherwise.
-
- #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
- #pragma export off
- #endif
-
- */
-
-#if defined(__cplusplus)
-} /* extern "C" */
-#endif
-
-#endif /* AL_AL_H */
Copied: code/branches/kicklib/src/external/openal/al.h (from rev 7788, code/branches/ois_update/src/external/openal/al.h)
===================================================================
--- code/branches/kicklib/src/external/openal/al.h (rev 0)
+++ code/branches/kicklib/src/external/openal/al.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,736 @@
+#ifndef AL_AL_H
+#define AL_AL_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(_XBOX)
+ /* _OPENAL32LIB is deprecated */
+ #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB)
+ #define AL_API __declspec(dllexport)
+ #else
+ #define AL_API __declspec(dllimport)
+ #endif
+#else
+ #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
+ #define AL_API __attribute__((visibility("default")))
+ #else
+ #define AL_API extern
+ #endif
+#endif
+
+#if defined(_WIN32)
+ #define AL_APIENTRY __cdecl
+#else
+ #define AL_APIENTRY
+#endif
+
+/**
+ * Commented out in order to surpress warning: "ignoring #pragma export on"
+ * This warning is inevitable and does not cause any problems otherwise.
+
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+ #pragma export on
+#endif
+
+ */
+
+/*
+ * The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and
+ * AL_ILLEGAL_COMMAND macros are deprecated, but are included for
+ * applications porting code from AL 1.0
+ */
+#define OPENAL
+#define ALAPI AL_API
+#define ALAPIENTRY AL_APIENTRY
+#define AL_INVALID (-1)
+#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
+#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
+
+#define AL_VERSION_1_0
+#define AL_VERSION_1_1
+
+
+/** 8-bit boolean */
+typedef char ALboolean;
+
+/** character */
+typedef char ALchar;
+
+/** signed 8-bit 2's complement integer */
+typedef char ALbyte;
+
+/** unsigned 8-bit integer */
+typedef unsigned char ALubyte;
+
+/** signed 16-bit 2's complement integer */
+typedef short ALshort;
+
+/** unsigned 16-bit integer */
+typedef unsigned short ALushort;
+
+/** signed 32-bit 2's complement integer */
+typedef int ALint;
+
+/** unsigned 32-bit integer */
+typedef unsigned int ALuint;
+
+/** non-negative 32-bit binary integer size */
+typedef int ALsizei;
+
+/** enumerated 32-bit value */
+typedef int ALenum;
+
+/** 32-bit IEEE754 floating-point */
+typedef float ALfloat;
+
+/** 64-bit IEEE754 floating-point */
+typedef double ALdouble;
+
+/** void type (for opaque pointers only) */
+typedef void ALvoid;
+
+
+/* Enumerant values begin at column 50. No tabs. */
+
+/* "no distance model" or "no buffer" */
+#define AL_NONE 0
+
+/* Boolean False. */
+#define AL_FALSE 0
+
+/** Boolean True. */
+#define AL_TRUE 1
+
+/** Indicate Source has relative coordinates. */
+#define AL_SOURCE_RELATIVE 0x202
+
+
+
+/**
+ * Directional source, inner cone angle, in degrees.
+ * Range: [0-360]
+ * Default: 360
+ */
+#define AL_CONE_INNER_ANGLE 0x1001
+
+/**
+ * Directional source, outer cone angle, in degrees.
+ * Range: [0-360]
+ * Default: 360
+ */
+#define AL_CONE_OUTER_ANGLE 0x1002
+
+/**
+ * Specify the pitch to be applied, either at source,
+ * or on mixer results, at listener.
+ * Range: [0.5-2.0]
+ * Default: 1.0
+ */
+#define AL_PITCH 0x1003
+
+/**
+ * Specify the current location in three dimensional space.
+ * OpenAL, like OpenGL, uses a right handed coordinate system,
+ * where in a frontal default view X (thumb) points right,
+ * Y points up (index finger), and Z points towards the
+ * viewer/camera (middle finger).
+ * To switch from a left handed coordinate system, flip the
+ * sign on the Z coordinate.
+ * Listener position is always in the world coordinate system.
+ */
+#define AL_POSITION 0x1004
+
+/** Specify the current direction. */
+#define AL_DIRECTION 0x1005
+
+/** Specify the current velocity in three dimensional space. */
+#define AL_VELOCITY 0x1006
+
+/**
+ * Indicate whether source is looping.
+ * Type: ALboolean?
+ * Range: [AL_TRUE, AL_FALSE]
+ * Default: FALSE.
+ */
+#define AL_LOOPING 0x1007
+
+/**
+ * Indicate the buffer to provide sound samples.
+ * Type: ALuint.
+ * Range: any valid Buffer id.
+ */
+#define AL_BUFFER 0x1009
+
+/**
+ * Indicate the gain (volume amplification) applied.
+ * Type: ALfloat.
+ * Range: ]0.0- ]
+ * A value of 1.0 means un-attenuated/unchanged.
+ * Each division by 2 equals an attenuation of -6dB.
+ * Each multiplicaton with 2 equals an amplification of +6dB.
+ * A value of 0.0 is meaningless with respect to a logarithmic
+ * scale; it is interpreted as zero volume - the channel
+ * is effectively disabled.
+ */
+#define AL_GAIN 0x100A
+
+/*
+ * Indicate minimum source attenuation
+ * Type: ALfloat
+ * Range: [0.0 - 1.0]
+ *
+ * Logarthmic
+ */
+#define AL_MIN_GAIN 0x100D
+
+/**
+ * Indicate maximum source attenuation
+ * Type: ALfloat
+ * Range: [0.0 - 1.0]
+ *
+ * Logarthmic
+ */
+#define AL_MAX_GAIN 0x100E
+
+/**
+ * Indicate listener orientation.
+ *
+ * at/up
+ */
+#define AL_ORIENTATION 0x100F
+
+/**
+ * Source state information.
+ */
+#define AL_SOURCE_STATE 0x1010
+#define AL_INITIAL 0x1011
+#define AL_PLAYING 0x1012
+#define AL_PAUSED 0x1013
+#define AL_STOPPED 0x1014
+
+/**
+ * Buffer Queue params
+ */
+#define AL_BUFFERS_QUEUED 0x1015
+#define AL_BUFFERS_PROCESSED 0x1016
+
+/**
+ * Source buffer position information
+ */
+#define AL_SEC_OFFSET 0x1024
+#define AL_SAMPLE_OFFSET 0x1025
+#define AL_BYTE_OFFSET 0x1026
+
+/*
+ * Source type (Static, Streaming or undetermined)
+ * Source is Static if a Buffer has been attached using AL_BUFFER
+ * Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
+ * Source is undetermined when it has the NULL buffer attached
+ */
+#define AL_SOURCE_TYPE 0x1027
+#define AL_STATIC 0x1028
+#define AL_STREAMING 0x1029
+#define AL_UNDETERMINED 0x1030
+
+/** Sound samples: format specifier. */
+#define AL_FORMAT_MONO8 0x1100
+#define AL_FORMAT_MONO16 0x1101
+#define AL_FORMAT_STEREO8 0x1102
+#define AL_FORMAT_STEREO16 0x1103
+
+/**
+ * source specific reference distance
+ * Type: ALfloat
+ * Range: 0.0 - +inf
+ *
+ * At 0.0, no distance attenuation occurs. Default is
+ * 1.0.
+ */
+#define AL_REFERENCE_DISTANCE 0x1020
+
+/**
+ * source specific rolloff factor
+ * Type: ALfloat
+ * Range: 0.0 - +inf
+ *
+ */
+#define AL_ROLLOFF_FACTOR 0x1021
+
+/**
+ * Directional source, outer cone gain.
+ *
+ * Default: 0.0
+ * Range: [0.0 - 1.0]
+ * Logarithmic
+ */
+#define AL_CONE_OUTER_GAIN 0x1022
+
+/**
+ * Indicate distance above which sources are not
+ * attenuated using the inverse clamped distance model.
+ *
+ * Default: +inf
+ * Type: ALfloat
+ * Range: 0.0 - +inf
+ */
+#define AL_MAX_DISTANCE 0x1023
+
+/**
+ * Sound samples: frequency, in units of Hertz [Hz].
+ * This is the number of samples per second. Half of the
+ * sample frequency marks the maximum significant
+ * frequency component.
+ */
+#define AL_FREQUENCY 0x2001
+#define AL_BITS 0x2002
+#define AL_CHANNELS 0x2003
+#define AL_SIZE 0x2004
+
+/**
+ * Buffer state.
+ *
+ * Not supported for public use (yet).
+ */
+#define AL_UNUSED 0x2010
+#define AL_PENDING 0x2011
+#define AL_PROCESSED 0x2012
+
+
+/** Errors: No Error. */
+#define AL_NO_ERROR AL_FALSE
+
+/**
+ * Invalid Name paramater passed to AL call.
+ */
+#define AL_INVALID_NAME 0xA001
+
+/**
+ * Invalid parameter passed to AL call.
+ */
+#define AL_INVALID_ENUM 0xA002
+
+/**
+ * Invalid enum parameter value.
+ */
+#define AL_INVALID_VALUE 0xA003
+
+/**
+ * Illegal call.
+ */
+#define AL_INVALID_OPERATION 0xA004
+
+
+/**
+ * No mojo.
+ */
+#define AL_OUT_OF_MEMORY 0xA005
+
+
+/** Context strings: Vendor Name. */
+#define AL_VENDOR 0xB001
+#define AL_VERSION 0xB002
+#define AL_RENDERER 0xB003
+#define AL_EXTENSIONS 0xB004
+
+/** Global tweakage. */
+
+/**
+ * Doppler scale. Default 1.0
+ */
+#define AL_DOPPLER_FACTOR 0xC000
+
+/**
+ * Tweaks speed of propagation.
+ */
+#define AL_DOPPLER_VELOCITY 0xC001
+
+/**
+ * Speed of Sound in units per second
+ */
+#define AL_SPEED_OF_SOUND 0xC003
+
+/**
+ * Distance models
+ *
+ * used in conjunction with DistanceModel
+ *
+ * implicit: NONE, which disances distance attenuation.
+ */
+#define AL_DISTANCE_MODEL 0xD000
+#define AL_INVERSE_DISTANCE 0xD001
+#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
+#define AL_LINEAR_DISTANCE 0xD003
+#define AL_LINEAR_DISTANCE_CLAMPED 0xD004
+#define AL_EXPONENT_DISTANCE 0xD005
+#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
+
+/*
+ * Renderer State management
+ */
+AL_API void AL_APIENTRY alEnable( ALenum capability );
+
+AL_API void AL_APIENTRY alDisable( ALenum capability );
+
+AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
+
+
+/*
+ * State retrieval
+ */
+AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
+
+AL_API void AL_APIENTRY alGetBooleanv( ALenum param, ALboolean* data );
+
+AL_API void AL_APIENTRY alGetIntegerv( ALenum param, ALint* data );
+
+AL_API void AL_APIENTRY alGetFloatv( ALenum param, ALfloat* data );
+
+AL_API void AL_APIENTRY alGetDoublev( ALenum param, ALdouble* data );
+
+AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param );
+
+AL_API ALint AL_APIENTRY alGetInteger( ALenum param );
+
+AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param );
+
+AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param );
+
+
+/*
+ * Error support.
+ * Obtain the most recent error generated in the AL state machine.
+ */
+AL_API ALenum AL_APIENTRY alGetError( void );
+
+
+/*
+ * Extension support.
+ * Query for the presence of an extension, and obtain any appropriate
+ * function pointers and enum values.
+ */
+AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
+
+AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname );
+
+AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
+
+
+/*
+ * LISTENER
+ * Listener represents the location and orientation of the
+ * 'user' in 3D-space.
+ *
+ * Properties include: -
+ *
+ * Gain AL_GAIN ALfloat
+ * Position AL_POSITION ALfloat[3]
+ * Velocity AL_VELOCITY ALfloat[3]
+ * Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors)
+*/
+
+/*
+ * Set Listener parameters
+ */
+AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value );
+
+AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values );
+
+AL_API void AL_APIENTRY alListeneri( ALenum param, ALint value );
+
+AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
+
+AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values );
+
+/*
+ * Get Listener parameters
+ */
+AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value );
+
+AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
+
+AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values );
+
+AL_API void AL_APIENTRY alGetListeneri( ALenum param, ALint* value );
+
+AL_API void AL_APIENTRY alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
+
+AL_API void AL_APIENTRY alGetListeneriv( ALenum param, ALint* values );
+
+
+/**
+ * SOURCE
+ * Sources represent individual sound objects in 3D-space.
+ * Sources take the PCM data provided in the specified Buffer,
+ * apply Source-specific modifications, and then
+ * submit them to be mixed according to spatial arrangement etc.
+ *
+ * Properties include: -
+ *
+ * Gain AL_GAIN ALfloat
+ * Min Gain AL_MIN_GAIN ALfloat
+ * Max Gain AL_MAX_GAIN ALfloat
+ * Position AL_POSITION ALfloat[3]
+ * Velocity AL_VELOCITY ALfloat[3]
+ * Direction AL_DIRECTION ALfloat[3]
+ * Head Relative Mode AL_SOURCE_RELATIVE ALint (AL_TRUE or AL_FALSE)
+ * Reference Distance AL_REFERENCE_DISTANCE ALfloat
+ * Max Distance AL_MAX_DISTANCE ALfloat
+ * RollOff Factor AL_ROLLOFF_FACTOR ALfloat
+ * Inner Angle AL_CONE_INNER_ANGLE ALint or ALfloat
+ * Outer Angle AL_CONE_OUTER_ANGLE ALint or ALfloat
+ * Cone Outer Gain AL_CONE_OUTER_GAIN ALint or ALfloat
+ * Pitch AL_PITCH ALfloat
+ * Looping AL_LOOPING ALint (AL_TRUE or AL_FALSE)
+ * MS Offset AL_MSEC_OFFSET ALint or ALfloat
+ * Byte Offset AL_BYTE_OFFSET ALint or ALfloat
+ * Sample Offset AL_SAMPLE_OFFSET ALint or ALfloat
+ * Attached Buffer AL_BUFFER ALint
+ * State (Query only) AL_SOURCE_STATE ALint
+ * Buffers Queued (Query only) AL_BUFFERS_QUEUED ALint
+ * Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint
+ */
+
+/* Create Source objects */
+AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* sources );
+
+/* Delete Source objects */
+AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* sources );
+
+/* Verify a handle is a valid Source */
+AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid );
+
+/*
+ * Set Source parameters
+ */
+AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value );
+
+AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+AL_API void AL_APIENTRY alSourcefv( ALuint sid, ALenum param, const ALfloat* values );
+
+AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value );
+
+AL_API void AL_APIENTRY alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
+
+AL_API void AL_APIENTRY alSourceiv( ALuint sid, ALenum param, const ALint* values );
+
+/*
+ * Get Source parameters
+ */
+AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value );
+
+AL_API void AL_APIENTRY alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+
+AL_API void AL_APIENTRY alGetSourcefv( ALuint sid, ALenum param, ALfloat* values );
+
+AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value );
+
+AL_API void AL_APIENTRY alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+
+AL_API void AL_APIENTRY alGetSourceiv( ALuint sid, ALenum param, ALint* values );
+
+
+/*
+ * Source vector based playback calls
+ */
+
+/* Play, replay, or resume (if paused) a list of Sources */
+AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids );
+
+/* Stop a list of Sources */
+AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids );
+
+/* Rewind a list of Sources */
+AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids );
+
+/* Pause a list of Sources */
+AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids );
+
+/*
+ * Source based playback calls
+ */
+
+/* Play, replay, or resume a Source */
+AL_API void AL_APIENTRY alSourcePlay( ALuint sid );
+
+/* Stop a Source */
+AL_API void AL_APIENTRY alSourceStop( ALuint sid );
+
+/* Rewind a Source (set playback postiton to beginning) */
+AL_API void AL_APIENTRY alSourceRewind( ALuint sid );
+
+/* Pause a Source */
+AL_API void AL_APIENTRY alSourcePause( ALuint sid );
+
+/*
+ * Source Queuing
+ */
+AL_API void AL_APIENTRY alSourceQueueBuffers( ALuint sid, ALsizei numEntries, const ALuint *bids );
+
+AL_API void AL_APIENTRY alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids );
+
+
+/**
+ * BUFFER
+ * Buffer objects are storage space for sample data.
+ * Buffers are referred to by Sources. One Buffer can be used
+ * by multiple Sources.
+ *
+ * Properties include: -
+ *
+ * Frequency (Query only) AL_FREQUENCY ALint
+ * Size (Query only) AL_SIZE ALint
+ * Bits (Query only) AL_BITS ALint
+ * Channels (Query only) AL_CHANNELS ALint
+ */
+
+/* Create Buffer objects */
+AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* buffers );
+
+/* Delete Buffer objects */
+AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* buffers );
+
+/* Verify a handle is a valid Buffer */
+AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid );
+
+/* Specify the data to be copied into a buffer */
+AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
+
+/*
+ * Set Buffer parameters
+ */
+AL_API void AL_APIENTRY alBufferf( ALuint bid, ALenum param, ALfloat value );
+
+AL_API void AL_APIENTRY alBuffer3f( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+AL_API void AL_APIENTRY alBufferfv( ALuint bid, ALenum param, const ALfloat* values );
+
+AL_API void AL_APIENTRY alBufferi( ALuint bid, ALenum param, ALint value );
+
+AL_API void AL_APIENTRY alBuffer3i( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
+
+AL_API void AL_APIENTRY alBufferiv( ALuint bid, ALenum param, const ALint* values );
+
+/*
+ * Get Buffer parameters
+ */
+AL_API void AL_APIENTRY alGetBufferf( ALuint bid, ALenum param, ALfloat* value );
+
+AL_API void AL_APIENTRY alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+
+AL_API void AL_APIENTRY alGetBufferfv( ALuint bid, ALenum param, ALfloat* values );
+
+AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value );
+
+AL_API void AL_APIENTRY alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+
+AL_API void AL_APIENTRY alGetBufferiv( ALuint bid, ALenum param, ALint* values );
+
+
+/*
+ * Global Parameters
+ */
+AL_API void AL_APIENTRY alDopplerFactor( ALfloat value );
+
+AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value );
+
+AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value );
+
+AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel );
+
+/*
+ * Pointer-to-function types, useful for dynamically getting AL entry points.
+ */
+typedef void (AL_APIENTRY *LPALENABLE)( ALenum capability );
+typedef void (AL_APIENTRY *LPALDISABLE)( ALenum capability );
+typedef ALboolean (AL_APIENTRY *LPALISENABLED)( ALenum capability );
+typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)( ALenum param );
+typedef void (AL_APIENTRY *LPALGETBOOLEANV)( ALenum param, ALboolean* data );
+typedef void (AL_APIENTRY *LPALGETINTEGERV)( ALenum param, ALint* data );
+typedef void (AL_APIENTRY *LPALGETFLOATV)( ALenum param, ALfloat* data );
+typedef void (AL_APIENTRY *LPALGETDOUBLEV)( ALenum param, ALdouble* data );
+typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)( ALenum param );
+typedef ALint (AL_APIENTRY *LPALGETINTEGER)( ALenum param );
+typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)( ALenum param );
+typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)( ALenum param );
+typedef ALenum (AL_APIENTRY *LPALGETERROR)( void );
+typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar* extname );
+typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)( const ALchar* fname );
+typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)( const ALchar* ename );
+typedef void (AL_APIENTRY *LPALLISTENERF)( ALenum param, ALfloat value );
+typedef void (AL_APIENTRY *LPALLISTENER3F)( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+typedef void (AL_APIENTRY *LPALLISTENERFV)( ALenum param, const ALfloat* values );
+typedef void (AL_APIENTRY *LPALLISTENERI)( ALenum param, ALint value );
+typedef void (AL_APIENTRY *LPALLISTENER3I)( ALenum param, ALint value1, ALint value2, ALint value3 );
+typedef void (AL_APIENTRY *LPALLISTENERIV)( ALenum param, const ALint* values );
+typedef void (AL_APIENTRY *LPALGETLISTENERF)( ALenum param, ALfloat* value );
+typedef void (AL_APIENTRY *LPALGETLISTENER3F)( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
+typedef void (AL_APIENTRY *LPALGETLISTENERFV)( ALenum param, ALfloat* values );
+typedef void (AL_APIENTRY *LPALGETLISTENERI)( ALenum param, ALint* value );
+typedef void (AL_APIENTRY *LPALGETLISTENER3I)( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
+typedef void (AL_APIENTRY *LPALGETLISTENERIV)( ALenum param, ALint* values );
+typedef void (AL_APIENTRY *LPALGENSOURCES)( ALsizei n, ALuint* sources );
+typedef void (AL_APIENTRY *LPALDELETESOURCES)( ALsizei n, const ALuint* sources );
+typedef ALboolean (AL_APIENTRY *LPALISSOURCE)( ALuint sid );
+typedef void (AL_APIENTRY *LPALSOURCEF)( ALuint sid, ALenum param, ALfloat value);
+typedef void (AL_APIENTRY *LPALSOURCE3F)( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+typedef void (AL_APIENTRY *LPALSOURCEFV)( ALuint sid, ALenum param, const ALfloat* values );
+typedef void (AL_APIENTRY *LPALSOURCEI)( ALuint sid, ALenum param, ALint value);
+typedef void (AL_APIENTRY *LPALSOURCE3I)( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
+typedef void (AL_APIENTRY *LPALSOURCEIV)( ALuint sid, ALenum param, const ALint* values );
+typedef void (AL_APIENTRY *LPALGETSOURCEF)( ALuint sid, ALenum param, ALfloat* value );
+typedef void (AL_APIENTRY *LPALGETSOURCE3F)( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+typedef void (AL_APIENTRY *LPALGETSOURCEFV)( ALuint sid, ALenum param, ALfloat* values );
+typedef void (AL_APIENTRY *LPALGETSOURCEI)( ALuint sid, ALenum param, ALint* value );
+typedef void (AL_APIENTRY *LPALGETSOURCE3I)( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+typedef void (AL_APIENTRY *LPALGETSOURCEIV)( ALuint sid, ALenum param, ALint* values );
+typedef void (AL_APIENTRY *LPALSOURCEPLAYV)( ALsizei ns, const ALuint *sids );
+typedef void (AL_APIENTRY *LPALSOURCESTOPV)( ALsizei ns, const ALuint *sids );
+typedef void (AL_APIENTRY *LPALSOURCEREWINDV)( ALsizei ns, const ALuint *sids );
+typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)( ALsizei ns, const ALuint *sids );
+typedef void (AL_APIENTRY *LPALSOURCEPLAY)( ALuint sid );
+typedef void (AL_APIENTRY *LPALSOURCESTOP)( ALuint sid );
+typedef void (AL_APIENTRY *LPALSOURCEREWIND)( ALuint sid );
+typedef void (AL_APIENTRY *LPALSOURCEPAUSE)( ALuint sid );
+typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, const ALuint *bids );
+typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, ALuint *bids );
+typedef void (AL_APIENTRY *LPALGENBUFFERS)( ALsizei n, ALuint* buffers );
+typedef void (AL_APIENTRY *LPALDELETEBUFFERS)( ALsizei n, const ALuint* buffers );
+typedef ALboolean (AL_APIENTRY *LPALISBUFFER)( ALuint bid );
+typedef void (AL_APIENTRY *LPALBUFFERDATA)( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
+typedef void (AL_APIENTRY *LPALBUFFERF)( ALuint bid, ALenum param, ALfloat value);
+typedef void (AL_APIENTRY *LPALBUFFER3F)( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+typedef void (AL_APIENTRY *LPALBUFFERFV)( ALuint bid, ALenum param, const ALfloat* values );
+typedef void (AL_APIENTRY *LPALBUFFERI)( ALuint bid, ALenum param, ALint value);
+typedef void (AL_APIENTRY *LPALBUFFER3I)( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
+typedef void (AL_APIENTRY *LPALBUFFERIV)( ALuint bid, ALenum param, const ALint* values );
+typedef void (AL_APIENTRY *LPALGETBUFFERF)( ALuint bid, ALenum param, ALfloat* value );
+typedef void (AL_APIENTRY *LPALGETBUFFER3F)( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+typedef void (AL_APIENTRY *LPALGETBUFFERFV)( ALuint bid, ALenum param, ALfloat* values );
+typedef void (AL_APIENTRY *LPALGETBUFFERI)( ALuint bid, ALenum param, ALint* value );
+typedef void (AL_APIENTRY *LPALGETBUFFER3I)( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+typedef void (AL_APIENTRY *LPALGETBUFFERIV)( ALuint bid, ALenum param, ALint* values );
+typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)( ALfloat value );
+typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)( ALfloat value );
+typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)( ALfloat value );
+typedef void (AL_APIENTRY *LPALDISTANCEMODEL)( ALenum distanceModel );
+
+/**
+ * Commented out in order to surpress warning: "ignoring #pragma export on"
+ * This warning is inevitable and does not cause any problems otherwise.
+
+ #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+ #pragma export off
+ #endif
+
+ */
+
+#if defined(__cplusplus)
+} /* extern "C" */
+#endif
+
+#endif /* AL_AL_H */
Deleted: code/branches/kicklib/src/external/openal/alc.h
===================================================================
--- code/branches/ois_update/src/external/openal/alc.h 2010-12-21 17:09:09 UTC (rev 7788)
+++ code/branches/kicklib/src/external/openal/alc.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -1,303 +0,0 @@
-/**
- * Due to a serious bug in the Mac OS X distribution of OpenAL,
- * all instantiations of "ALCvoid" have been replaced by "void".
- *
- * - the offending function declaration is similar to others except for the use of ALCvoid;
- * - C allows parameters typedefed to void, C++ does not;
- * - GCC >=4.2 are now strict about the error.
- */
-
-
-#ifndef AL_ALC_H
-#define AL_ALC_H
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#if defined(_WIN32) && !defined(_XBOX)
- /* _OPENAL32LIB is deprecated */
- #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB)
- #define ALC_API __declspec(dllexport)
- #else
- #define ALC_API __declspec(dllimport)
- #endif
-#else
- #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
- #define ALC_API __attribute__((visibility("default")))
- #else
- #define ALC_API extern
- #endif
-#endif
-
-#if defined(_WIN32)
- #define ALC_APIENTRY __cdecl
-#else
- #define ALC_APIENTRY
-#endif
-
-/**
- * Commented out in order to surpress warning: "ignoring #pragma export on"
- * This warning is inevitable and does not cause any problems otherwise.
-
-#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
-#pragma export on
-#endif
-
- */
-
-/*
- * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
- * included for applications porting code from AL 1.0
- */
-#define ALCAPI ALC_API
-#define ALCAPIENTRY ALC_APIENTRY
-#define ALC_INVALID 0
-
-
-#define ALC_VERSION_0_1 1
-
-typedef struct ALCdevice_struct ALCdevice;
-typedef struct ALCcontext_struct ALCcontext;
-
-
-/** 8-bit boolean */
-typedef char ALCboolean;
-
-/** character */
-typedef char ALCchar;
-
-/** signed 8-bit 2's complement integer */
-typedef char ALCbyte;
-
-/** unsigned 8-bit integer */
-typedef unsigned char ALCubyte;
-
-/** signed 16-bit 2's complement integer */
-typedef short ALCshort;
-
-/** unsigned 16-bit integer */
-typedef unsigned short ALCushort;
-
-/** signed 32-bit 2's complement integer */
-typedef int ALCint;
-
-/** unsigned 32-bit integer */
-typedef unsigned int ALCuint;
-
-/** non-negative 32-bit binary integer size */
-typedef int ALCsizei;
-
-/** enumerated 32-bit value */
-typedef int ALCenum;
-
-/** 32-bit IEEE754 floating-point */
-typedef float ALCfloat;
-
-/** 64-bit IEEE754 floating-point */
-typedef double ALCdouble;
-
-/** void type (for opaque pointers only) */
-typedef void ALCvoid;
-
-
-/* Enumerant values begin at column 50. No tabs. */
-
-/* Boolean False. */
-#define ALC_FALSE 0
-
-/* Boolean True. */
-#define ALC_TRUE 1
-
-/**
- * followed by <int> Hz
- */
-#define ALC_FREQUENCY 0x1007
-
-/**
- * followed by <int> Hz
- */
-#define ALC_REFRESH 0x1008
-
-/**
- * followed by AL_TRUE, AL_FALSE
- */
-#define ALC_SYNC 0x1009
-
-/**
- * followed by <int> Num of requested Mono (3D) Sources
- */
-#define ALC_MONO_SOURCES 0x1010
-
-/**
- * followed by <int> Num of requested Stereo Sources
- */
-#define ALC_STEREO_SOURCES 0x1011
-
-/**
- * errors
- */
-
-/**
- * No error
- */
-#define ALC_NO_ERROR ALC_FALSE
-
-/**
- * No device
- */
-#define ALC_INVALID_DEVICE 0xA001
-
-/**
- * invalid context ID
- */
-#define ALC_INVALID_CONTEXT 0xA002
-
-/**
- * bad enum
- */
-#define ALC_INVALID_ENUM 0xA003
-
-/**
- * bad value
- */
-#define ALC_INVALID_VALUE 0xA004
-
-/**
- * Out of memory.
- */
-#define ALC_OUT_OF_MEMORY 0xA005
-
-
-/**
- * The Specifier string for default device
- */
-#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
-#define ALC_DEVICE_SPECIFIER 0x1005
-#define ALC_EXTENSIONS 0x1006
-
-#define ALC_MAJOR_VERSION 0x1000
-#define ALC_MINOR_VERSION 0x1001
-
-#define ALC_ATTRIBUTES_SIZE 0x1002
-#define ALC_ALL_ATTRIBUTES 0x1003
-
-/**
- * ALC_ENUMERATE_ALL_EXT enums
- */
-#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
-#define ALC_ALL_DEVICES_SPECIFIER 0x1013
-
-/**
- * Capture extension
- */
-#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
-#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
-#define ALC_CAPTURE_SAMPLES 0x312
-
-
-/*
- * Context Management
- */
-ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
-
-ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
-
-ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
-
-ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
-
-ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
-
-ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
-
-ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
-
-
-/*
- * Device Management
- */
-ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
-
-ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
-
-
-/*
- * Error support.
- * Obtain the most recent Context error
- */
-ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
-
-
-/*
- * Extension support.
- * Query for the presence of an extension, and obtain any appropriate
- * function pointers and enum values.
- */
-ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
-
-ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
-
-ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
-
-
-/*
- * Query functions
- */
-ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
-
-ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
-
-
-/*
- * Capture functions
- */
-ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
-
-ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
-
-ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
-
-ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
-
-ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, void *buffer, ALCsizei samples );
-
-/*
- * Pointer-to-function types, useful for dynamically getting ALC entry points.
- */
-typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
-typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
-typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
-typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
-typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
-typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void );
-typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
-typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
-typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
-typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
-typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
-typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
-typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
-typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
-typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
-typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
-typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
-typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
-typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
-typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, void *buffer, ALCsizei samples );
-
-/**
- * Commented out in order to surpress warning: "ignoring #pragma export on"
- * This warning is inevitable and does not cause any problems otherwise.
-
- #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
- #pragma export off
- #endif
-
- */
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* AL_ALC_H */
Copied: code/branches/kicklib/src/external/openal/alc.h (from rev 7788, code/branches/ois_update/src/external/openal/alc.h)
===================================================================
--- code/branches/kicklib/src/external/openal/alc.h (rev 0)
+++ code/branches/kicklib/src/external/openal/alc.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -0,0 +1,303 @@
+/**
+ * Due to a serious bug in the Mac OS X distribution of OpenAL,
+ * all instantiations of "ALCvoid" have been replaced by "void".
+ *
+ * - the offending function declaration is similar to others except for the use of ALCvoid;
+ * - C allows parameters typedefed to void, C++ does not;
+ * - GCC >=4.2 are now strict about the error.
+ */
+
+
+#ifndef AL_ALC_H
+#define AL_ALC_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(_XBOX)
+ /* _OPENAL32LIB is deprecated */
+ #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB)
+ #define ALC_API __declspec(dllexport)
+ #else
+ #define ALC_API __declspec(dllimport)
+ #endif
+#else
+ #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
+ #define ALC_API __attribute__((visibility("default")))
+ #else
+ #define ALC_API extern
+ #endif
+#endif
+
+#if defined(_WIN32)
+ #define ALC_APIENTRY __cdecl
+#else
+ #define ALC_APIENTRY
+#endif
+
+/**
+ * Commented out in order to surpress warning: "ignoring #pragma export on"
+ * This warning is inevitable and does not cause any problems otherwise.
+
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+#pragma export on
+#endif
+
+ */
+
+/*
+ * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
+ * included for applications porting code from AL 1.0
+ */
+#define ALCAPI ALC_API
+#define ALCAPIENTRY ALC_APIENTRY
+#define ALC_INVALID 0
+
+
+#define ALC_VERSION_0_1 1
+
+typedef struct ALCdevice_struct ALCdevice;
+typedef struct ALCcontext_struct ALCcontext;
+
+
+/** 8-bit boolean */
+typedef char ALCboolean;
+
+/** character */
+typedef char ALCchar;
+
+/** signed 8-bit 2's complement integer */
+typedef char ALCbyte;
+
+/** unsigned 8-bit integer */
+typedef unsigned char ALCubyte;
+
+/** signed 16-bit 2's complement integer */
+typedef short ALCshort;
+
+/** unsigned 16-bit integer */
+typedef unsigned short ALCushort;
+
+/** signed 32-bit 2's complement integer */
+typedef int ALCint;
+
+/** unsigned 32-bit integer */
+typedef unsigned int ALCuint;
+
+/** non-negative 32-bit binary integer size */
+typedef int ALCsizei;
+
+/** enumerated 32-bit value */
+typedef int ALCenum;
+
+/** 32-bit IEEE754 floating-point */
+typedef float ALCfloat;
+
+/** 64-bit IEEE754 floating-point */
+typedef double ALCdouble;
+
+/** void type (for opaque pointers only) */
+typedef void ALCvoid;
+
+
+/* Enumerant values begin at column 50. No tabs. */
+
+/* Boolean False. */
+#define ALC_FALSE 0
+
+/* Boolean True. */
+#define ALC_TRUE 1
+
+/**
+ * followed by <int> Hz
+ */
+#define ALC_FREQUENCY 0x1007
+
+/**
+ * followed by <int> Hz
+ */
+#define ALC_REFRESH 0x1008
+
+/**
+ * followed by AL_TRUE, AL_FALSE
+ */
+#define ALC_SYNC 0x1009
+
+/**
+ * followed by <int> Num of requested Mono (3D) Sources
+ */
+#define ALC_MONO_SOURCES 0x1010
+
+/**
+ * followed by <int> Num of requested Stereo Sources
+ */
+#define ALC_STEREO_SOURCES 0x1011
+
+/**
+ * errors
+ */
+
+/**
+ * No error
+ */
+#define ALC_NO_ERROR ALC_FALSE
+
+/**
+ * No device
+ */
+#define ALC_INVALID_DEVICE 0xA001
+
+/**
+ * invalid context ID
+ */
+#define ALC_INVALID_CONTEXT 0xA002
+
+/**
+ * bad enum
+ */
+#define ALC_INVALID_ENUM 0xA003
+
+/**
+ * bad value
+ */
+#define ALC_INVALID_VALUE 0xA004
+
+/**
+ * Out of memory.
+ */
+#define ALC_OUT_OF_MEMORY 0xA005
+
+
+/**
+ * The Specifier string for default device
+ */
+#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
+#define ALC_DEVICE_SPECIFIER 0x1005
+#define ALC_EXTENSIONS 0x1006
+
+#define ALC_MAJOR_VERSION 0x1000
+#define ALC_MINOR_VERSION 0x1001
+
+#define ALC_ATTRIBUTES_SIZE 0x1002
+#define ALC_ALL_ATTRIBUTES 0x1003
+
+/**
+ * ALC_ENUMERATE_ALL_EXT enums
+ */
+#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
+#define ALC_ALL_DEVICES_SPECIFIER 0x1013
+
+/**
+ * Capture extension
+ */
+#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
+#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
+#define ALC_CAPTURE_SAMPLES 0x312
+
+
+/*
+ * Context Management
+ */
+ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
+
+ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
+
+ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
+
+ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
+
+ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
+
+ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
+
+ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
+
+
+/*
+ * Device Management
+ */
+ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
+
+ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
+
+
+/*
+ * Error support.
+ * Obtain the most recent Context error
+ */
+ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
+
+
+/*
+ * Extension support.
+ * Query for the presence of an extension, and obtain any appropriate
+ * function pointers and enum values.
+ */
+ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
+
+ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
+
+ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
+
+
+/*
+ * Query functions
+ */
+ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
+
+ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
+
+
+/*
+ * Capture functions
+ */
+ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
+
+ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
+
+ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
+
+ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
+
+ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, void *buffer, ALCsizei samples );
+
+/*
+ * Pointer-to-function types, useful for dynamically getting ALC entry points.
+ */
+typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
+typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
+typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
+typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
+typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
+typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void );
+typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
+typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
+typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
+typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
+typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
+typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
+typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
+typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
+typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
+typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
+typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
+typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
+typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
+typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, void *buffer, ALCsizei samples );
+
+/**
+ * Commented out in order to surpress warning: "ignoring #pragma export on"
+ * This warning is inevitable and does not cause any problems otherwise.
+
+ #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+ #pragma export off
+ #endif
+
+ */
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* AL_ALC_H */
Modified: code/branches/kicklib/src/libraries/core/Core.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/Core.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/Core.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -80,7 +80,9 @@
Core* Core::singletonPtr_s = 0;
SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
+#ifndef ORXONOX_PLATFORM_APPLE
SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");
+#endif
#ifdef ORXONOX_PLATFORM_WINDOWS
SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)");
@@ -155,13 +157,15 @@
ClassIdentifier<Core>::getIdentifier("Core")->initialiseObject(this, "Core", true);
this->setConfigValues();
- // create persistent io console
+#ifndef ORXONOX_PLATFORM_APPLE
+ // Create persistent IO console
if (CommandLineParser::getValue("noIOConsole").getBool())
{
ModifyConfigValue(bStartIOConsole_, tset, false);
}
if (this->bStartIOConsole_)
this->ioConsole_.reset(new IOConsole());
+#endif
// creates the class hierarchy for all classes with factories
Identifier::createClassHierarchy();
Modified: code/branches/kicklib/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/core/CorePrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/CorePrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -53,10 +53,13 @@
# define _CoreExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _CorePrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _CoreExport __attribute__ ((visibility("default")))
+# define _CorePrivate __attribute__ ((visibility("hidden")))
#else
# define _CoreExport
+# define _CorePrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/libraries/core/DynLib.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/DynLib.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/DynLib.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -41,12 +41,12 @@
# include <windows.h>
#endif
-#ifdef ORXONOX_PLATFORM_LINUX
+#ifdef ORXONOX_PLATFORM_UNIX
# include <dlfcn.h>
#endif
#ifdef ORXONOX_PLATFORM_APPLE
-# include <macPlugins.h>
+# include <OSX/macUtils.h> // OGRE include
#endif
namespace orxonox
@@ -74,6 +74,15 @@
// dlopen() does not add .so to the filename, like windows does for .dll
if (name.substr(name.length() - 3, 3) != ".so")
name += ".so";
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+ // dlopen() does not add .dylib to the filename, like windows does for .dll
+ if (name.substr(name.length() - 6, 6) != ".dylib")
+ name += ".dylib";
+#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+ // Although LoadLibraryEx will add .dll itself when you only specify the library name,
+ // if you include a relative path then it does not. So, add it to be sure.
+ if (name.substr(name.length() - 4, 4) != ".dll")
+ name += ".dll";
#endif
m_hInst = (DYNLIB_HANDLE)DYNLIB_LOAD( name.c_str() );
@@ -126,13 +135,10 @@
// Free the buffer.
LocalFree( lpMsgBuf );
return ret;
-#elif defined(ORXONOX_PLATFORM_LINUX)
+#elif defined(ORXONOX_PLATFORM_UNIX)
return std::string(dlerror());
-#elif defined(ORXONOX_PLATFORM_APPLE)
- return std::string(mac_errorBundle());
#else
return "";
#endif
}
-
}
Modified: code/branches/kicklib/src/libraries/core/DynLib.h
===================================================================
--- code/branches/kicklib/src/libraries/core/DynLib.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/DynLib.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -51,17 +51,11 @@
struct HINSTANCE__;
typedef struct HINSTANCE__* hInstance;
-#elif defined(ORXONOX_PLATFORM_LINUX)
+#elif defined(ORXONOX_PLATFORM_UNIX)
# define DYNLIB_HANDLE void*
# define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
# define DYNLIB_GETSYM( a, b ) dlsym( a, b )
# define DYNLIB_UNLOAD( a ) dlclose( a )
-
-#elif defined(ORXONOX_PLATFORM_APPLE)
-# define DYNLIB_HANDLE CFBundleRef
-# define DYNLIB_LOAD( a ) mac_loadExeBundle( a )
-# define DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b )
-# define DYNLIB_UNLOAD( a ) mac_unloadExeBundle( a )
#endif
namespace orxonox
@@ -115,7 +109,6 @@
void* getSymbol( const std::string& strName ) const throw();
protected:
-
/// Handle to the loaded library.
DYNLIB_HANDLE m_hInst;
};
Modified: code/branches/kicklib/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/GUIManager.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -435,6 +435,7 @@
*/
void GUIManager::buttonPressed(MouseButtonCode::ByEnum id)
{
+ //guiSystem_->injectMouseButtonDown(convertButton(id));
this->protectedCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
}
Modified: code/branches/kicklib/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GraphicsManager.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/GraphicsManager.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -268,7 +268,16 @@
this->ogreWindowEventListener_->windowResized(renderWindow_);
Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, ogreWindowEventListener_.get());
-
+
+// HACK
+#ifdef ORXONOX_PLATFORM_APPLE
+ //INFO: This will give our window focus, and not lock it to the terminal
+ ProcessSerialNumber psn = {0, kCurrentProcess};
+ TransformProcessType(&psn, kProcessTransformToForegroundApplication);
+ SetFrontProcess(&psn);
+#endif
+// End of HACK
+
// create a full screen default viewport
// Note: This may throw when adding a viewport with an existing z-order!
// But in our case we only have one viewport for now anyway, therefore
Modified: code/branches/kicklib/src/libraries/core/Identifier.h
===================================================================
--- code/branches/kicklib/src/libraries/core/Identifier.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/Identifier.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -122,7 +122,7 @@
void setNetworkID(uint32_t id);
/// Returns the unique ID of the class.
- FORCEINLINE unsigned int getClassID() const { return this->classID_; }
+ ORX_FORCEINLINE unsigned int getClassID() const { return this->classID_; }
/// Returns the list of all existing objects of this class.
inline ObjectListBase* getObjects() const { return this->objects_; }
@@ -485,7 +485,7 @@
Also note that the function is implemented differently for GCC/MSVC.
*/
template <class T, class U>
- FORCEINLINE T orxonox_cast(U* source)
+ ORX_FORCEINLINE T orxonox_cast(U* source)
{
#ifdef ORXONOX_COMPILER_MSVC
typedef Loki::TypeTraits<typename Loki::TypeTraits<T>::PointeeType>::NonConstType ClassType;
Modified: code/branches/kicklib/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/branches/kicklib/src/libraries/core/OrxonoxClass.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/OrxonoxClass.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -134,7 +134,7 @@
@return
Returns NULL if the no pointer was found.
*/
- FORCEINLINE void* getDerivedPointer(unsigned int classID)
+ ORX_FORCEINLINE void* getDerivedPointer(unsigned int classID)
{
for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
{
@@ -145,10 +145,10 @@
}
/// Version of getDerivedPointer with template
- template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID)
+ template <class T> ORX_FORCEINLINE T* getDerivedPointer(unsigned int classID)
{ return static_cast<T*>(this->getDerivedPointer(classID)); }
/// Const version of getDerivedPointer with template
- template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
+ template <class T> ORX_FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
{ return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID); }
protected:
Modified: code/branches/kicklib/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/PathConfig.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/PathConfig.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -96,7 +96,7 @@
#elif defined(ORXONOX_PLATFORM_APPLE)
char buffer[1024];
- unsigned long path_len = 1023;
+ uint32_t path_len = 1023;
if (_NSGetExecutablePath(buffer, &path_len))
ThrowException(General, "Could not retrieve executable path.");
@@ -126,10 +126,8 @@
buffer[ret] = 0;
#endif
- executablePath_ = bf::path(buffer);
-#ifndef ORXONOX_PLATFORM_APPLE
- executablePath_ = executablePath_.branch_path(); // remove executable name
-#endif
+ // Remove executable filename
+ executablePath_ = bf::path(buffer).branch_path();
/////////////////////
// SET MODULE PATH //
@@ -207,11 +205,13 @@
dataPath_ = specialConfig::dataInstallDirectory;
// Get user directory
-# ifdef ORXONOX_PLATFORM_UNIX /* Apple? */
+#ifdef ORXONOX_PLATFORM_UNIX
char* userDataPathPtr(getenv("HOME"));
-# else
+#elif ORXONOX_PLATFORM_APPLE
+ char* userDataPathPtr(getenv("HOME"));
+#else
char* userDataPathPtr(getenv("APPDATA"));
-# endif
+#endif
if (userDataPathPtr == NULL)
ThrowException(General, "Could not retrieve user data path.");
bf::path userDataPath(userDataPathPtr);
Modified: code/branches/kicklib/src/libraries/core/Super.h
===================================================================
--- code/branches/kicklib/src/libraries/core/Super.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/Super.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -93,10 +93,10 @@
template <class T, int templatehack2> \
struct SuperFunctionCondition<functionnumber, T, 0, templatehack2> \
{ \
- static void check() \
+ static void superCheck() \
{ \
SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0)); \
- SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::check(); \
+ SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck(); \
} \
\
static void apply(void* temp) {} \
@@ -131,9 +131,9 @@
template <int templatehack2> \
struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
{ \
- static void check() \
+ static void superCheck() \
{ \
- SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::check(); \
+ SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
} \
};
@@ -149,14 +149,14 @@
template <class T, templatehack2>
struct SuperFunctionCondition<functionnumber, T, 0, templatehack2>
{
- static void check()
+ static void superCheck()
{
// This call to the apply-function is the whole check. By calling the function with
// a T* pointer, the right function get's called.
SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0));
- // Go go the check for of next super-function (functionnumber + 1)
- SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::check();
+ // Go go the superCheck for of next super-function (functionnumber + 1)
+ SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck();
}
// This function gets called if T is not a child of the baseclass.
@@ -201,10 +201,10 @@
template <int templatehack2> \
struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
{ \
- // The check function acts like the fallback - it advances to the check for the next super-function (functionnumber + 1)
- static void check() \
+ // The superCheck function acts like the fallback - it advances to the check for the next super-function (functionnumber + 1)
+ static void superCheck() \
{ \
- SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::check(); \
+ SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
} \
};
*/
@@ -302,7 +302,7 @@
template <int functionnumber, class T, int templatehack1, int templatehack2>
struct SuperFunctionCondition
{
- static void check() {}
+ static void superCheck() {}
};
/**
@@ -337,9 +337,9 @@
template <class T, int templatehack1, int templatehack2> \
struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2> \
{ \
- static void check() \
+ static void superCheck() \
{ \
- SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::check(); \
+ SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck(); \
} \
}; \
\
@@ -420,10 +420,10 @@
{
// If this function gets called, the header-file of the super function is not
// included, so this fallback template (templatehack not specialized) is used
- static void check()
+ static void superCheck()
{
// Calls the condition-check of the next super-function (functionnumber + 1)
- SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::check();
+ SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck();
}
};
@@ -573,7 +573,7 @@
// This get's called within the initialization of an Identifier
virtual void createSuperFunctionCaller() const
{
- SuperFunctionCondition<0, T, 0, 0>::check();
+ SuperFunctionCondition<0, T, 0, 0>::superCheck();
}
Modified: code/branches/kicklib/src/libraries/core/command/Functor.h
===================================================================
--- code/branches/kicklib/src/libraries/core/command/Functor.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/command/Functor.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -243,6 +243,7 @@
/// Constructor: Stores the object-pointer.
FunctorMember(O* object = 0) : object_(object), bSafeMode_(false) {}
virtual ~FunctorMember() { if (this->bSafeMode_) { this->unregisterObject(this->object_); } }
+ virtual ~FunctorMember() {}
/// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be NULL. @return Returns the return-value of the function (if any; MT_Type::Null otherwise)
virtual MultiType operator()(O* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
Modified: code/branches/kicklib/src/libraries/core/input/InputDevice.h
===================================================================
--- code/branches/kicklib/src/libraries/core/input/InputDevice.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/input/InputDevice.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -183,7 +183,7 @@
protected:
//! Common code for all button pressed events (updates pressed buttons list and calls the input states)
- FORCEINLINE void buttonPressed(ButtonTypeParam button)
+ ORX_FORCEINLINE void buttonPressed(ButtonTypeParam button)
{
// check whether the button already is in the list (can happen when focus was lost)
unsigned int iButton = 0;
@@ -200,7 +200,7 @@
}
//! Common code for all button released events (updates pressed buttons list and calls the input states)
- FORCEINLINE void buttonReleased(ButtonTypeParam button)
+ ORX_FORCEINLINE void buttonReleased(ButtonTypeParam button)
{
// remove the button from the pressedButtons_ list
bool found = false;
Modified: code/branches/kicklib/src/libraries/core/input/InputState.h
===================================================================
--- code/branches/kicklib/src/libraries/core/input/InputState.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/core/input/InputState.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -175,14 +175,14 @@
FunctorPtr leaveFunctor_; //!< Functor to be executed on leave
};
- FORCEINLINE void InputState::update(float dt)
+ ORX_FORCEINLINE void InputState::update(float dt)
{
for (unsigned int i = 0; i < handlers_.size(); ++i)
if (handlers_[i] != NULL)
INPUT_STATE_PUSH_CALL(i, allDevicesUpdated, dt);
}
- FORCEINLINE void InputState::update(float dt, unsigned int device)
+ ORX_FORCEINLINE void InputState::update(float dt, unsigned int device)
{
switch (device)
{
@@ -204,7 +204,7 @@
}
template <typename EventType, class ButtonTypeParam>
- FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)
+ ORX_FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)
{
assert(device < handlers_.size());
if (handlers_[device] != NULL)
@@ -215,19 +215,19 @@
}
}
- FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
+ ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
{
if (handlers_[mouseIndex_s] != NULL)
INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseMoved, abs, rel, clippingSize);
}
- FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
+ ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
{
if (handlers_[mouseIndex_s] != NULL)
INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseScrolled, abs, rel);
}
- FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
+ ORX_FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
{
assert(device < handlers_.size());
if (handlers_[device] != NULL)
Modified: code/branches/kicklib/src/libraries/network/LANDiscoverable.cc
===================================================================
--- code/branches/kicklib/src/libraries/network/LANDiscoverable.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/network/LANDiscoverable.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -28,13 +28,13 @@
#include "LANDiscoverable.h"
-#include "NetworkPrereqs.h"
-#include "packet/ServerInformation.h"
-
#include <enet/enet.h>
#include <cassert>
#include <cstring>
+#include "util/Debug.h"
+#include "packet/ServerInformation.h"
+
namespace orxonox
{
const char* LAN_DISCOVERY_MESSAGE = "Orxonox Client";
Modified: code/branches/kicklib/src/libraries/network/NetworkPrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/network/NetworkPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/network/NetworkPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -51,10 +51,13 @@
# define _NetworkExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _NetworkPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _NetworkExport __attribute__ ((visibility("default")))
+# define _NetworkPrivate __attribute__ ((visibility("hidden")))
#else
# define _NetworkExport
+# define _NetworkPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/libraries/tools/BulletConversions.h
===================================================================
--- code/branches/kicklib/src/libraries/tools/BulletConversions.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/tools/BulletConversions.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -42,7 +42,7 @@
template <>
struct ConverterExplicit<orxonox::Vector3, btVector3>
{
- FORCEINLINE static bool convert(btVector3* output, const orxonox::Vector3& input)
+ ORX_FORCEINLINE static bool convert(btVector3* output, const orxonox::Vector3& input)
{
output->setX(input.x);
output->setY(input.y);
@@ -55,7 +55,7 @@
template <>
struct ConverterExplicit<btVector3, orxonox::Vector3>
{
- FORCEINLINE static bool convert(orxonox::Vector3* output, const btVector3& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Vector3* output, const btVector3& input)
{
output->x = input.x();
output->y = input.y();
@@ -68,7 +68,7 @@
template <>
struct ConverterExplicit<orxonox::Quaternion, btQuaternion>
{
- FORCEINLINE static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
+ ORX_FORCEINLINE static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
{
output->setW(input.w);
output->setX(input.x);
@@ -82,7 +82,7 @@
template <>
struct ConverterExplicit<btQuaternion, orxonox::Quaternion>
{
- FORCEINLINE static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
{
output->w = input.w();
output->x = input.x();
Modified: code/branches/kicklib/src/libraries/tools/ToolsPrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/tools/ToolsPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/tools/ToolsPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -51,10 +51,13 @@
# define _ToolsExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _ToolsPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _ToolsExport __attribute__ ((visibility("default")))
+# define _ToolsPrivate __attribute__ ((visibility("hidden")))
#else
# define _ToolsExport
+# define _ToolsPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/libraries/util/Convert.h
===================================================================
--- code/branches/kicklib/src/libraries/util/Convert.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/util/Convert.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -142,7 +142,7 @@
template <class FromType, class ToType>
struct ConverterFallback
{
- FORCEINLINE static bool convert(ToType* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
{
COUT(2) << "Could not convert value of type " << typeid(FromType).name()
<< " to type " << typeid(ToType).name() << std::endl;
@@ -154,7 +154,7 @@
template <class FromType, class ToType>
struct ConverterFallback<FromType*, ToType*>
{
- FORCEINLINE static bool convert(ToType** output, FromType* const input)
+ ORX_FORCEINLINE static bool convert(ToType** output, FromType* const input)
{
ToType* temp = dynamic_cast<ToType*>(input);
if (temp)
@@ -181,7 +181,7 @@
template <class FromType, class ToType>
struct ConverterStringStream
{
- FORCEINLINE static bool convert(ToType* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
{
return orxonox::ConverterFallback<FromType, ToType>::convert(output, input);
}
@@ -197,7 +197,7 @@
{
/// Fallback operator <<() (delegates to orxonox::ConverterFallback)
template <class FromType>
- FORCEINLINE bool operator <<(std::ostream& outstream, const FromType& input)
+ ORX_FORCEINLINE bool operator <<(std::ostream& outstream, const FromType& input)
{
std::string temp;
if (orxonox::ConverterFallback<FromType, std::string>::convert(&temp, input))
@@ -214,7 +214,7 @@
template <class FromType>
struct ConverterStringStream<FromType, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const FromType& input)
{
using namespace fallbackTemplates;
// this operator call only chooses fallbackTemplates::operator<<()
@@ -240,7 +240,7 @@
{
/// Fallback operator >>() (delegates to orxonox::ConverterFallback)
template <class ToType>
- FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
+ ORX_FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
{
std::string input(static_cast<std::istringstream&>(instream).str());
return orxonox::ConverterFallback<std::string, ToType>::convert(&output, input);
@@ -251,7 +251,7 @@
template <class ToType>
struct ConverterStringStream<std::string, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const std::string& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const std::string& input)
{
using namespace fallbackTemplates;
// this operator call chooses fallbackTemplates::operator>>()
@@ -275,14 +275,14 @@
/// %Template delegates to ::ConverterStringStream
template <class FromType, class ToType>
- FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>)
+ ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>)
{
return ConverterStringStream<FromType, ToType>::convert(output, input);
}
/// Makes an implicit cast from \a FromType to \a ToType
template <class FromType, class ToType>
- FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>)
+ ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>)
{
(*output) = static_cast<ToType>(input);
return true;
@@ -302,7 +302,7 @@
struct ConverterExplicit
{
enum { probe = ImplicitConversion<FromType, ToType>::exists };
- FORCEINLINE static bool convert(ToType* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
{
// Use the probe's value to delegate to the right function
return convertImplicitely(output, input, Loki::Int2Type<probe>());
@@ -326,7 +326,7 @@
The original value
*/
template <class FromType, class ToType>
- FORCEINLINE bool convertValue(ToType* output, const FromType& input)
+ ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input)
{
return ConverterExplicit<FromType, ToType>::convert(output, input);
}
@@ -347,7 +347,7 @@
A default value that gets written to '*output' if there is no conversion.
*/
template<class FromType, class ToType>
- FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
+ ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
{
if (convertValue(output, input))
return true;
@@ -360,7 +360,7 @@
/// Directly returns the converted value, but uses the fallback on failure. @see convertValue
template<class FromType, class ToType>
- FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
+ ORX_FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
{
ToType output;
convertValue(&output, input, fallback);
@@ -379,7 +379,7 @@
The original value
*/
template<class ToType, class FromType>
- FORCEINLINE ToType multi_cast(const FromType& input)
+ ORX_FORCEINLINE ToType multi_cast(const FromType& input)
{
ToType output;
convertValue(&output, input);
@@ -394,7 +394,7 @@
template <class ToType>
struct ConverterExplicit<const char*, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const char* input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const char* input)
{
return convertValue<std::string, ToType>(output, input);
}
@@ -404,7 +404,7 @@
template <>
struct ConverterExplicit<char, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const char input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const char input)
{
*output = input;
return true;
@@ -414,7 +414,7 @@
template <>
struct ConverterExplicit<unsigned char, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const unsigned char input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const unsigned char input)
{
*output = input;
return true;
@@ -424,7 +424,7 @@
template <>
struct ConverterExplicit<std::string, char>
{
- FORCEINLINE static bool convert(char* output, const std::string& input)
+ ORX_FORCEINLINE static bool convert(char* output, const std::string& input)
{
if (!input.empty())
*output = input[0];
@@ -437,7 +437,7 @@
template <>
struct ConverterExplicit<std::string, unsigned char>
{
- FORCEINLINE static bool convert(unsigned char* output, const std::string& input)
+ ORX_FORCEINLINE static bool convert(unsigned char* output, const std::string& input)
{
if (!input.empty())
*output = input[0];
@@ -452,7 +452,7 @@
template <>
struct ConverterExplicit<bool, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const bool& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const bool& input)
{
if (input)
*output = "true";
Modified: code/branches/kicklib/src/libraries/util/MathConvert.h
===================================================================
--- code/branches/kicklib/src/libraries/util/MathConvert.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/util/MathConvert.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -50,7 +50,7 @@
template <>
struct ConverterExplicit<orxonox::Vector2, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
{
std::ostringstream ostream;
if (ostream << input.x << ',' << input.y)
@@ -66,7 +66,7 @@
template <>
struct ConverterExplicit<orxonox::Vector3, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
{
std::ostringstream ostream;
if (ostream << input.x << ',' << input.y << ',' << input.z)
@@ -82,7 +82,7 @@
template <>
struct ConverterExplicit<orxonox::Vector4, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
{
std::ostringstream ostream;
if (ostream << input.x << ',' << input.y << ',' << input.z << ',' << input.w)
@@ -98,7 +98,7 @@
template <>
struct ConverterExplicit<orxonox::Quaternion, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
{
std::ostringstream ostream;
if (ostream << input.w << ',' << input.x << ',' << input.y << ',' << input.z)
@@ -114,7 +114,7 @@
template <>
struct ConverterExplicit<orxonox::ColourValue, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
{
std::ostringstream ostream;
if (ostream << input.r << ',' << input.g << ',' << input.b << ',' << input.a)
@@ -156,7 +156,7 @@
template <class ToType>
struct ConverterFallback<orxonox::Radian, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
{
return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
}
@@ -166,7 +166,7 @@
template <class ToType>
struct ConverterFallback<orxonox::Degree, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
{
return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
}
@@ -176,7 +176,7 @@
template <class FromType>
struct ConverterFallback<FromType, orxonox::Radian>
{
- FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
{
float temp;
if (convertValue(&temp, input))
@@ -193,7 +193,7 @@
template <class FromType>
struct ConverterFallback<FromType, orxonox::Degree>
{
- FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
{
float temp;
if (convertValue(&temp, input))
Modified: code/branches/kicklib/src/libraries/util/SharedPtr.h
===================================================================
--- code/branches/kicklib/src/libraries/util/SharedPtr.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/util/SharedPtr.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -162,6 +162,7 @@
{
public:
SharedCounter() : count_(1) {}
+ virtual ~SharedCounter() {}
virtual void destroy() = 0;
int count_;
@@ -185,7 +186,7 @@
_UtilExport SmallObjectAllocator& createSharedCounterPool();
- FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
+ ORX_FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
{
static SmallObjectAllocator& instance = createSharedCounterPool();
return instance;
Modified: code/branches/kicklib/src/libraries/util/SignalHandler.h
===================================================================
--- code/branches/kicklib/src/libraries/util/SignalHandler.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/util/SignalHandler.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -69,7 +69,7 @@
typedef std::list<SignalCallbackRec> SignalCallbackList;
/// The SignalHandler is used to catch signals like SIGSEGV and write a backtrace to the logfile.
- class SignalHandler : public Singleton<SignalHandler>
+ class _UtilExport SignalHandler : public Singleton<SignalHandler>
{
friend class Singleton<SignalHandler>;
Modified: code/branches/kicklib/src/libraries/util/UtilPrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/util/UtilPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/libraries/util/UtilPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -51,10 +51,13 @@
# define _UtilExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _UtilPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _UtilExport __attribute__ ((visibility("default")))
+# define _UtilPrivate __attribute__ ((visibility("hidden")))
#else
# define _UtilExport
+# define _UtilPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/designtools/DesignToolsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/designtools/DesignToolsPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/designtools/DesignToolsPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _DesignToolsExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _DesignToolsPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _DesignToolsExport __attribute__ ((visibility("default")))
+# define _DesignToolsPrivate __attribute__ ((visibility("hidden")))
#else
# define _DesignToolsExport
+# define _DesignToolsPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/notifications/NotificationsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/notifications/NotificationsPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/notifications/NotificationsPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _NotificationsExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _NotificationsPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _NotificationsExport __attribute__ ((visibility("default")))
+# define _NotificationsPrivate __attribute__ ((visibility("hidden")))
#else
# define _NotificationsExport
+# define _NotificationsPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/objects/ObjectsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/objects/ObjectsPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/objects/ObjectsPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _ObjectsExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _ObjectsPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _ObjectsExport __attribute__ ((visibility("default")))
+# define _ObjectsPrivate __attribute__ ((visibility("hidden")))
#else
# define _ObjectsExport
+# define _ObjectsPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/overlays/OverlaysPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/overlays/OverlaysPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _OverlaysExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _OverlaysPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _OverlaysExport __attribute__ ((visibility("default")))
+# define _OverlaysPrivate __attribute__ ((visibility("hidden")))
#else
# define _OverlaysExport
+# define _OverlaysPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/pickup/PickupPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/pickup/PickupPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _PickupExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _PickupPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _PickupExport __attribute__ ((visibility("default")))
+# define _PickupPrivate __attribute__ ((visibility("hidden")))
#else
# define _PickupExport
+# define _PickupPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/pong/PongPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/pong/PongPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/pong/PongPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _PongExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _PongPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _PongExport __attribute__ ((visibility("default")))
+# define _PongPrivate __attribute__ ((visibility("hidden")))
#else
# define _PongExport
+# define _PongPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/questsystem/QuestEffect.cc
===================================================================
--- code/branches/kicklib/src/modules/questsystem/QuestEffect.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/questsystem/QuestEffect.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -67,14 +67,14 @@
*/
/*static*/ bool QuestEffect::invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects)
{
- bool check = true;
+ bool temp = true;
COUT(4) << "Invoking QuestEffects on player: " << player << " ." << std::endl;
for (std::list<QuestEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
- check = check && (*effect)->invoke(player);
+ temp = temp && (*effect)->invoke(player);
- return check;
+ return temp;
}
}
Modified: code/branches/kicklib/src/modules/questsystem/QuestEffectBeacon.cc
===================================================================
--- code/branches/kicklib/src/modules/questsystem/QuestEffectBeacon.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/questsystem/QuestEffectBeacon.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -142,8 +142,8 @@
COUT(4) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;
- bool check = QuestEffect::invokeEffects(player, this->effects_); // Invoke the QuestEffects on the PlayerInfo.
- if(check)
+ bool temp = QuestEffect::invokeEffects(player, this->effects_); // Invoke the QuestEffects on the PlayerInfo.
+ if(temp)
{
this->decrementTimes(); // Decrement the number of times the beacon can be used.
return true;
Modified: code/branches/kicklib/src/modules/questsystem/QuestsystemPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/questsystem/QuestsystemPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/questsystem/QuestsystemPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _QuestsystemExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _QuestsystemPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _QuestsystemExport __attribute__ ((visibility("default")))
+# define _QuestsystemPrivate __attribute__ ((visibility("hidden")))
#else
# define _QuestsystemExport
+# define _QuestsystemPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/modules/questsystem/effects/AddReward.cc
===================================================================
--- code/branches/kicklib/src/modules/questsystem/effects/AddReward.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/questsystem/effects/AddReward.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -104,13 +104,13 @@
{
COUT(5) << "AddReward on player: " << player << " ." << std::endl;
- bool check = true;
+ bool temp = true;
for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
- check = check && (*reward)->reward(player);
+ temp = temp && (*reward)->reward(player);
COUT(4) << "Rewardable successfully added to player." << player << " ." << std::endl;
- return check;
+ return temp;
}
}
Modified: code/branches/kicklib/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/weapons/WeaponsPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/modules/weapons/WeaponsPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _WeaponsExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _WeaponsPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _WeaponsExport __attribute__ ((visibility("default")))
+# define _WeaponsPrivate __attribute__ ((visibility("hidden")))
#else
# define _WeaponsExport
+# define _WeaponsPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/orxonox/MoodManager.cc
===================================================================
--- code/branches/kicklib/src/orxonox/MoodManager.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/MoodManager.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -49,12 +49,15 @@
oldMood_ = MoodManager::defaultMood_;
// Checking for the existence of the folder for the default mood
- const std::string& path = "ambient/" + MoodManager::defaultMood_ + "/.";
- if (!Resource::exists(path))
+ const std::string& patha = "ambient/" + MoodManager::defaultMood_ + "/.";
+ if (!Resource::exists(patha))
{
// TODO: Non-fatal error handling (non-critical resource missing)
COUT(2) << "Mood Warning: Folder for default mood (" << MoodManager::defaultMood_ << ") does not exist!" << std::endl;
}
+
+ // @TODO
+ // Creating a vector of the available moods to enable easy mood selection by Lua/CEGUI
}
void MoodManager::setConfigValues()
Modified: code/branches/kicklib/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/kicklib/src/orxonox/OrxonoxPrereqs.h 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/OrxonoxPrereqs.h 2011-03-14 02:53:38 UTC (rev 8071)
@@ -52,10 +52,13 @@
# define _OrxonoxExport __declspec(dllimport)
# endif
# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _OrxonoxPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
# define _OrxonoxExport __attribute__ ((visibility("default")))
+# define _OrxonoxPrivate __attribute__ ((visibility("hidden")))
#else
# define _OrxonoxExport
+# define _OrxonoxPrivate
#endif
//-----------------------------------------------------------------------
Modified: code/branches/kicklib/src/orxonox/sound/AmbientSound.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/AmbientSound.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/sound/AmbientSound.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -41,7 +41,7 @@
RegisterObject(AmbientSound);
// Ambient sounds always fade in
- this->setVolume(0);
+ this->setVolume(0.0f);
}
void AmbientSound::preDestroy()
Modified: code/branches/kicklib/src/orxonox/sound/BaseSound.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/BaseSound.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/sound/BaseSound.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -30,7 +30,12 @@
#include <cassert>
#include <vector>
+
+#ifdef ORXONOX_PLATFORM_APPLE
+#include "openal/al.h"
+#else
#include <al.h>
+#endif
#include "util/Math.h"
#include "core/CoreIncludes.h"
Modified: code/branches/kicklib/src/orxonox/sound/SoundBuffer.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/SoundBuffer.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/sound/SoundBuffer.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -29,7 +29,11 @@
#include "SoundBuffer.h"
+#if defined(ORXONOX_PLATFORM_APPLE)
+#include <ALUT/alut.h>
+#else
#include <AL/alut.h>
+#endif
#include <vorbis/vorbisfile.h>
#include "util/Exception.h"
Modified: code/branches/kicklib/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/SoundManager.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/sound/SoundManager.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -30,7 +30,11 @@
#include "SoundManager.h"
+#if defined(__APPLE__)
+#include <ALUT/alut.h>
+#else
#include <AL/alut.h>
+#endif
#include <utility>
#include <loki/ScopeGuard.h>
@@ -72,12 +76,15 @@
this->bDestructorCalled_ = false;
+ // Clear error messages (might be problematic on some systems)
+ alGetError();
+ alutGetError();
+
// See whether we even want to load
bool bDisableSound_ = false;
SetConfigValue(bDisableSound_, false);
if (bDisableSound_)
- ThrowException(InitialisationAborted, "Sound: Not loading at all");
-
+ ThrowException(InitialisationAborted, "Sound: Not loading at all");
if (!alutInitWithoutContext(NULL, NULL))
ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit);
@@ -125,10 +132,10 @@
GameMode::setPlaysSound(true);
Loki::ScopeGuard resetPlaysSoundGuard = Loki::MakeGuard(&GameMode::setPlaysSound, false);
-
+
// Get some information about the sound
if (const char* version = alGetString(AL_VERSION))
- COUT(4) << "Sound: --- OpenAL Version: " << version << std::endl;
+ COUT(4) << "Sound: --- OpenAL Version: " << version << std::endl;
if (const char* vendor = alGetString(AL_VENDOR))
COUT(4) << "Sound: --- OpenAL Vendor : " << vendor << std::endl;
if (const char* types = alutGetMIMETypes(ALUT_LOADER_BUFFER))
Modified: code/branches/kicklib/src/orxonox/sound/SoundStreamer.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/SoundStreamer.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/sound/SoundStreamer.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -26,7 +26,12 @@
*/
#include "SoundStreamer.h"
+#ifdef ORXONOX_PLATFORM_APPLE
+#include "openal/al.h"
+#else
#include <al.h>
+#endif
+
#include <vorbis/vorbisfile.h>
#include "SoundManager.h"
Modified: code/branches/kicklib/src/orxonox/sound/WorldSound.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/WorldSound.cc 2011-03-13 22:30:29 UTC (rev 8070)
+++ code/branches/kicklib/src/orxonox/sound/WorldSound.cc 2011-03-14 02:53:38 UTC (rev 8071)
@@ -29,7 +29,11 @@
#include "WorldSound.h"
+#if defined(__APPLE__)
+#include <ALUT/alut.h>
+#else
#include <AL/alut.h>
+#endif
#include "util/Math.h"
#include "core/CoreIncludes.h"
#include "core/EventIncludes.h"
More information about the Orxonox-commit
mailing list