Index: code/branches/kicklib/CMakeLists.txt
===================================================================
--- code/branches/kicklib/CMakeLists.txt	(revision 8068)
+++ code/branches/kicklib/CMakeLists.txt	(revision 8071)
@@ -101,11 +101,28 @@
 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
Index: code/branches/kicklib/cmake/CompilerConfigGCC.cmake
===================================================================
--- code/branches/kicklib/cmake/CompilerConfigGCC.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/CompilerConfigGCC.cmake	(revision 8071)
@@ -26,4 +26,5 @@
 INCLUDE(FlagUtilities)
 INCLUDE(CompareVersionStrings)
+INCLUDE(CheckCXXCompilerFlag)
 
 # Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC
@@ -36,12 +37,4 @@
   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
@@ -72,6 +65,26 @@
 
 # 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()
 
Index: code/branches/kicklib/cmake/CompilerConfigMSVC.cmake
===================================================================
--- code/branches/kicklib/cmake/CompilerConfigMSVC.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/CompilerConfigMSVC.cmake	(revision 8071)
@@ -60,8 +60,12 @@
 
 # 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)
Index: code/branches/kicklib/cmake/LibraryConfig.cmake
===================================================================
--- code/branches/kicklib/cmake/LibraryConfig.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/LibraryConfig.cmake	(revision 8071)
@@ -40,13 +40,13 @@
 # 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)
@@ -75,7 +75,11 @@
                    "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)
@@ -152,4 +156,13 @@
 # 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()
 
 
Index: code/branches/kicklib/cmake/LibraryConfigApple.cmake
===================================================================
--- code/branches/kicklib/cmake/LibraryConfigApple.cmake	(revision 8068)
+++ 	(revision )
@@ -1,43 +1,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)
Index: code/branches/kicklib/cmake/LibraryConfigOSX.cmake
===================================================================
--- code/branches/kicklib/cmake/LibraryConfigOSX.cmake	(revision 8071)
+++ code/branches/kicklib/cmake/LibraryConfigOSX.cmake	(revision 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)
Index: code/branches/kicklib/cmake/PackageConfig.cmake
===================================================================
--- code/branches/kicklib/cmake/PackageConfig.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/PackageConfig.cmake	(revision 8071)
@@ -24,49 +24,4 @@
  #    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)
Index: code/branches/kicklib/cmake/PackageConfigMSVC.cmake
===================================================================
--- code/branches/kicklib/cmake/PackageConfigMSVC.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/PackageConfigMSVC.cmake	(revision 8071)
@@ -27,4 +27,7 @@
 
 IF(MSVC)
+
+  INCLUDE(CheckPackageVersion)
+  CHECK_PACKAGE_VERSION(4.3 6.0)
 
   # 64 bit system?
Index: code/branches/kicklib/cmake/PackageConfigMinGW.cmake
===================================================================
--- code/branches/kicklib/cmake/PackageConfigMinGW.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/PackageConfigMinGW.cmake	(revision 8071)
@@ -28,4 +28,7 @@
 IF(MINGW)
 
+  INCLUDE(CheckPackageVersion)
+  CHECK_PACKAGE_VERSION(6.0)
+
   # 64 bit system?
   IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
Index: code/branches/kicklib/cmake/PackageConfigOSX.cmake
===================================================================
--- code/branches/kicklib/cmake/PackageConfigOSX.cmake	(revision 8071)
+++ code/branches/kicklib/cmake/PackageConfigOSX.cmake	(revision 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()
Index: code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake	(revision 8071)
@@ -53,10 +53,10 @@
       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.
Index: code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake	(revision 8071)
+++ code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake	(revision 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)
Index: code/branches/kicklib/cmake/tools/FindALUT.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/FindALUT.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/FindALUT.cmake	(revision 8071)
@@ -1,72 +1,44 @@
-# - 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
 )
 
@@ -75,6 +47,6 @@
 
 MARK_AS_ADVANCED(
-    ALUT_INCLUDE_DIR
-    ALUT_LIBRARY_OPTIMIZED
-    ALUT_LIBRARY_DEBUG
+  ALUT_INCLUDE_DIR
+  ALUT_LIBRARY_OPTIMIZED
+  ALUT_LIBRARY_DEBUG
 )
Index: code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake	(revision 8071)
@@ -32,4 +32,14 @@
  #    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)
Index: code/branches/kicklib/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/TargetUtilities.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/TargetUtilities.cmake	(revision 8071)
@@ -169,4 +169,11 @@
     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()
 
Index: code/branches/kicklib/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/branches/kicklib/data/gui/scripts/AudioMenu.lua	(revision 8068)
+++ code/branches/kicklib/data/gui/scripts/AudioMenu.lua	(revision 8071)
@@ -32,4 +32,6 @@
     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)
@@ -39,4 +41,8 @@
     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)
@@ -168,4 +174,8 @@
     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")
Index: code/branches/kicklib/src/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/CMakeLists.txt	(revision 8068)
+++ code/branches/kicklib/src/CMakeLists.txt	(revision 8071)
@@ -69,4 +69,14 @@
 # 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}
@@ -84,14 +94,4 @@
   ${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}
 )
 
Index: code/branches/kicklib/src/OrxonoxConfig.cmake
===================================================================
--- code/branches/kicklib/src/OrxonoxConfig.cmake	(revision 8068)
+++ code/branches/kicklib/src/OrxonoxConfig.cmake	(revision 8071)
@@ -32,5 +32,6 @@
 
 # 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()
@@ -53,11 +54,4 @@
 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})
@@ -74,4 +68,11 @@
   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)
Index: code/branches/kicklib/src/OrxonoxConfig.h.in
===================================================================
--- code/branches/kicklib/src/OrxonoxConfig.h.in	(revision 8068)
+++ code/branches/kicklib/src/OrxonoxConfig.h.in	(revision 8071)
@@ -80,14 +80,17 @@
 
 // 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
@@ -158,6 +161,8 @@
 #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)
Index: code/branches/kicklib/src/SpecialConfig.h.in
===================================================================
--- code/branches/kicklib/src/SpecialConfig.h.in	(revision 8068)
+++ code/branches/kicklib/src/SpecialConfig.h.in	(revision 8071)
@@ -92,8 +92,14 @@
 
     // 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@";
@@ -102,5 +108,9 @@
     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@";
Index: code/branches/kicklib/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
===================================================================
--- code/branches/kicklib/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp	(revision 8071)
@@ -38,4 +38,10 @@
 int gNumGjkChecks = 0;
 
+#ifdef check
+struct CompilerError
+{
+    void CompilerError() {}
+};
+#endif
 
 btGjkPairDetector::btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver)
Index: code/branches/kicklib/src/external/ogreceguirenderer/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/external/ogreceguirenderer/CMakeLists.txt	(revision 8068)
+++ code/branches/kicklib/src/external/ogreceguirenderer/CMakeLists.txt	(revision 8071)
@@ -34,7 +34,8 @@
   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}
Index: code/branches/kicklib/src/external/ois/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/external/ois/CMakeLists.txt	(revision 8068)
+++ code/branches/kicklib/src/external/ois/CMakeLists.txt	(revision 8071)
@@ -31,8 +31,9 @@
   OISKeyboard.h
   OISMouse.h
+  OISMultiTouch.h
   OISObject.h
   OISPrereqs.h
 
-COMPILATION_BEGIN OISCompilation.cpp
+  #COMPILATION_BEGIN OISCompilation.cpp
   OISEffect.cpp
   OISException.cpp
@@ -42,5 +43,5 @@
   OISKeyboard.cpp
   OISObject.cpp
-COMPILATION_END
+  #COMPILATION_END
 )
 IF(WIN32)
@@ -51,6 +52,4 @@
   ADD_SUBDIRECTORY(linux)
 ENDIF()
-
-INCLUDE_DIRECTORIES(.)
 
 ORXONOX_ADD_LIBRARY(ois_orxonox
@@ -66,3 +65,5 @@
 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()
Index: code/branches/kicklib/src/external/ois/OIS.h
===================================================================
--- code/branches/kicklib/src/external/ois/OIS.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/OIS.h	(revision 8071)
@@ -29,4 +29,5 @@
 #include "OISKeyboard.h"
 #include "OISJoyStick.h"
+#include "OISMultiTouch.h"
 #include "OISInputManager.h"
 #include "OISFactoryCreator.h"
Index: code/branches/kicklib/src/external/ois/OISConfig.h
===================================================================
--- code/branches/kicklib/src/external/ois/OISConfig.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/OISConfig.h	(revision 8071)
@@ -70,6 +70,4 @@
 @remarks
 	Build in support for Win32 XInput (Xbox 360 Controller)
-@notes
-	Not Yet Implemented
 */
 //#define OIS_WIN32_XINPUT_SUPPORT
Index: code/branches/kicklib/src/external/ois/OISInputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/OISInputManager.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/OISInputManager.cpp	(revision 8071)
@@ -37,4 +37,6 @@
 #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"
@@ -59,4 +61,6 @@
 	m_wiiMoteSupport(0)
 {
+    mFactories.clear();
+    mFactoryObjects.clear();
 }
 
@@ -111,4 +115,6 @@
 #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!");
Index: code/branches/kicklib/src/external/ois/OISKeyboard.h
===================================================================
--- code/branches/kicklib/src/external/ois/OISKeyboard.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/OISKeyboard.h	(revision 8071)
@@ -184,5 +184,5 @@
 	{
 	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() {}
 
@@ -201,6 +201,6 @@
 	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;		
 	};
 
@@ -220,5 +220,5 @@
 			A KeyCode to check
 		*/
-		virtual bool isKeyDown( KeyCode key ) const = 0;
+		virtual bool isKeyDown(KeyCode key) const = 0;
 
 		/**
@@ -229,5 +229,5 @@
 			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;}
 
 		/**
@@ -254,5 +254,5 @@
 			Off, Unicode, Ascii
 		*/
-		virtual void setTextTranslation( TextTranslationMode mode );
+		virtual void setTextTranslation(TextTranslationMode mode);
 
 		/**
@@ -272,5 +272,5 @@
 			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
@@ -286,5 +286,5 @@
 			Check modifier status
 		*/
-		bool isModifierDown( Modifier mod ) const;
+		bool isModifierDown(Modifier mod) const;
 
 		/**
@@ -293,5 +293,5 @@
 			(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:
Index: code/branches/kicklib/src/external/ois/OISMultiTouch.h
===================================================================
--- code/branches/kicklib/src/external/ois/OISMultiTouch.h	(revision 8071)
+++ code/branches/kicklib/src/external/ois/OISMultiTouch.h	(revision 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
Index: code/branches/kicklib/src/external/ois/OISPrereqs.h
===================================================================
--- code/branches/kicklib/src/external/ois/OISPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/OISPrereqs.h	(revision 8071)
@@ -79,7 +79,13 @@
 #	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
@@ -95,7 +101,7 @@
 //-------------- 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)
@@ -110,6 +116,8 @@
 	class Mouse;
 	class JoyStick;
+    class MultiTouch;
 	class KeyListener;
 	class MouseListener;
+    class MultiTouchListener;
 	class JoyStickListener;
 	class Interface;
@@ -130,9 +138,10 @@
     enum Type
 	{
-		OISUnknown   = 0,
-		OISKeyboard  = 1,
-		OISMouse     = 2,
-		OISJoyStick  = 3,
-		OISTablet    = 4
+		OISUnknown       = 0,
+		OISKeyboard      = 1,
+		OISMouse         = 2,
+		OISJoyStick      = 3,
+		OISTablet        = 4,
+		OISMultiTouch    = 5
 	};
 
Index: code/branches/kicklib/src/external/ois/ReadMe.txt
===================================================================
--- code/branches/kicklib/src/external/ois/ReadMe.txt	(revision 8068)
+++ code/branches/kicklib/src/external/ois/ReadMe.txt	(revision 8071)
@@ -5,5 +5,5 @@
 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 
@@ -46,19 +46,14 @@
 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:
@@ -69,7 +64,5 @@
 	---- 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/
@@ -80,8 +73,4 @@
 
 Mac/
-	
-	XCode-1.5/
-		Non-complete native OIS port.
-
 	XCode-2.2/
-		Working, complete, OIS port to OSX using SDL as a backend.
+		Working, mostly complete OSX vackend.
Index: code/branches/kicklib/src/external/ois/VERSION
===================================================================
--- code/branches/kicklib/src/external/ois/VERSION	(revision 8068)
+++ code/branches/kicklib/src/external/ois/VERSION	(revision 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/
Index: code/branches/kicklib/src/external/ois/changes_orxonox.diff
===================================================================
--- code/branches/kicklib/src/external/ois/changes_orxonox.diff	(revision 8068)
+++ code/branches/kicklib/src/external/ois/changes_orxonox.diff	(revision 8071)
@@ -10,4 +10,6 @@
  			//Ignorable Dll interface warning...
  #           if !defined(OIS_MINGW_COMPILER)
+
+
 --- linux/EventHelpers.cpp	(revision 5668)
 +++ linux/EventHelpers.cpp	(working copy)
@@ -37,5 +39,5 @@
 +++ win32/Win32ForceFeedback.cpp
 @@ -25,7 +25,7 @@
- #include <Math.h>
+ #include <math.h>
  
  // 0 = No trace; 1 = Important traces; 2 = Debug traces
@@ -45,2 +47,22 @@
  #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;
Index: code/branches/kicklib/src/external/ois/linux/LinuxInputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxInputManager.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/linux/LinuxInputManager.cpp	(revision 8071)
@@ -40,5 +40,4 @@
 	hideMouse = true;
 	mGrabs = true;
-	useXRepeat = false;
 	keyboardUsed = mouseUsed = false;
 
@@ -74,9 +73,4 @@
 
 	//--------- 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() )
@@ -172,5 +166,5 @@
 	{
 		if( keyboardUsed == false )
-			obj = new LinuxKeyboard(this, bufferMode, grabKeyboard, useXRepeat);
+			obj = new LinuxKeyboard(this, bufferMode, grabKeyboard);
 		break;
 	}
Index: code/branches/kicklib/src/external/ois/linux/LinuxInputManager.h
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxInputManager.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/linux/LinuxInputManager.h	(revision 8071)
@@ -101,7 +101,4 @@
 		bool mGrabs;
 		bool hideMouse;
-
-		//! By default, keyboard disables XRepeatRate
-		bool useXRepeat;
 	};
 }
Index: code/branches/kicklib/src/external/ois/linux/LinuxJoyStickEvents.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxJoyStickEvents.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/linux/LinuxJoyStickEvents.cpp	(revision 8071)
@@ -96,104 +96,107 @@
 	//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)
+		int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
+        if( ret < 0 )
+			break;
+
+		//Determine how many whole events re read up
+		ret /= sizeof(struct input_event);
+		for(int i = 0; i < ret; ++i)
 		{
-		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;
-			}
-			break;
-		}
-
-		case EV_ABS:  //Absolute Axis
-		{
-			//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!" );
-
-				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;
+			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
-				{	//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;
 				}
-			}
-			else if( js[i].code <= ABS_HAT3Y ) //A POV - Max four POVs allowed
-			{
-				//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)
+				break;
+			}
+
+			case EV_ABS:  //Absolute Axis
+			{
+				//A Stick (BrakeDefine is the highest possible Axis)
+				if( js[i].code <= ABS_BRAKE )
 				{
-					//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;
+					int axis = mAxisMap[js[i].code];
+					assert( axis < 32 && "Too many axes (Max supported is 32). Report this to OIS forums!" );
+
+					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;
 				}
-
-				if( mBuffered && mListener )
-					if( mListener->povMoved( JoyStickEvent(this,mState), OIS_POVIndex) == false )
-						return;
-			}
-			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;
+				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;
+			}
 		}
 	}
Index: code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.cpp	(revision 8071)
@@ -33,5 +33,5 @@
 #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)
 {
@@ -43,7 +43,4 @@
 	grabKeyboard = grab;
 	keyFocusLost = false;
-
-	xAutoRepeat = useXRepeat;
-	oldXAutoRepeat = false;
 
 	//X Key Map to KeyCode
@@ -213,18 +210,4 @@
 
 	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 );
-	}
 }
 
@@ -234,7 +217,4 @@
 	if( display )
 	{
-		if( oldXAutoRepeat )
-			XAutoRepeatOn(display);
-
 		if( grabKeyboard )
 			XUngrabKeyboard(display, CurrentTime);
@@ -303,9 +283,10 @@
 
 	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};
@@ -332,13 +313,17 @@
 			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;
-
-			//Else, it is a valid key release
-			XLookupString(&event.xkey,NULL,0,&key,NULL);
-			_injectKeyUp(key); 		}
+			if(!_isKeyRepeat(event))
+			{
+				//Mask out the modifier states X sets.. or we will get improper values
+				event.xkey.state &= ~ShiftMask;
+				event.xkey.state &= ~LockMask;
+
+				XLookupString(&event.xkey,NULL,0,&key,NULL);
+				_injectKeyUp(key);
+			}
+		}
 	}
 
Index: code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.h
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/linux/LinuxKeyboard.h	(revision 8071)
@@ -34,5 +34,5 @@
 	{
 	public:
-		LinuxKeyboard(InputManager* creator, bool buffered, bool grab, bool useXRepeat );
+		LinuxKeyboard(InputManager* creator, bool buffered, bool grab);
 		virtual ~LinuxKeyboard();
 
@@ -59,4 +59,21 @@
 
 	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 );
@@ -75,7 +92,4 @@
 		bool keyFocusLost;
 
-		bool xAutoRepeat;
-		bool oldXAutoRepeat;
-
 		std::string mGetString;
 	};
Index: code/branches/kicklib/src/external/ois/linux/LinuxMouse.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxMouse.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/linux/LinuxMouse.cpp	(revision 8071)
@@ -173,6 +173,6 @@
 
 			//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
@@ -180,6 +180,8 @@
 			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)
Index: code/branches/kicklib/src/external/ois/linux/LinuxPrereqs.h
===================================================================
--- code/branches/kicklib/src/external/ois/linux/LinuxPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/linux/LinuxPrereqs.h	(revision 8071)
@@ -32,5 +32,5 @@
 
 //! Max number of elements to collect from buffered input
-#define JOY_BUFFERSIZE 10
+#define JOY_BUFFERSIZE 64
 
 namespace OIS
Index: code/branches/kicklib/src/external/ois/mac/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/external/ois/mac/CMakeLists.txt	(revision 8068)
+++ code/branches/kicklib/src/external/ois/mac/CMakeLists.txt	(revision 8071)
@@ -3,14 +3,16 @@
   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
 )
Index: code/branches/kicklib/src/external/ois/mac/MacHIDManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacHIDManager.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/mac/MacHIDManager.cpp	(revision 8071)
@@ -20,6 +20,7 @@
  
  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"
@@ -42,5 +43,5 @@
 {
 	CFTypeRef temp = CFDictionaryGetValue(dict, OIS_CFString(keyName));
-
+	
 	if(temp && CFGetTypeID(temp) == CFArrayGetTypeID())
 		return (CFArrayRef)temp;
@@ -53,5 +54,5 @@
 {
 	CFTypeRef temp = CFDictionaryGetValue(dict, OIS_CFString(keyName));
-
+	
 	if(temp && CFGetTypeID(temp) == CFStringGetTypeID())
 		return (CFStringRef)temp;
@@ -64,5 +65,5 @@
 {
 	CFTypeRef temp = CFDictionaryGetValue(dict, OIS_CFString(keyName));
-
+	
 	if(temp && CFGetTypeID(temp) == CFNumberGetTypeID())
 		return (CFNumberRef)temp;
@@ -83,5 +84,5 @@
 {
 	CFTypeRef temp = CFArrayGetValueAtIndex(array, idx);
-
+	
 	if(temp && CFGetTypeID(temp) == CFDictionaryGetTypeID())
 		return (CFDictionaryRef)temp;
@@ -93,8 +94,8 @@
 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,69 +112,96 @@
 //------------------------------------------------------------------------------------------------------//
 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)
-	{
-		io_object_t hidDevice = 0;
-		while ((hidDevice = IOIteratorNext(iterator)) !=0)
+	
+	CFRelease(usageRef);
+	CFRelease(pageRef);
+	
+	if(result == kIOReturnSuccess)
+	{
+		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);
 }
 
@@ -188,11 +216,11 @@
 	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);
@@ -200,5 +228,5 @@
 		for (int i = 0; i < CFArrayGetCount(array); i++)
 			parseDeviceProperties(getArrayItemAsRef<CFDictionaryRef>(array, i));
-
+	
 	return info;
 }
@@ -209,5 +237,5 @@
 	if(!properties)
 		return;
-
+	
 	CFArrayRef array = getDictionaryItemAsRef<CFArrayRef>(properties, kIOHIDElementKey);
 	if (array)
@@ -227,32 +255,32 @@
 					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;
 					}
 				}
@@ -267,5 +295,5 @@
 	if(!properties)
 		return;
-
+	
 	CFArrayRef array = getDictionaryItemAsRef<CFArrayRef>(properties, kIOHIDElementKey);
 	if(array)
@@ -278,27 +306,27 @@
 				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;
 				}
 			}
@@ -317,5 +345,5 @@
 			ret.insert(std::make_pair((*it)->type, (*it)->combinedKey));
 	}
-
+	
 	return ret;
 }
@@ -326,5 +354,5 @@
 	int ret = 0;
 	HidInfoList::iterator it = mDeviceList.begin(), end = mDeviceList.end();
-
+	
 	for(; it != end; ++it)
 	{
@@ -341,5 +369,5 @@
 	int ret = 0;
 	HidInfoList::iterator it = mDeviceList.begin(), end = mDeviceList.end();
-
+	
 	for(; it != end; ++it)
 	{
@@ -347,5 +375,5 @@
 			ret++;
 	}
-
+	
 	return ret;
 }
@@ -355,5 +383,5 @@
 {
 	HidInfoList::iterator it = mDeviceList.begin(), end = mDeviceList.end();
-
+	
 	for(; it != end; ++it)
 	{
@@ -367,8 +395,8 @@
 //--------------------------------------------------------------------------------//
 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)
@@ -376,11 +404,25 @@
 		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;
 }
Index: code/branches/kicklib/src/external/ois/mac/MacHIDManager.h
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacHIDManager.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/mac/MacHIDManager.h	(revision 8071)
@@ -70,4 +70,7 @@
 
 		void initialize();
+		
+		void iterateAndOpenDevices(io_iterator_t iterator);
+		io_iterator_t lookUpDevices(int usage, int page);
 
 		//FactoryCreator Overrides
Index: code/branches/kicklib/src/external/ois/mac/MacInputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacInputManager.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/mac/MacInputManager.cpp	(revision 8071)
@@ -188,5 +188,8 @@
 	}
 	default:
+	{
+		obj = mHIDManager->createObject(creator, iType, bufferMode, vendor);
 		break;
+	}
 	}
 
Index: code/branches/kicklib/src/external/ois/mac/MacJoyStick.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacJoyStick.cpp	(revision 8071)
+++ code/branches/kicklib/src/external/ois/mac/MacJoyStick.cpp	(revision 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.");
+	}
+}
Index: code/branches/kicklib/src/external/ois/mac/MacJoyStick.h
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacJoyStick.h	(revision 8071)
+++ code/branches/kicklib/src/external/ois/mac/MacJoyStick.h	(revision 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
Index: code/branches/kicklib/src/external/ois/mac/MacKeyboard.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/mac/MacKeyboard.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/mac/MacKeyboard.cpp	(revision 8071)
@@ -199,17 +199,9 @@
 	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)
Index: code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.cpp	(revision 8071)
@@ -21,7 +21,7 @@
     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
Index: code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32ForceFeedback.h	(revision 8071)
@@ -26,5 +26,5 @@
 #include "OISPrereqs.h"
 #include "OISForceFeedback.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
 
 namespace OIS
Index: code/branches/kicklib/src/external/ois/win32/Win32InputManager.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32InputManager.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32InputManager.cpp	(revision 8071)
@@ -21,8 +21,8 @@
     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"
 
@@ -75,5 +75,5 @@
 	hInst = GetModuleHandle(0);
 
-	//Create the input system
+	//Create the device
 	hr = DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&mDirectInput, NULL );
     if (FAILED(hr))	
@@ -118,5 +118,18 @@
 {
 	//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
 }
 
@@ -134,4 +147,6 @@
 	{
 		JoyStickInfo jsInfo;
+		jsInfo.isXInput = false;
+		jsInfo.productGuid = lpddi->guidProduct;
 		jsInfo.deviceID = lpddi->guidInstance;
 		jsInfo.vendor = lpddi->tszInstanceName;
Index: code/branches/kicklib/src/external/ois/win32/Win32InputManager.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32InputManager.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32InputManager.h	(revision 8071)
@@ -26,5 +26,5 @@
 #include "OISInputManager.h"
 #include "OISFactoryCreator.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
 
 namespace OIS
Index: code/branches/kicklib/src/external/ois/win32/Win32JoyStick.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32JoyStick.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32JoyStick.cpp	(revision 8071)
@@ -21,11 +21,26 @@
     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
@@ -40,18 +55,18 @@
 #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)
-{
-	mDirectInput = pDI;
-	coopSetting = coopSettings;
-	mJoyStick = 0;
-
-	deviceGuid = info.deviceID;
-
-	ff_device = 0;
+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)
+{
 }
 
@@ -59,5 +74,5 @@
 Win32JoyStick::~Win32JoyStick()
 {
-	delete ff_device;
+	delete mFfDevice;
 
 	if(mJoyStick)
@@ -69,9 +84,5 @@
 
 	//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);
 }
 
@@ -79,43 +90,45 @@
 void Win32JoyStick::_initialize()
 {
-	//Clear old state
-	mState.mAxes.clear();
-
-	if (ff_device)
-	{
-		delete ff_device;
-		ff_device = 0;
-	}
-
-	// Create direct input joystick device.
-	if(FAILED(mDirectInput->CreateDevice(deviceGuid, &mJoyStick, NULL)))
-		OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> Could not initialize joy device!");
-
-	// Set DIJoystick2 data format.
-	if(FAILED(mJoyStick->SetDataFormat(&c_dfDIJoystick2)))
-		OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> data format error!");
-
-	// 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!");
-
-	// 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->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)) )
-		OIS_EXCEPT( E_General, "Win32JoyStick::_initialize >> Failed to set buffer size property" );
-
-	// Enumerate all axes/buttons/sliders/force feedback/etc before aquiring
-	_enumerate();
-
-	mState.clear();
-
-	capture();
+    if (mJoyInfo.isXInput)
+    {
+        _enumerate();
+    }
+    else
+    {
+	    //Clear old state
+	    mState.mAxes.clear();
+
+	    delete mFfDevice;
+	    mFfDevice = 0;
+
+	    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(mDirectInput->CreateDevice(mJoyInfo.deviceID, &mJoyStick, NULL)))
+		    OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> Could not initialize joy device!");
+
+	    if(FAILED(mJoyStick->SetDataFormat(&c_dfDIJoystick2)))
+		    OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> data format error!");
+
+	    HWND hwin = ((Win32InputManager*)mCreator)->getWindowHandle();
+
+	    if(FAILED(mJoyStick->SetCooperativeLevel( hwin, coopSetting)))
+		    OIS_EXCEPT( E_General, "Win32JoyStick::_initialize() >> failed to set cooperation level!");
+
+	    if( FAILED(mJoyStick->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)) )
+		    OIS_EXCEPT( E_General, "Win32Mouse::Win32Mouse >> Failed to set buffer size property" );
+
+	    //Enumerate all axes/buttons/sliders/etc before aquiring
+	    _enumerate();
+
+	    mState.clear();
+
+	    capture();
+    }
 }
 
@@ -123,24 +136,32 @@
 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" );
-
-	// => Number of POVs
-	mPOVs = (short)mDIJoyCaps.dwPOVs;
-
-	// => Number of buttons and axes.
-	mState.mButtons.resize(mDIJoyCaps.dwButtons);
-	mState.mAxes.resize(mDIJoyCaps.dwAxes);
-
-	// Enumerate all Force Feedback effects (if any)
-	mJoyStick->EnumEffects(DIEnumEffectsCallback, this, DIEFT_ALL);
-
-	//Reset the axis mapping enumeration value
-	_AxisNumber = 0;
-
-	// Enumerate and set axis constraints (and check FF Axes)
-	mJoyStick->EnumObjects(DIEnumDeviceObjectsCallback, this, DIDFT_AXIS);
+    if (mJoyInfo.isXInput)
+    {
+        mPOVs = 1;
+
+        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" );
+
+	    mPOVs = (short)mDIJoyCaps.dwPOVs;
+
+	    mState.mButtons.resize(mDIJoyCaps.dwButtons);
+	    mState.mAxes.resize(mDIJoyCaps.dwAxes);
+
+	    //Reset the axis mapping enumeration value
+	    _AxisNumber = 0;
+
+	    //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);
+    }
 }
 
@@ -191,7 +212,7 @@
 	if((lpddoi->dwFlags & DIDOI_FFACTUATOR) != 0 )
 	{
-		if( _this->ff_device )
+		if( _this->mFfDevice )
 		{
-			_this->ff_device->_addFFAxis();
+			_this->mFfDevice->_addFFAxis();
 		}
 	}
@@ -200,8 +221,8 @@
 	//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 )
-	{
-	    _this->ff_device->_setGainSupport(true);
-	    _this->ff_device->_setAutoCenterSupport(true);
+	if( _this->mFfDevice )
+	{
+	    _this->mFfDevice->_setGainSupport(true);
+	    _this->mFfDevice->_setAutoCenterSupport(true);
 	}
 
@@ -215,8 +236,8 @@
 
 	//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);
-
-	_this->ff_device->_addEffectSupport( pdei );
+	if( _this->mFfDevice == 0 )
+		_this->mFfDevice = new Win32ForceFeedback(_this->mJoyStick, &_this->mDIJoyCaps);
+
+	_this->mFfDevice->_addEffectSupport(pdei);
 
 	return DIENUM_CONTINUE;
@@ -226,4 +247,14 @@
 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;
@@ -241,5 +272,5 @@
 
 		// 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
@@ -353,4 +384,116 @@
 
 //--------------------------------------------------------------------------------------------------//
+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 )
 {
@@ -410,10 +553,131 @@
 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();
+}
Index: code/branches/kicklib/src/external/ois/win32/Win32JoyStick.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32JoyStick.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32JoyStick.h	(revision 8071)
@@ -25,5 +25,5 @@
 
 #include "OISJoyStick.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
 
 namespace OIS
@@ -41,4 +41,7 @@
 		virtual void capture();
 
+		//! hanlde xinput
+		void captureXInput();
+
 		/** @copydoc Object::queryInterface */
 		virtual Interface* queryInterface(Interface::IType type);
@@ -46,4 +49,12 @@
 		/** @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:
@@ -61,10 +72,10 @@
 		IDirectInputDevice8* mJoyStick;
 		DIDEVCAPS mDIJoyCaps;
+		DWORD coopSetting;
 
-		DWORD coopSetting;
-		GUID deviceGuid;
+        JoyStickInfo mJoyInfo;
 
 		//! A force feedback device
-		Win32ForceFeedback* ff_device;
+		Win32ForceFeedback* mFfDevice;
 
 		//! Mapping
Index: code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.cpp	(revision 8071)
@@ -21,6 +21,6 @@
     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"
@@ -287,5 +287,5 @@
 
 //--------------------------------------------------------------------------------------------------//
-const std::string& Win32Keyboard::getAsString( KeyCode kc )
+const std::string& Win32Keyboard::getAsString(KeyCode kc)
 {
 	char temp[256];
@@ -297,14 +297,14 @@
 	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());
 }
 
Index: code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32KeyBoard.h	(revision 8071)
@@ -25,5 +25,5 @@
 
 #include "OISKeyboard.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
 
 namespace OIS
@@ -42,15 +42,15 @@
 			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 */
Index: code/branches/kicklib/src/external/ois/win32/Win32Mouse.cpp
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32Mouse.cpp	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32Mouse.cpp	(revision 8071)
@@ -21,6 +21,6 @@
     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"
Index: code/branches/kicklib/src/external/ois/win32/Win32Mouse.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32Mouse.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32Mouse.h	(revision 8071)
@@ -25,5 +25,5 @@
 
 #include "OISMouse.h"
-#include "Win32/Win32Prereqs.h"
+#include "win32/Win32Prereqs.h"
 
 namespace OIS
Index: code/branches/kicklib/src/external/ois/win32/Win32Prereqs.h
===================================================================
--- code/branches/kicklib/src/external/ois/win32/Win32Prereqs.h	(revision 8068)
+++ code/branches/kicklib/src/external/ois/win32/Win32Prereqs.h	(revision 8071)
@@ -29,8 +29,12 @@
 #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
@@ -55,8 +59,11 @@
 		int devId;
 		GUID deviceID;
+		GUID productGuid;
 		std::string vendor;
+        bool isXInput;
+		int xInputDev;
 	};
 
-	typedef std::vector< JoyStickInfo > JoyStickInfoList;
+	typedef std::vector<JoyStickInfo> JoyStickInfoList;
 }
 
Index: code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h
===================================================================
--- code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h	(revision 8071)
+++ code/branches/kicklib/src/external/openal/MacOSX_OALExtensions.h	(revision 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__
Index: code/branches/kicklib/src/external/openal/README
===================================================================
--- code/branches/kicklib/src/external/openal/README	(revision 8071)
+++ code/branches/kicklib/src/external/openal/README	(revision 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
Index: code/branches/kicklib/src/external/openal/al.h
===================================================================
--- code/branches/kicklib/src/external/openal/al.h	(revision 8071)
+++ code/branches/kicklib/src/external/openal/al.h	(revision 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 */
Index: code/branches/kicklib/src/external/openal/alc.h
===================================================================
--- code/branches/kicklib/src/external/openal/alc.h	(revision 8071)
+++ code/branches/kicklib/src/external/openal/alc.h	(revision 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 */
Index: code/branches/kicklib/src/libraries/core/Core.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/Core.cc	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/Core.cc	(revision 8071)
@@ -81,5 +81,7 @@
 
     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
@@ -156,5 +158,6 @@
         this->setConfigValues();
 
-        // create persistent io console
+#ifndef ORXONOX_PLATFORM_APPLE
+        // Create persistent IO console
         if (CommandLineParser::getValue("noIOConsole").getBool())
         {
@@ -163,4 +166,5 @@
         if (this->bStartIOConsole_)
             this->ioConsole_.reset(new IOConsole());
+#endif
 
         // creates the class hierarchy for all classes with factories
Index: code/branches/kicklib/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/core/CorePrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/CorePrereqs.h	(revision 8071)
@@ -54,8 +54,11 @@
 #    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
 
Index: code/branches/kicklib/src/libraries/core/DynLib.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/DynLib.cc	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/DynLib.cc	(revision 8071)
@@ -42,10 +42,10 @@
 #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
 
@@ -75,4 +75,13 @@
         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
 
@@ -127,12 +136,9 @@
         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
     }
-
 }
Index: code/branches/kicklib/src/libraries/core/DynLib.h
===================================================================
--- code/branches/kicklib/src/libraries/core/DynLib.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/DynLib.h	(revision 8071)
@@ -52,15 +52,9 @@
 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
 
@@ -116,5 +110,4 @@
 
     protected:
-
         /// Handle to the loaded library.
         DYNLIB_HANDLE m_hInst;
Index: code/branches/kicklib/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.cc	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/GUIManager.cc	(revision 8071)
@@ -436,4 +436,5 @@
     void GUIManager::buttonPressed(MouseButtonCode::ByEnum id)
     {
+        //guiSystem_->injectMouseButtonDown(convertButton(id));
         this->protectedCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
     }
Index: code/branches/kicklib/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GraphicsManager.cc	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/GraphicsManager.cc	(revision 8071)
@@ -269,5 +269,14 @@
 
         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!
Index: code/branches/kicklib/src/libraries/core/Identifier.h
===================================================================
--- code/branches/kicklib/src/libraries/core/Identifier.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/Identifier.h	(revision 8071)
@@ -123,5 +123,5 @@
 
             /// 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.
@@ -486,5 +486,5 @@
     */
     template <class T, class U>
-    FORCEINLINE T orxonox_cast(U* source)
+    ORX_FORCEINLINE T orxonox_cast(U* source)
     {
 #ifdef ORXONOX_COMPILER_MSVC
Index: code/branches/kicklib/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/branches/kicklib/src/libraries/core/OrxonoxClass.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/OrxonoxClass.h	(revision 8071)
@@ -135,5 +135,5 @@
                 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)
@@ -146,8 +146,8 @@
 
             /// 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);   }
 
Index: code/branches/kicklib/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/PathConfig.cc	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/PathConfig.cc	(revision 8071)
@@ -97,5 +97,5 @@
 #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.");
@@ -127,8 +127,6 @@
 #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();
 
         /////////////////////
@@ -208,9 +206,11 @@
 
             // 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.");
Index: code/branches/kicklib/src/libraries/core/Super.h
===================================================================
--- code/branches/kicklib/src/libraries/core/Super.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/Super.h	(revision 8071)
@@ -94,8 +94,8 @@
         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(); \
             } \
             \
@@ -132,7 +132,7 @@
         struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
         { \
-            static void check() \
-            { \
-                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::check(); \
+            static void superCheck() \
+            { \
+                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
             } \
         };
@@ -150,5 +150,5 @@
         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
@@ -156,6 +156,6 @@
                 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();
             }
 
@@ -202,8 +202,8 @@
         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() \
-            { \
-                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::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>::superCheck(); \
             } \
         };
@@ -303,5 +303,5 @@
         struct SuperFunctionCondition
         {
-            static void check() {}
+            static void superCheck() {}
         };
 
@@ -338,7 +338,7 @@
             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(); \
                 } \
             }; \
@@ -421,8 +421,8 @@
             // 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();
             }
         };
@@ -574,5 +574,5 @@
         virtual void createSuperFunctionCaller() const
         {
-            SuperFunctionCondition<0, T, 0, 0>::check();
+            SuperFunctionCondition<0, T, 0, 0>::superCheck();
         }
 
Index: code/branches/kicklib/src/libraries/core/command/Functor.h
===================================================================
--- code/branches/kicklib/src/libraries/core/command/Functor.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/command/Functor.h	(revision 8071)
@@ -244,4 +244,5 @@
             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)
Index: code/branches/kicklib/src/libraries/core/input/InputDevice.h
===================================================================
--- code/branches/kicklib/src/libraries/core/input/InputDevice.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/input/InputDevice.h	(revision 8071)
@@ -184,5 +184,5 @@
     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)
@@ -201,5 +201,5 @@
 
         //! 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
Index: code/branches/kicklib/src/libraries/core/input/InputState.h
===================================================================
--- code/branches/kicklib/src/libraries/core/input/InputState.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/core/input/InputState.h	(revision 8071)
@@ -176,5 +176,5 @@
     };
 
-    FORCEINLINE void InputState::update(float dt)
+    ORX_FORCEINLINE void InputState::update(float dt)
     {
         for (unsigned int i = 0; i < handlers_.size(); ++i)
@@ -183,5 +183,5 @@
     }
 
-    FORCEINLINE void InputState::update(float dt, unsigned int device)
+    ORX_FORCEINLINE void InputState::update(float dt, unsigned int device)
     {
         switch (device)
@@ -205,5 +205,5 @@
 
     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());
@@ -216,5 +216,5 @@
     }
 
-    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)
@@ -222,5 +222,5 @@
     }
 
-    FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
+    ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
     {
         if (handlers_[mouseIndex_s] != NULL)
@@ -228,5 +228,5 @@
     }
 
-    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());
Index: code/branches/kicklib/src/libraries/network/LANDiscoverable.cc
===================================================================
--- code/branches/kicklib/src/libraries/network/LANDiscoverable.cc	(revision 8068)
+++ code/branches/kicklib/src/libraries/network/LANDiscoverable.cc	(revision 8071)
@@ -29,10 +29,10 @@
 #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
Index: code/branches/kicklib/src/libraries/network/NetworkPrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/network/NetworkPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/network/NetworkPrereqs.h	(revision 8071)
@@ -52,8 +52,11 @@
 #    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
 
Index: code/branches/kicklib/src/libraries/tools/BulletConversions.h
===================================================================
--- code/branches/kicklib/src/libraries/tools/BulletConversions.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/tools/BulletConversions.h	(revision 8071)
@@ -43,5 +43,5 @@
     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);
@@ -56,5 +56,5 @@
     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();
@@ -69,5 +69,5 @@
     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);
@@ -83,5 +83,5 @@
     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();
Index: code/branches/kicklib/src/libraries/tools/ToolsPrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/tools/ToolsPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/tools/ToolsPrereqs.h	(revision 8071)
@@ -52,8 +52,11 @@
 #    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
 
Index: code/branches/kicklib/src/libraries/util/Convert.h
===================================================================
--- code/branches/kicklib/src/libraries/util/Convert.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/util/Convert.h	(revision 8071)
@@ -143,5 +143,5 @@
     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()
@@ -155,5 +155,5 @@
     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);
@@ -182,5 +182,5 @@
 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);
@@ -198,5 +198,5 @@
     /// 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;
@@ -215,5 +215,5 @@
 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;
@@ -241,5 +241,5 @@
     /// 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());
@@ -252,5 +252,5 @@
 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;
@@ -276,5 +276,5 @@
     /// %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);
@@ -283,5 +283,5 @@
     /// 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);
@@ -303,5 +303,5 @@
     {
         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
@@ -327,5 +327,5 @@
     */
     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);
@@ -348,5 +348,5 @@
     */
     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))
@@ -361,5 +361,5 @@
     /// 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;
@@ -380,5 +380,5 @@
     */
     template<class ToType, class FromType>
-    FORCEINLINE ToType multi_cast(const FromType& input)
+    ORX_FORCEINLINE ToType multi_cast(const FromType& input)
     {
         ToType output;
@@ -395,5 +395,5 @@
     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);
@@ -405,5 +405,5 @@
     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;
@@ -415,5 +415,5 @@
     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;
@@ -425,5 +425,5 @@
     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())
@@ -438,5 +438,5 @@
     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())
@@ -453,5 +453,5 @@
     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)
Index: code/branches/kicklib/src/libraries/util/MathConvert.h
===================================================================
--- code/branches/kicklib/src/libraries/util/MathConvert.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/util/MathConvert.h	(revision 8071)
@@ -51,5 +51,5 @@
     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;
@@ -67,5 +67,5 @@
     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;
@@ -83,5 +83,5 @@
     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;
@@ -99,5 +99,5 @@
     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;
@@ -115,5 +115,5 @@
     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;
@@ -157,5 +157,5 @@
     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());
@@ -167,5 +167,5 @@
     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());
@@ -177,5 +177,5 @@
     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;
@@ -194,5 +194,5 @@
     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;
Index: code/branches/kicklib/src/libraries/util/SharedPtr.h
===================================================================
--- code/branches/kicklib/src/libraries/util/SharedPtr.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/util/SharedPtr.h	(revision 8071)
@@ -163,4 +163,5 @@
             public:
                 SharedCounter() : count_(1) {}
+                virtual ~SharedCounter() {}
                 virtual void destroy() = 0;
 
@@ -186,5 +187,5 @@
         _UtilExport SmallObjectAllocator& createSharedCounterPool();
 
-        FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
+        ORX_FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
         {
             static SmallObjectAllocator& instance = createSharedCounterPool();
Index: code/branches/kicklib/src/libraries/util/SignalHandler.h
===================================================================
--- code/branches/kicklib/src/libraries/util/SignalHandler.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/util/SignalHandler.h	(revision 8071)
@@ -70,5 +70,5 @@
 
     /// 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>;
Index: code/branches/kicklib/src/libraries/util/UtilPrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/util/UtilPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/libraries/util/UtilPrereqs.h	(revision 8071)
@@ -52,8 +52,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/designtools/DesignToolsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/designtools/DesignToolsPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/designtools/DesignToolsPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/notifications/NotificationsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/notifications/NotificationsPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/notifications/NotificationsPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/objects/ObjectsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/objects/ObjectsPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/objects/ObjectsPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/overlays/OverlaysPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/overlays/OverlaysPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/pickup/PickupPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/pickup/PickupPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/pong/PongPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/pong/PongPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/pong/PongPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/questsystem/QuestEffect.cc
===================================================================
--- code/branches/kicklib/src/modules/questsystem/QuestEffect.cc	(revision 8068)
+++ code/branches/kicklib/src/modules/questsystem/QuestEffect.cc	(revision 8071)
@@ -68,12 +68,12 @@
     /*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;
     }
 
Index: code/branches/kicklib/src/modules/questsystem/QuestEffectBeacon.cc
===================================================================
--- code/branches/kicklib/src/modules/questsystem/QuestEffectBeacon.cc	(revision 8068)
+++ code/branches/kicklib/src/modules/questsystem/QuestEffectBeacon.cc	(revision 8071)
@@ -143,6 +143,6 @@
         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.
Index: code/branches/kicklib/src/modules/questsystem/QuestsystemPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/questsystem/QuestsystemPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/questsystem/QuestsystemPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/modules/questsystem/effects/AddReward.cc
===================================================================
--- code/branches/kicklib/src/modules/questsystem/effects/AddReward.cc	(revision 8068)
+++ code/branches/kicklib/src/modules/questsystem/effects/AddReward.cc	(revision 8071)
@@ -105,11 +105,11 @@
         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;
     }
 
Index: code/branches/kicklib/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/branches/kicklib/src/modules/weapons/WeaponsPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/modules/weapons/WeaponsPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/orxonox/MoodManager.cc
===================================================================
--- code/branches/kicklib/src/orxonox/MoodManager.cc	(revision 8068)
+++ code/branches/kicklib/src/orxonox/MoodManager.cc	(revision 8071)
@@ -50,10 +50,13 @@
 
         // 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        
     }
 
Index: code/branches/kicklib/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/kicklib/src/orxonox/OrxonoxPrereqs.h	(revision 8068)
+++ code/branches/kicklib/src/orxonox/OrxonoxPrereqs.h	(revision 8071)
@@ -53,8 +53,11 @@
 #    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
 
Index: code/branches/kicklib/src/orxonox/sound/AmbientSound.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/AmbientSound.cc	(revision 8068)
+++ code/branches/kicklib/src/orxonox/sound/AmbientSound.cc	(revision 8071)
@@ -42,5 +42,5 @@
 
         // Ambient sounds always fade in
-        this->setVolume(0);
+        this->setVolume(0.0f);
     }
 
Index: code/branches/kicklib/src/orxonox/sound/BaseSound.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/BaseSound.cc	(revision 8068)
+++ code/branches/kicklib/src/orxonox/sound/BaseSound.cc	(revision 8071)
@@ -31,5 +31,10 @@
 #include <cassert>
 #include <vector>
+
+#ifdef ORXONOX_PLATFORM_APPLE
+#include "openal/al.h"
+#else
 #include <al.h>
+#endif
 
 #include "util/Math.h"
Index: code/branches/kicklib/src/orxonox/sound/SoundBuffer.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/SoundBuffer.cc	(revision 8068)
+++ code/branches/kicklib/src/orxonox/sound/SoundBuffer.cc	(revision 8071)
@@ -30,5 +30,9 @@
 #include "SoundBuffer.h"
 
+#if defined(ORXONOX_PLATFORM_APPLE)
+#include <ALUT/alut.h>
+#else
 #include <AL/alut.h>
+#endif
 #include <vorbis/vorbisfile.h>
 
Index: code/branches/kicklib/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/SoundManager.cc	(revision 8068)
+++ code/branches/kicklib/src/orxonox/sound/SoundManager.cc	(revision 8071)
@@ -31,5 +31,9 @@
 #include "SoundManager.h"
 
+#if defined(__APPLE__)
+#include <ALUT/alut.h>
+#else
 #include <AL/alut.h>
+#endif
 #include <utility>
 #include <loki/ScopeGuard.h>
@@ -73,10 +77,13 @@
         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()));
@@ -126,8 +133,8 @@
         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;
Index: code/branches/kicklib/src/orxonox/sound/SoundStreamer.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/SoundStreamer.cc	(revision 8068)
+++ code/branches/kicklib/src/orxonox/sound/SoundStreamer.cc	(revision 8071)
@@ -27,5 +27,10 @@
 #include "SoundStreamer.h"
 
+#ifdef ORXONOX_PLATFORM_APPLE
+#include "openal/al.h"
+#else
 #include <al.h>
+#endif
+
 #include <vorbis/vorbisfile.h>
 #include "SoundManager.h"
Index: code/branches/kicklib/src/orxonox/sound/WorldSound.cc
===================================================================
--- code/branches/kicklib/src/orxonox/sound/WorldSound.cc	(revision 8068)
+++ code/branches/kicklib/src/orxonox/sound/WorldSound.cc	(revision 8071)
@@ -30,5 +30,9 @@
 #include "WorldSound.h"
 
+#if defined(__APPLE__)
+#include <ALUT/alut.h>
+#else
 #include <AL/alut.h>
+#endif
 #include "util/Math.h"
 #include "core/CoreIncludes.h"
