Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3196 for code/trunk


Ignore:
Timestamp:
Jun 20, 2009, 9:20:47 AM (15 years ago)
Author:
rgrieder
Message:

Merged pch branch back to trunk.

Location:
code/trunk
Files:
29 deleted
479 edited
35 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/bin/CMakeLists.txt

    r2762 r3196  
    3333  ENDFOREACH(_script)
    3434ENDIF()
     35# Also copy vld.ini (visual leak detector config) for MSVC
     36IF(MSVC)
     37  LIST(APPEND RUN_SCRIPTS vld.ini)
     38ENDIF()
    3539
    3640IF(NOT CMAKE_CONFIGURATION_TYPES)
     
    3943ELSE()
    4044  SET(_subdirs ${CMAKE_CONFIGURATION_TYPES})
    41   SEt(_default_subdir Debug)
     45  SEt(_default_subdir) # No default subdir
    4246ENDIF()
    4347STRING(REPLACE "/" "\\" ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY})
     
    5256    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CURRENT_RUNTIME_DIR}/${_script} @ONLY)
    5357    IF(_subdir STREQUAL _default_subdir)
    54       # Convenience script to be used when sitting in the binary directory. Defaults to Debug for msvc.
     58      # Convenience script to be used when sitting in the binary directory. Does nothing for MSVC
    5559      CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CMAKE_BINARY_DIR}/${_script} @ONLY)
    5660    ENDIF()
  • code/trunk/cmake/BuildConfig.cmake

    r2896 r3196  
    7070ENDIF()
    7171
     72# Enable expensive optimisations: Use this for a binary release build
     73OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
     74
     75# Use WinMain() or main()?
     76OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
    7277
    7378################# OGRE Plugins ##################
  • code/trunk/cmake/BuildConfigGCC.cmake

    r3111 r3196  
    2424 #
    2525
     26# Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC
     27SET(CMAKE_COMPILER_IS_GNU TRUE)
     28
    2629# Determine compiler version
    2730EXEC_PROGRAM(
     
    3841IF(_compare_result LESS 0)
    3942  SET(GCC_NO_SYSTEM_HEADER_SUPPORT TRUE)
     43ENDIF()
     44
     45# GCC only supports PCH in versions 3.4 and above
     46INCLUDE(CompareVersionStrings)
     47COMPARE_VERSION_STRINGS("${GCC_VERSION}" "3.4.0" _compare_result)
     48IF(_compare_result GREATER -1)
     49  SET(PCH_COMPILER_SUPPORT TRUE)
    4050ENDIF()
    4151
     
    6777ADD_COMPILER_FLAGS("-Wno-deprecated" CXX CACHE)
    6878
     79# Always show why a precompiled header file could not be used
     80ADD_COMPILER_FLAGS("-Winvalid-pch" CXX CACHE)
     81
    6982# Increase warning level if requested
    7083IF(EXTRA_COMPILER_WARNINGS)
  • code/trunk/cmake/BuildConfigMSVC.cmake

    r2710 r3196  
    2424 #
    2525
     26################### Compiler Version ####################
     27
     28# We make use of variadic macros, which is only supported by MSVC 8 and above
     29IF(MSVC_VERSION LESS 1400)
     30  MESSAGE(FATAL_ERROR "Microsoft Visual Studio versions below 8 (2005) are not supported because of missing compiler extensions.")
     31ENDIF()
     32
     33
    2634######################## Options ########################
    2735
    28 OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" FALSE)
     36# Currently VLD has a problem with MSVC9 although it actually is supported
     37IF(MSVC8)
     38  OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
     39ENDIF()
     40# Make sure the value is "on" or "off" for vld.ini
     41IF(VISUAL_LEAK_DETECTOR_ENABLE)
     42  SET(VISUAL_LEAK_DETECTOR_ENABLE on)
     43ELSE()
     44  SET(VISUAL_LEAK_DETECTOR_ENABLE off)
     45ENDIF()
     46
     47# Orxonox only supports MSVC 8 and above, which gets asserted above
     48SET(PCH_COMPILER_SUPPORT TRUE)
     49
    2950
    3051#################### Compiler Flags #####################
     
    4768
    4869# Overwrite CMake default flags here.
    49 SET_COMPILER_FLAGS("-MDd -Od -ZI -D_DEBUG -Gm -RTC1" Debug          CACHE)
     70SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -Gm -RTC1" Debug          CACHE)
    5071SET_COMPILER_FLAGS("-MD  -O2     -DNDEBUG -MP2"      Release        CACHE)
    5172SET_COMPILER_FLAGS("-MD  -O2 -Zi -DNDEBUG -MP2"      RelWithDebInfo CACHE)
     
    7596# Happens on STL member variables which are not public
    7697ADD_COMPILER_FLAGS("-w44251" CACHE)
     98ADD_COMPILER_FLAGS("-w44275" CACHE) # For inheritance
    7799
    78100# Multiple assignment operators specified
  • code/trunk/cmake/FlagUtilities.cmake

    r2792 r3196  
    2424 #    Release, Debug, RelWithDebInfo, MinSizeRel: Build configs (inclusive)
    2525 #    ReleaseAll: Sets the flags of all three release builds
    26  #    CACHE: Values are witten with SET_CACHE (see above)
     26 #    CACHE: Values are witten with SET_CACHE_ADVANCED
    2727 #    FORCE: When writing to the cache, the values are set anyway
    2828 #    Any variable names (like WIN32, MSVC, etc.): Condition (combined with AND)
    2929 #    You can suffix the condition with a NOT if you wish
    30  #  Functions:
     30 #  Function names:
    3131 #    [ADD/SET/REMOVE]_[COMPILER/LINKER]_FLAGS
    3232 #  Caution: -If you use CACHE after calling the macro without CACHE, the value
    33  #            Will not get written unless FORCE is specified.
     33 #            Will not be written unless FORCE is specified.
    3434 #          - Also be aware to always specify the flags in quotes.
    3535 #  Example:
     
    3737 #    This will only remove the CXX (C++) flags on a non Unix system for the
    3838 #    Release, RelWithDebInfo and MinSizeRel configurations. The macros should
    39  #    be able to cope with "test -foo" that is like another flag in the string.
     39 #    be able to cope with "test -foo" as string argument for a flag.
    4040 #
    4141
    42 # Write to the cache by force, but only if the user didn't edit the value
    43 # Additional argument is the value (may also be a list)
    44 MACRO(SET_CACHE _varname _type _docstring)
    45   SET(_value ${ARGN})
    46   IF(NOT "${_type}" MATCHES "^(STRING|BOOL|PATH|FILEPATH)$")
    47     MESSAGE(FATAL_ERROR "${_type} is not a valid CACHE entry type")
    48   ENDIF()
     42INCLUDE(SeparateFlags)
     43INCLUDE(SetCacheAdvanced)
    4944
    50   IF(NOT DEFINED _INTERNAL_${_varname} OR "${_INTERNAL_${_varname}}" STREQUAL "${${_varname}}")
    51     SET(${_varname} "${_value}" CACHE ${_type} "${_docstring}" FORCE)
    52     SET(_INTERNAL_${_varname} "${_value}" CACHE INTERNAL "Do not edit in any case!")
    53   ENDIF()
    54 ENDMACRO(SET_CACHE)
     45# Compiler flags, additional arguments:
     46# C, CXX: Specify a language, default is both
     47MACRO(SET_COMPILER_FLAGS _flags)
     48  _INTERNAL_PARSE_FLAGS_ARGS(SET "C;CXX" "" "${_flags}" "${ARGN}")
     49ENDMACRO(SET_COMPILER_FLAGS)
     50# Add flags (flags don't get added twice)
     51MACRO(ADD_COMPILER_FLAGS _flags)
     52  _INTERNAL_PARSE_FLAGS_ARGS(APPEND "C;CXX" "" "${_flags}" "${ARGN}")
     53ENDMACRO(ADD_COMPILER_FLAGS)
     54# Remove flags
     55MACRO(REMOVE_COMPILER_FLAGS _flags)
     56  _INTERNAL_PARSE_FLAGS_ARGS(REMOVE_ITEM "C;CXX" "" "${_flags}" "${ARGN}")
     57ENDMACRO(REMOVE_COMPILER_FLAGS)
    5558
    56 # Visual studio (esp. IntelliSense) doesn't like dashes to specify arguments
    57 # Always use foward slashes instead
    58 IF(MSVC)
    59   SET(ARGUMENT_STARTER "/")
    60 ELSE()
    61   SET(ARGUMENT_STARTER "-")
    62 ENDIF(MSVC)
    6359
    64 # Separates a string of flags. " -" or " /" denotes the start of a flag.
    65 # The same sequence inside double quotation marks is ignored.
    66 # Spaces not within quotes are cleaned meaningfully.
    67 # This macro cannot cope with semicolons in the flag string!
    68 MACRO(SEPARATE_FLAGS _flags _output_variable)
    69   SET(_flags_prep " ${_flags} -")
    70   STRING(REPLACE " " " ;" _flag_chunks ${_flags_prep}) # Max loop iterations
    71   SET(_flag_string)
    72   SET(_parsed_flags)
    73   # Loop is necessary because the regex engine is greedy
    74   FOREACH(_chunk ${_flag_chunks})
    75     SET(_flag_string "${_flag_string}${_chunk}")
    76     # Replace all " -" and " /" inside quotation marks
    77     STRING(REGEX REPLACE "^(([^\"]*\"[^\"]*\")*[^\"]*\"[^\"]*) [/-]([^\"]*\")"
    78            "\\1@39535493@\\3" _flag_string "${_flag_string}")
    79     # Extract one flag if possible
    80     SET(_flag)
    81     STRING(REGEX REPLACE "^.* [/-](.+)( [/-].*$)" "${ARGUMENT_STARTER}\\1" _flag "${_flag_string}")
    82     STRING(REGEX REPLACE "^.* [/-](.+)( [/-].*$)" "\\2"  _flag_string "${_flag_string}")
    83     IF(NOT _flag STREQUAL _flag_string)
    84       LIST(APPEND _parsed_flags "${_flag}")
    85     ENDIF(NOT _flag STREQUAL _flag_string)
    86   ENDFOREACH(_chunk)
     60# Linker flags, additional arguments:
     61# EXE, SHARED, MODULE: Specify a linker mode, default is all three
     62MACRO(SET_LINKER_FLAGS _flags)
     63  _INTERNAL_PARSE_FLAGS_ARGS(SET "EXE;SHARED;MODULE" "_LINKER" "${_flags}" "${ARGN}")
     64ENDMACRO(SET_LINKER_FLAGS)
     65# Add flags (flags don't get added twice)
     66MACRO(ADD_LINKER_FLAGS _flags)
     67  _INTERNAL_PARSE_FLAGS_ARGS(APPEND "EXE;SHARED;MODULE" "_LINKER" "${_flags}" "${ARGN}")
     68ENDMACRO(ADD_LINKER_FLAGS)
     69# Remove flags
     70MACRO(REMOVE_LINKER_FLAGS _flags)
     71  _INTERNAL_PARSE_FLAGS_ARGS(REMOVE_ITEM "EXE;SHARED;MODULE" "_LINKER" "${_flags}" "${ARGN}")
     72ENDMACRO(REMOVE_LINKER_FLAGS)
    8773
    88   # Re-replace all " -" and " /" inside quotation marks
    89   STRING(REGEX REPLACE "@39535493@" " -" ${_output_variable} "${_parsed_flags}")
    90 ENDMACRO(SEPARATE_FLAGS)
    91 
    92 # Internal macro, do not use
    93 # Modifies the flags according to the mode: set, add or remove
    94 # Also sets flags according to the CACHE and FORCE parameter.
    95 # If only CACHE is specified, SET_CACHE() is used.
    96 MACRO(_INTERNAL_PARSE_FLAGS _mode _flags _varname _write_to_cache _force)
    97   SEPARATE_FLAGS("${_flags}" _arg_flag_list)
    98 
    99   IF("${_mode}" STREQUAL "SET")
    100     # SET
    101     SET(_flag_list "${_arg_flag_list}")
    102   ELSE()
    103     # ADD or REMOVE
    104     SEPARATE_FLAGS("${${_varname}}" _flag_list)
    105     FOREACH(_flag ${_arg_flag_list})
    106       LIST(${_mode} _flag_list "${_flag}")
    107     ENDFOREACH(_flag)
    108   ENDIF()
    109 
    110   LIST(REMOVE_DUPLICATES _flag_list)
    111   LIST(SORT _flag_list)
    112   STRING(REPLACE ";" " " _flag_list "${_flag_list}")
    113 
    114   IF(_write_to_cache)
    115     IF(_force)
    116       SET(${_varname} "${_flag_list}" CACHE STRING "${${_varname}}" FORCE)
    117       SET(${_varname} "${_flag_list}" CACHE STRING "${${_varname}}" FORCE)
    118     ELSE()
    119       SET_CACHE(${_varname} STRING "${${_varname}}" "${_flag_list}")
    120     ENDIF()
    121   ELSE()
    122     SET(${_varname} "${_flag_list}")
    123   ENDIF()
    124 ENDMACRO(_INTERNAL_PARSE_FLAGS)
    12574
    12675# Internal macro, do not use
     
    155104      IF(_invert_condition)
    156105        SET(_invert_condition FALSE)
    157     IF(${_arg})
     106        IF(${_arg})
    158107          SET(_arg_cond FALSE)
    159     ELSE()
     108        ELSE()
    160109          SET(_arg_cond TRUE)
    161     ENDIF()
     110       ENDIF()
    162111      ELSE()
    163112        SET(_arg_cond ${${_arg}})
     
    191140
    192141
    193 # Compiler flags, additional arguments:
    194 # C, CXX: Specify a language, default is both
    195 MACRO(SET_COMPILER_FLAGS _flags)
    196   _INTERNAL_PARSE_FLAGS_ARGS(SET "C;CXX" "" "${_flags}" "${ARGN}")
    197 ENDMACRO(SET_COMPILER_FLAGS)
    198 # Add flags (flags don't get added twice)
    199 MACRO(ADD_COMPILER_FLAGS _flags)
    200   _INTERNAL_PARSE_FLAGS_ARGS(APPEND "C;CXX" "" "${_flags}" "${ARGN}")
    201 ENDMACRO(ADD_COMPILER_FLAGS)
    202 # Remove flags
    203 MACRO(REMOVE_COMPILER_FLAGS _flags)
    204   _INTERNAL_PARSE_FLAGS_ARGS(REMOVE_ITEM "C;CXX" "" "${_flags}" "${ARGN}")
    205 ENDMACRO(REMOVE_COMPILER_FLAGS)
     142# Internal macro, do not use
     143# Modifies the flags according to the mode: set, add or remove
     144# Also sets flags according to the CACHE and FORCE parameter.
     145# If only CACHE is specified, SET_CACHE_ADVANCED() is used.
     146MACRO(_INTERNAL_PARSE_FLAGS _mode _flags _varname _write_to_cache _force)
     147  SEPARATE_FLAGS("${_flags}" _arg_flag_list)
    206148
    207 # Linker flags, additional arguments:
    208 # EXE, SHARED, MODULE: Specify a linker mode, default is all three
    209 MACRO(SET_LINKER_FLAGS _flags)
    210   _INTERNAL_PARSE_FLAGS_ARGS(SET "EXE;SHARED;MODULE" "_LINKER" "${_flags}" "${ARGN}")
    211 ENDMACRO(SET_LINKER_FLAGS)
    212 # Add flags (flags don't get added twice)
    213 MACRO(ADD_LINKER_FLAGS _flags)
    214   _INTERNAL_PARSE_FLAGS_ARGS(APPEND "EXE;SHARED;MODULE" "_LINKER" "${_flags}" "${ARGN}")
    215 ENDMACRO(ADD_LINKER_FLAGS)
    216 # Remove flags
    217 MACRO(REMOVE_LINKER_FLAGS _flags)
    218   _INTERNAL_PARSE_FLAGS_ARGS(REMOVE_ITEM "EXE;SHARED;MODULE" "_LINKER" "${_flags}" "${ARGN}")
    219 ENDMACRO(REMOVE_LINKER_FLAGS)
     149  IF("${_mode}" STREQUAL "SET")
     150    # SET
     151    SET(_flag_list "${_arg_flag_list}")
     152  ELSE()
     153    # ADD or REMOVE
     154    SEPARATE_FLAGS("${${_varname}}" _flag_list)
     155    IF(NOT _flag_list)
     156      SET(_flag_list "") # LIST command requires a list in any case
     157    ENDIF()
     158    FOREACH(_flag ${_arg_flag_list})
     159      LIST(${_mode} _flag_list "${_flag}")
     160    ENDFOREACH(_flag)
     161  ENDIF()
     162
     163  LIST(REMOVE_DUPLICATES _flag_list)
     164  LIST(SORT _flag_list)
     165  STRING(REPLACE ";" " " _flag_list "${_flag_list}")
     166
     167  IF(_write_to_cache)
     168    IF(_force)
     169      SET(${_varname} "${_flag_list}" CACHE STRING "${${_varname}}" FORCE)
     170      SET(${_varname} "${_flag_list}" CACHE STRING "${${_varname}}" FORCE)
     171    ELSE()
     172      SET_CACHE_ADVANCED(${_varname} STRING "${${_varname}}" "${_flag_list}")
     173    ENDIF()
     174  ELSE()
     175    SET(${_varname} "${_flag_list}")
     176  ENDIF()
     177ENDMACRO(_INTERNAL_PARSE_FLAGS)
  • code/trunk/cmake/GenerateToluaBindings.cmake

    r2710 r3196  
    4848  )
    4949  SOURCE_GROUP("Tolua" FILES ${_tolua_cxxfile} ${_tolua_hfile})
     50  # Disable annoying GCC warnings
     51  IF(CMAKE_COMPILER_IS_GNU)
     52    SET_SOURCE_FILES_PROPERTIES(${_tolua_cxxfile} PROPERTIES COMPILE_FLAGS "-w")
     53  ENDIF()
    5054
    5155  # Create temporary package file
  • code/trunk/cmake/LibraryConfig.cmake

    r2925 r3196  
    6767    INCLUDE(PackageConfigMinGW)
    6868    INCLUDE(PackageConfigMSVC)
    69 
    70     # On Windows, DLLs have to be in the executable folder, install them
    71     IF(DEP_BINARY_DIR AND WIN32)
    72       # When installing a debug version, we really can't know which libraries
    73       # are used in released mode because there might be deps of deps.
    74       INSTALL(
    75         DIRECTORY ${DEP_BINARY_DIR}/
    76         DESTINATION bin
    77         CONFIGURATIONS Debug
    78         REGEX "^.*\\.pdb$" EXCLUDE
    79       )
    80 
    81       # Try to filter out all the debug libraries. If the regex doesn't do the
    82       # job anymore, simply adjust it.
    83       INSTALL(
    84         DIRECTORY ${DEP_BINARY_DIR}/
    85         DESTINATION bin
    86         CONFIGURATIONS Release RelWithDebInfo MinSizeRel
    87         REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
    88       )
    89     ENDIF(DEP_BINARY_DIR AND WIN32)
    90   ENDIF(NOT DEPENDENCY_PACKAGE_DIR)
     69    INCLUDE(PackageConfig) # For both msvc and mingw
     70  ENDIF()
    9171ENDIF(DEPENDENCY_PACKAGE_ENABLE)
    9272
     
    172152##### Boost #####
    173153# Expand the next statement if newer boost versions than 1.36.1 are released
    174 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0)
     154SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 1.38 1.38.0 1.39 1.39.0)
    175155# MSVC seems to be the only compiler requiring date_time
    176156IF(MSVC)
  • code/trunk/cmake/PackageConfigMSVC.cmake

    r2710 r3196  
    2828IF(MSVC)
    2929
    30   # MAJOR: Interface breaking change somewhere or added a new library
    31   # MINOR: Updated a library to a new version
    32   # PATCH: Bug fix or smaller things
    33   SET(DEPENDENCY_VERSION 0.0.1)
    34 
    35   MESSAGE(STATUS "Using library package for the dependencies.")
    36 
    3730  # 64 bit system?
    3831  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    4538  STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
    4639         _msvc_version "${CMAKE_GENERATOR}")
    47   IF(MSVC71)
    48     SET(_msvc_version "7.1")
    49   ENDIF(MSVC71)
    5040
    5141  SET(DEP_INCLUDE_DIR ${DEPENDENCY_PACKAGE_DIR}/include)
     
    6252  SET(CMAKE_LIBRARY_PATH ${DEP_LIBRARY_DIR})
    6353
    64   # Include paths and other special treatments
    65   SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut-1.1.0)
    66   SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost-1.37.0)
    67   SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui-0.6.2)
    68   SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx-2007.aug)
    69   SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet-1.2)
    70   SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua-5.1.4)
    71   SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg-1.1.3)
    72   SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis-1.2.0)
    73   SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre-1.4.9)
    74   SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR})
    75   SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal-1.1)
    76   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl-8.5.2/include)
    77   SET(TCL_LIBRARY                ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
    78   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib-1.2.3/include)
    79   SET(ZLIB_LIBRARY               ${DEP_LIBRARY_DIR}/zdll.lib CACHE FILEPATH "")
     54  # Certain find scripts don't behave as ecpected to we have
     55  # to specify the libraries ourselves.
     56  SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
     57  SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib  CACHE FILEPATH "")
     58
     59  # Visual Leak Detector
     60  SET(VLD_INCLUDE_DIR  ${DEP_INCLUDE_DIR}/vld-1.9h CACHE PATH "")
     61  SET(VLD_LIBRARY_DIR  ${DEP_LIBRARY_DIR}          CACHE PATH "")
     62  LINK_DIRECTORIES(${VLD_LIBRARY_DIR}) # Used for auto-linking
     63  MARK_AS_ADVANCED(VLD_INCLUDE_DIR VLD_LIBRARY_DIR)
    8064
    8165ENDIF(MSVC)
  • code/trunk/cmake/PackageConfigMinGW.cmake

    r2710 r3196  
    2828IF(MINGW)
    2929
    30   # MAJOR: Interface breaking change somewhere or added a new library
    31   # MINOR: Updated a library to a new version
    32   # PATCH: Bug fix or smaller things
    33   SET(DEPENDENCY_VERSION 0.0.1)
    34 
    35   MESSAGE(STATUS "Using library package for the dependencies.")
    36 
    3730  # 64 bit system?
    3831  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    5245  SET(CMAKE_LIBRARY_PATH ${DEP_LIBRARY_DIR} ${DEP_BINARY_DIR})
    5346
    54   # Include paths and other special treatments
    55   SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut-1.1.0)
    56   SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost-1.37.0)
    57   SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui-0.6.2)
    58   SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx-2007.aug)
    59   SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet-1.2)
    60   SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua-5.1.4)
    61   SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg-1.1.3)
    62   SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis-1.2.0)
    63   SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre-1.4.9)
    64   SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR})
    65   SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal-1.1)
    66   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl-8.5.2/include)
    67   SET(TCL_LIBRARY                ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
    68   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib-1.2.3/include)
    69   SET(ZLIB_LIBRARY               ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "")
     47  # Certain find scripts don't behave as ecpected to we have
     48  # to specify the libraries ourselves.
     49  SET(TCL_LIBRARY  ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
     50  SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "")
    7051
    7152ENDIF(MINGW)
  • code/trunk/doc/api/CMakeLists.txt

    r2710 r3196  
    5050    # use (configured) doxy.config from (out of place) BUILD tree:
    5151    SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/doxy.config)
     52    SET(DOXY_LOGFILE ${CMAKE_CURRENT_BINARY_DIR}/doxy.log)
    5253  ELSE()
    53     MESSAGE(STATUS "Warning: Could not find dox.config.in in the root directory.")
     54    MESSAGE(FATAL_ERROR "Warning: Could not find dox.config.in in the root directory.")
    5455  ENDIF()
    5556 
     
    6465      SET(TMP ${DOXY_OUTPUT_DIR}/html/index.hhp)
    6566      STRING(REGEX REPLACE "/" "\\\\" HHP_FILE ${TMP})
    66       ADD_CUSTOM_TARGET(chmdoc ${HTML_HELP_COMPILER} ${HHP_FILE})
    67       ADD_DEPENDENCIES(chmdoc doc)
     67      ADD_CUSTOM_TARGET(doc_chm ${HTML_HELP_COMPILER} ${HHP_FILE})
     68      ADD_DEPENDENCIES(doc_chm doc)
    6869      # Adding a dependency somehow adds doc target as default build target
    69       SET_TARGET_PROPERTIES(doc chmdoc PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
     70      SET_TARGET_PROPERTIES(doc doc_chm PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
    7071    ENDIF(HTML_HELP_COMPILER)
    7172  ENDIF (WIN32)
     
    7879    OPTIONAL
    7980  )
    80   # Install command always needs the directory to work
     81  # Install command always needs the directory
    8182  IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html)
    8283    FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html)
  • code/trunk/doc/api/doxy.config.in

    r2891 r3196  
    5353
    5454OUTPUT_LANGUAGE        = English
    55 
    56 # This tag can be used to specify the encoding used in the generated output.
    57 # The encoding is not always determined by the language that is chosen,
    58 # but also whether or not the output is meant for Windows or non-Windows users.
    59 # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
    60 # forces the Windows encoding (this is the default for the Windows binary),
    61 # whereas setting the tag to NO uses a Unix-style encoding (the default for
    62 # all platforms other than Windows).
    63 
    64 USE_WINDOWS_ENCODING   = YES
    6555
    6656# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
     
    377367# documentation sections, marked by \if sectionname ... \endif.
    378368
    379 ENABLED_SECTIONS       =
     369ENABLED_SECTIONS       = YES
    380370
    381371# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
     
    401391SHOW_DIRECTORIES       = YES
    402392
     393# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
     394# This will remove the Files entry from the Quick Index and from the Folder
     395# Tree View (if specified). The default is YES.
     396
     397SHOW_FILES             = YES
     398
     399# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
     400# Namespaces page. This will remove the Namespaces entry from the Quick Index
     401# and from the Folder Tree View (if specified). The default is YES.
     402
     403SHOW_NAMESPACES        = YES
     404
    403405# The FILE_VERSION_FILTER tag can be used to specify a program or script that
    404406# doxygen should invoke to get the current version for each file (typically from the
     
    460462# to stderr.
    461463
    462 WARN_LOGFILE           = @DOXY_OUTPUT_DIR@/doxy.log
     464WARN_LOGFILE           = @DOXY_LOGFILE@
    463465
    464466#---------------------------------------------------------------------------
     
    472474
    473475INPUT                  = @CMAKE_SOURCE_DIR@/src \
     476                         @CMAKE_CURRENT_SOURCE_DIR@ \
    474477                         @CMAKE_BINARY_DIR@/src
    475478
     
    518521# the \include command).
    519522
    520 EXAMPLE_PATH           = @CMAKE_SOURCE_DIR@/doc/examples/
     523EXAMPLE_PATH           = @CMAKE_CURRENT_SOURCE_DIR@/examples/
    521524
    522525# If the value of the EXAMPLE_PATH tag contains directories, you can use the
     
    542545# the \image command).
    543546
    544 IMAGE_PATH             = @CMAKE_SOURCE_DIR@/doc/images/
     547IMAGE_PATH             = @CMAKE_CURRENT_SOURCE_DIR@/images/
    545548
    546549
     
    10301033# instead of the = operator.
    10311034
    1032 PREDEFINED             =
     1035PREDEFINED             = DOXYGEN_SHOULD_SKIP_THIS
    10331036
    10341037# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
     
    11401143
    11411144UML_LOOK               = NO
    1142 # UML_LOOK               = YES
    11431145
    11441146# If set to YES, the inheritance and collaboration graphs will show the
     
    11961198# \dotfile command).
    11971199
    1198 DOTFILE_DIRS           =
     1200DOTFILE_DIRS           = @CMAKE_CURRENT_SOURCE_DIR@/dot
    11991201
    12001202# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
     
    12221224# makes dot run faster, but since only newer versions of dot (>1.8.10)
    12231225# support this, this feature is disabled by default.
    1224 # JW
    1225 # DOT_MULTI_TARGETS      = NO
     1226
    12261227DOT_MULTI_TARGETS      = NO
    12271228
     
    12451246# used. If set to NO the values of all tags below this one will be ignored.
    12461247
    1247 # JW SEARCHENGINE           = NO
    12481248SEARCHENGINE           = YES
  • code/trunk/src/CMakeLists.txt

    r3084 r3196  
    2222# various macro includes
    2323INCLUDE(FlagUtilities)
    24 INCLUDE(GenerateToluaBindings)
    25 INCLUDE(InstallUtilities)
    26 INCLUDE(SourceFileUtilities)
     24INCLUDE(TargetUtilities)
    2725
    2826# Use TinyXML++
     
    3129ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")
    3230# Tolua binding speedup if required
    33 ADD_COMPILER_FLAGS("-DTOLUA_RELEASE" Release MinSizeRel TOLUA_PARSER_RELEASE)
     31ADD_COMPILER_FLAGS("-DTOLUA_RELEASE" ORXONOX_RELEASE)
     32
     33# Default linking is SHARED
     34SET(ORXONOX_DEFAULT_LINK SHARED)
    3435
    3536################ OrxonoxConfig.h ################
     
    7677
    7778SET(GENERATED_FILE_COMMENT
    78    "DO NOT EDIT THIS FILE!
     79   "DO NOT EDIT THIS FILE! <br>
    7980    It has been automatically generated by CMake from OrxonoxConfig.h.in")
    8081# Copy and configure OrxonoxConfig which gets included in every file
     
    8384CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)
    8485
     86SET(ORXONOX_CONFIG_FILES
     87  ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h
     88  ${CMAKE_CURRENT_SOURCE_DIR}/OrxonoxConfig.h.in
     89  ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h
     90  ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in
     91)
    8592
    8693############## Include Directories ##############
     
    101108  ${DIRECTX_INCLUDE_DIR}
    102109  ${ZLIB_INCLUDE_DIR}
     110  ${VLD_INCLUDE_DIR}
    103111
    104112  # All library includes are prefixed with the path to avoid conflicts
     
    145153ADD_SUBDIRECTORY(network)
    146154ADD_SUBDIRECTORY(orxonox)
    147 
    148 # Apply version info
    149 SET_TARGET_PROPERTIES(util core network orxonox
    150   PROPERTIES VERSION ${ORXONOX_VERSION})
  • code/trunk/src/OrxonoxConfig.h.in

    r2946 r3196  
    3434
    3535/**
    36  @file
    37  @brief
     36@file
     37@brief
    3838    Various constants for compiler, architecture and platform.
    39 
     39@remarks
    4040    @GENERATED_FILE_COMMENT@
    41  */
     41*/
    4242
    4343#ifndef _OrxonoxConfig_H__
     
    5252#cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */
    5353
    54 /* Determine compiler and set ORXONOX_COMP_VER */
     54// Determine compiler and set ORXONOX_COMP_VER
    5555#if defined( _MSC_VER )
    5656#  define ORXONOX_COMPILER_MSVC
     
    7575#endif
    7676
    77 /* Endianness */
     77// Endianness
    7878#cmakedefine ORXONOX_BIG_ENDIAN
    7979#cmakedefine ORXONOX_LITTLE_ENDIAN
    8080
    81 /* Architecture */
     81// Architecture
    8282#cmakedefine ORXONOX_ARCH_32
    8383#cmakedefine ORXONOX_ARCH_64
    8484
    85 /* See if we can use __forceinline or if we need to use __inline instead */
     85// See if we can use __forceinline or if we need to use __inline instead
    8686#cmakedefine HAVE_FORCEINLINE
    8787#ifndef FORCEINLINE
     
    9393#endif
    9494
    95 /* Try to define function information */
     95// Try to define function information
    9696#ifndef __FUNCTIONNAME__
    9797#  ifdef ORXONOX_COMPILER_BORLAND
     
    115115#define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@"
    116116
    117 #define ORXONOX_VERSION ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH)
     117//! Defines version info encoded as 0xMMIIPP (M: Major version, I: Minor version, P: Patch version, all as hex)
     118#define ORXONOX_VERSION \
     119    ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH)
    118120
    119121
     
    123125#ifdef ORXONOX_PLATFORM_UNIX
    124126
    125 /* TODO: Check what this actually is and whether we need it or not */
     127// TODO: Check what this actually is and whether we need it or not
    126128#if 0
    127129#  ifdef ORXONOX_PLATFORM_APPLE
    128130#    define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle"
    129 #  else
    130 /* ORXONOX_PLATFORM_LINUX */
     131#  else // ORXONOX_PLATFORM_LINUX
    131132#    define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so"
    132133#  endif
     
    142143
    143144/*---------------------------------
    144  * Special Macros
    145  *-------------------------------*/
    146 #define MACRO_CONCATENATE_AUX(a, b) a##b
    147 #define MACRO_CONCATENATE(a, b) MACRO_CONCATENATE_AUX(a, b)
    148 #define MACRO_QUOTEME_AUX(x) #x
    149 #define MACRO_QUOTEME(x) MACRO_QUOTEME_AUX(x)
    150 
    151 
    152 /*---------------------------------
    153  * Includes
    154  *-------------------------------*/
    155 /* Define the english written operators like and, or, xor
    156  * This is C++ standard, but the Microsoft compiler doesn't define them. */
     145 * Options
     146 *-------------------------------*/
     147/**
     148@def ORXONOX_RELEASE
     149    Enables expensive (build time) optimisations and disables certain features
     150*/
     151#cmakedefine ORXONOX_RELEASE
     152
     153
     154/*---------------------------------
     155 * Includes and Declarations
     156 *-------------------------------*/
     157// Define the english written operators like and, or, xor
     158// This is C++ standard, but the Microsoft compiler doesn't define them.
    157159#cmakedefine HAVE_ISO646_H
    158160#ifdef HAVE_ISO646_H
     
    181183*/
    182184
    183 /* Visual Leak Detector looks for memory leaks */
    184 #cmakedefine VISUAL_LEAK_DETECTOR_ENABLE
    185 #ifdef VISUAL_LEAK_DETECTOR_ENABLE
     185// Always include the memory leak detector for MSVC except for actual releases
     186// Note: Although officially supported, VLD does not work with MSVC 9
     187#if defined(ORXONOX_COMPILER_MSVC) && _MSC_VER < 1500 && !defined(ORXONOX_RELEASE)
    186188#  include <vld.h>
    187189#endif
    188190
     191// Forward declare the everywhere used std::string
     192namespace std
     193{
     194    template<class _Elem> struct char_traits;
     195    template<class _Ty>   class  allocator;
     196    template<class _Elem, class _Traits, class _Ax> class basic_string;
     197    typedef basic_string<char, char_traits<char>, allocator<char> > string;
     198}
     199
    189200#endif /* _OrxonoxConfig_H__ */
  • code/trunk/src/SpecialConfig.h.in

    r2946 r3196  
    2828
    2929/**
    30  @file
    31  @brief
     30@file
     31@brief
    3232    Various constants and options that only affect very little code.
    33  @note
     33@note
    3434    This is merely to avoid recompiling everything when only a path changes.
    35 
     35@remarks
    3636    @GENERATED_FILE_COMMENT@
    37  */
     37*/
    3838
    3939#ifndef _SpecialConfig_H__
     
    4141
    4242#include "OrxonoxConfig.h"
     43#include <boost/preprocessor/stringize.hpp>
    4344
    44 /* Set whether we must suffix "ceguilua/" for the CEGUILua.h include */
     45/**
     46@def CEGUILUA_USE_INTERNAL_LIBRARY
     47    Set whether we must suffix "ceguilua/" for the CEGUILua.h include
     48*/
    4549#cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY
    4650
    47 /* Defined if a precompiled depdency package was used. We then copy all libraries
    48    too when installing. */
     51/**
     52@def DEPENDENCY_PACKAGE_ENABLE
     53    Defined if a precompiled depdency package was used. We then copy all libraries
     54    too when installing.
     55*/
    4956#cmakedefine DEPENDENCY_PACKAGE_ENABLE
    5057
    51 /* Orxonox either gets installed to the system or just into a folder.
    52    The latter uses relative paths. */
     58/**
     59@def INSTALL_COPYABLE
     60    Orxonox either gets installed to the system or just into a folder.
     61    The latter uses relative paths.
     62*/
    5363#cmakedefine INSTALL_COPYABLE
    5464
    55 /* Using MSVC or XCode IDE */
     65/**
     66@def CMAKE_CONFIGURATION_TYPES
     67    Using MSVC or XCode IDE
     68*/
    5669#cmakedefine CMAKE_CONFIGURATION_TYPES
    5770
    58 /* Handle default ConfigValues */
     71// Handle default ConfigValues
    5972namespace orxonox
    6073{
    61     const char* const ORXONOX_RUNTIME_INSTALL_PATH("@ORXONOX_RUNTIME_INSTALL_PATH@");
    62     const char* const ORXONOX_MEDIA_INSTALL_PATH  ("@ORXONOX_MEDIA_INSTALL_PATH@");
     74    // INSTALLATION PATHS
     75    const char ORXONOX_RUNTIME_INSTALL_PATH[] = "@ORXONOX_RUNTIME_INSTALL_PATH@";
     76    const char ORXONOX_MEDIA_INSTALL_PATH[]   = "@ORXONOX_MEDIA_INSTALL_PATH@";
    6377    /* Config and Log path might be relative because they could be user and therefore runtime dependent */
    64     const char* const ORXONOX_CONFIG_INSTALL_PATH ("@ORXONOX_CONFIG_INSTALL_PATH@");
    65     const char* const ORXONOX_LOG_INSTALL_PATH    ("@ORXONOX_LOG_INSTALL_PATH@");
     78    const char ORXONOX_CONFIG_INSTALL_PATH[]  = "@ORXONOX_CONFIG_INSTALL_PATH@";
     79    const char ORXONOX_LOG_INSTALL_PATH[]     = "@ORXONOX_LOG_INSTALL_PATH@";
    6680
    67     const char* const ORXONOX_MEDIA_DEV_PATH      ("@CMAKE_MEDIA_OUTPUT_DIRECTORY@");
     81    // DEVELOPMENT RUN PATHS
     82    const char ORXONOX_MEDIA_DEV_PATH[]       = "@CMAKE_MEDIA_OUTPUT_DIRECTORY@";
    6883#ifdef CMAKE_CONFIGURATION_TYPES
    69     const char* const ORXONOX_CONFIG_DEV_PATH     ("@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" MACRO_QUOTEME(CMAKE_BUILD_TYPE));
    70     const char* const ORXONOX_LOG_DEV_PATH        ("@CMAKE_LOG_OUTPUT_DIRECTORY@/"    MACRO_QUOTEME(CMAKE_BUILD_TYPE));
     84    const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
     85    const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
    7186#else
    72     const char* const ORXONOX_CONFIG_DEV_PATH     ("@CMAKE_CONFIG_OUTPUT_DIRECTORY@");
    73     const char* const ORXONOX_LOG_DEV_PATH        ("@CMAKE_LOG_OUTPUT_DIRECTORY@");
     87    const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
     88    const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@";
    7489#endif
    7590   
    7691    /* OGRE Plugins */
    7792#ifdef NDEBUG
    78     const char* const ORXONOX_OGRE_PLUGINS("@OGRE_PLUGINS_RELEASE@");
     93    const char ORXONOX_OGRE_PLUGINS[] = "@OGRE_PLUGINS_RELEASE@";
    7994#  ifdef DEPENDENCY_PACKAGE_ENABLE
    80     const char* const ORXONOX_OGRE_PLUGINS_FOLDER(".");
     95    const char ORXONOX_OGRE_PLUGINS_FOLDER[] = ".";
    8196#  else
    82     const char* const ORXONOX_OGRE_PLUGINS_FOLDER("@OGRE_PLUGINS_FOLDER_RELEASE@");
     97    const char ORXONOX_OGRE_PLUGINS_FOLDER[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";
    8398#  endif
    8499#else
    85     const char* const ORXONOX_OGRE_PLUGINS("@OGRE_PLUGINS_DEBUG@");
     100    const char ORXONOX_OGRE_PLUGINS[] = "@OGRE_PLUGINS_DEBUG@";
    86101#  ifdef DEPENDENCY_PACKAGE_ENABLE
    87     const char* const ORXONOX_OGRE_PLUGINS_FOLDER(".");
     102    const char ORXONOX_OGRE_PLUGINS_FOLDER[] = ".";
    88103#  else
    89     const char* const ORXONOX_OGRE_PLUGINS_FOLDER("@OGRE_PLUGINS_FOLDER_DEBUG@");
     104    const char ORXONOX_OGRE_PLUGINS_FOLDER[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";
    90105#  endif
    91106#endif
    92107}
    93108
     109/**
     110@def ORXONOX_USE_WINMAIN
     111    Use main() or WinMain()?
     112*/
     113#cmakedefine ORXONOX_USE_WINMAIN
     114
    94115#endif /* _SpecialConfig_H__ */
  • code/trunk/src/bullet/CMakeLists.txt

    r2710 r3196  
    2727ADD_SUBDIRECTORY(LinearMath)
    2828
    29 GENERATE_SOURCE_GROUPS(${BULLET_FILES})
    30 
    3129# No warnings needed from third party libraries
    3230REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC)
    3331ADD_COMPILER_FLAGS("-w")
    3432
    35 IF(MSVC)
    36   ADD_LIBRARY(bullet_orxonox STATIC ${BULLET_FILES})
    37 ELSE(MSVC)
    38   ADD_LIBRARY(bullet_orxonox SHARED ${BULLET_FILES})
    39   ORXONOX_INSTALL(bullet_orxonox)
    40 ENDIF(MSVC)
    41 
    42 SET_TARGET_PROPERTIES(bullet_orxonox PROPERTIES VERSION 2.73)
     33ORXONOX_ADD_LIBRARY(bullet_orxonox
     34  ORXONOX_EXTERNAL
     35  NO_DLL_INTERFACE
     36  VERSION
     37    2.74
     38  SOURCE_FILES
     39    ${BULLET_FILES}
     40)
  • code/trunk/src/ceguilua/CMakeLists.txt

    r2710 r3196  
    7575SET(CEGUILUA_LIBRARY ceguilua_orxonox)
    7676SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE)
    77 ADD_LIBRARY(${CEGUILUA_LIBRARY} SHARED ${CEGUILUA_FILES})
    78 SET_TARGET_PROPERTIES(${CEGUILUA_LIBRARY} PROPERTIES DEFINE_SYMBOL "CEGUILUA_EXPORTS")
    79 TARGET_LINK_LIBRARIES(${CEGUILUA_LIBRARY}
    80   tolua++_orxonox
    81   ${LUA_LIBRARIES}
    82   ${CEGUI_LIBRARY}
     77ORXONOX_ADD_LIBRARY(${CEGUILUA_LIBRARY}
     78  ORXONOX_EXTERNAL
     79  NO_SOURCE_GROUPS
     80  DEFINE_SYMBOL
     81    "CEGUILUA_EXPORTS"
     82  VERSION
     83    ${CEGUI_VERSION}
     84  LINK_LIBRARIES
     85    tolua++_orxonox
     86    ${LUA_LIBRARIES}
     87    ${CEGUI_LIBRARY}
     88  SOURCE_FILES
     89    ${CEGUILUA_FILES}
    8390)
    84 
    85 SET_TARGET_PROPERTIES(ceguilua_orxonox PROPERTIES VERSION ${CEGUI_VERSION})
    86 
    87 ORXONOX_INSTALL(ceguilua_orxonox)
  • code/trunk/src/core/ArgumentCompletionFunctions.cc

    r2759 r3196  
    2929#include "ArgumentCompletionFunctions.h"
    3030
    31 #include <iostream>
    3231#include <map>
    3332#include <boost/version.hpp>
    3433#include <boost/filesystem.hpp>
    3534
    36 #include "CoreIncludes.h"
     35#include "util/Convert.h"
     36#include "util/String.h"
    3737#include "Identifier.h"
    3838#include "ConfigValueContainer.h"
    3939#include "TclThreadManager.h"
    40 #include "util/Convert.h"
    41 #include "util/String.h"
    4240
    4341// Boost 1.36 has some issues with deprecated functions that have been omitted
  • code/trunk/src/core/ArgumentCompletionListElement.h

    r1784 r3196  
    3232#include "CorePrereqs.h"
    3333
     34#include <list>
    3435#include <string>
    35 #include <list>
    36 
    3736
    3837namespace orxonox
  • code/trunk/src/core/BaseObject.cc

    r2710 r3196  
    3636#include <tinyxml/tinyxml.h>
    3737
     38#include "util/String.h"
    3839#include "CoreIncludes.h"
     40#include "Event.h"
    3941#include "EventIncludes.h"
    4042#include "Functor.h"
    41 #include "XMLPort.h"
     43#include "Iterator.h"
     44#include "Template.h"
    4245#include "XMLFile.h"
    4346#include "XMLNameListener.h"
    44 #include "Template.h"
    45 #include "util/String.h"
    46 #include "util/mbool.h"
     47#include "XMLPort.h"
    4748
    4849namespace orxonox
     
    293294    void BaseObject::processEvent(Event& event)
    294295    {
    295         SetEvent(BaseObject, "activity", setActive, event);
    296         SetEvent(BaseObject, "visibility", setVisible, event);
     296        ORXONOX_SET_EVENT(BaseObject, "activity", setActive, event);
     297        ORXONOX_SET_EVENT(BaseObject, "visibility", setVisible, event);
    297298    }
    298299
  • code/trunk/src/core/BaseObject.h

    r2662 r3196  
    4444    }
    4545
     46
     47#include "CorePrereqs.h"
     48
    4649#include <map>
    47 
    48 #include "CorePrereqs.h"
    49 
     50#include <list>
     51
     52#include "util/mbool.h"
     53#include "OrxonoxClass.h"
    5054#include "Super.h"
    51 #include "OrxonoxClass.h"
    52 #include "XMLIncludes.h"
    53 #include "Event.h"
    54 #include "util/mbool.h"
    5555
    5656namespace orxonox
  • code/trunk/src/core/CMakeLists.txt

    r3036 r3196  
    6363)
    6464ADD_SUBDIRECTORY(input)
    65 GET_ALL_HEADER_FILES(CORE_HDR_FILES)
    66 SET(CORE_FILES ${CORE_SRC_FILES} ${CORE_HDR_FILES})
    6765
    68 GENERATE_SOURCE_GROUPS(${CORE_FILES})
    69 GENERATE_TOLUA_BINDINGS(Core CORE_FILES INPUTFILES LuaBind.h CommandExecutor.h Game.h)
    70 
    71 ADD_LIBRARY(core SHARED ${CORE_FILES})
    72 
    73 SET_TARGET_PROPERTIES(core PROPERTIES DEFINE_SYMBOL "CORE_SHARED_BUILD")
    74 TARGET_LINK_LIBRARIES(core
    75   ${OGRE_LIBRARY}
    76   ${Boost_THREAD_LIBRARY}
    77   ${Boost_FILESYSTEM_LIBRARY}
    78   ${Boost_SYSTEM_LIBRARY}
    79   ${Boost_DATE_TIME_LIBRARY} # MSVC only
    80   ${LUA_LIBRARIES}
    81   cpptcl_orxonox
    82   ois_orxonox
    83   tinyxml++_orxonox
    84   tolua++_orxonox
    85   util
     66ORXONOX_ADD_LIBRARY(core
     67  FIND_HEADER_FILES
     68  TOLUA_FILES
     69    CommandExecutor.h
     70    Game.h
     71    LuaBind.h
     72  DEFINE_SYMBOL
     73    "CORE_SHARED_BUILD"
     74  PCH_FILE
     75    CorePrecompiledHeaders.h
     76  LINK_LIBRARIES
     77    ${OGRE_LIBRARY}
     78    ${Boost_THREAD_LIBRARY}
     79    ${Boost_FILESYSTEM_LIBRARY}
     80    ${Boost_SYSTEM_LIBRARY}
     81    ${Boost_DATE_TIME_LIBRARY} # MSVC only
     82    ${LUA_LIBRARIES}
     83    cpptcl_orxonox
     84    ois_orxonox
     85    tinyxml++_orxonox
     86    tolua++_orxonox
     87    util
     88  SOURCE_FILES
     89    ${CORE_SRC_FILES}
    8690)
    87 
    88 ORXONOX_INSTALL(core)
  • code/trunk/src/core/ClassFactory.h

    r2171 r3196  
    4141#include <string>
    4242
     43#include "util/Debug.h"
    4344#include "Factory.h"
    4445#include "Identifier.h"
    45 #include "util/Debug.h"
    4646
    4747namespace orxonox
     
    8888    */
    8989    template <class T>
    90     BaseObject* ClassFactory<T>::fabricate(BaseObject* creator)
     90    inline BaseObject* ClassFactory<T>::fabricate(BaseObject* creator)
    9191    {
    9292        return ClassFactory<T>::createNewObject(creator);
     
    9898    */
    9999    template <class T>
    100     T* ClassFactory<T>::createNewObject(BaseObject* creator)
     100    inline T* ClassFactory<T>::createNewObject(BaseObject* creator)
    101101    {
    102102        return new T(creator);
  • code/trunk/src/core/ClassTreeMask.cc

    r2171 r3196  
    3434#include "ClassTreeMask.h"
    3535#include "Identifier.h"
    36 #include "BaseObject.h"
    3736
    3837namespace orxonox
  • code/trunk/src/core/ClassTreeMask.h

    r2171 r3196  
    7575#include <list>
    7676#include <stack>
    77 
     77#include "BaseObject.h"
    7878#include "Iterator.h"
    79 #include "BaseObject.h"
    8079
    8180namespace orxonox
  • code/trunk/src/core/Clock.cc

    r1755 r3196  
    5757        tickTime_ = storedTime_ + timersTime;
    5858        tickDt_ = timersTime - lastTimersTime_;
    59         tickDtFloat_ = (float)tickDt_ / 1000000.0f;
     59        tickDtFloat_ = static_cast<float>(tickDt_) / 1000000.0f;
    6060
    6161        if (timersTime > 0x7FFFFFF0)
  • code/trunk/src/core/Clock.h

    r2896 r3196  
    3939
    4040#include "CorePrereqs.h"
    41 #include <OgrePrerequisites.h>
     41#include "util/OgreForwardRefs.h"
    4242
    4343namespace orxonox
     
    5353        unsigned long long getMicroseconds()   const { return tickTime_; }
    5454        unsigned long long getMilliseconds()   const { return tickTime_ / 1000; }
    55         int                getSeconds()        const { return tickTime_ / 1000000; }
    56         float              getSecondsPrecise() const { return (float)tickTime_ / 1000000.0f; }
     55        unsigned long      getSeconds()        const { return static_cast<long> (tickTime_ / 1000000); }
     56        float              getSecondsPrecise() const { return static_cast<float>(tickTime_ / 1000000.0f); }
    5757
    5858        float              getDeltaTime()      const { return tickDtFloat_; }
    59         int                getDeltaTimeMicroseconds() const { return tickDt_; }
     59        long               getDeltaTimeMicroseconds() const { return tickDt_; }
    6060
    6161        unsigned long long getRealMicroseconds() const;
     
    6767        unsigned long long storedTime_;
    6868        unsigned long long tickTime_;
    69         int                tickDt_;
     69        long               tickDt_;
    7070        float              tickDtFloat_;
    7171        unsigned long      lastTimersTime_;
  • code/trunk/src/core/CommandEvaluation.cc

    r2087 r3196  
    2828
    2929#include "CommandEvaluation.h"
     30
     31#include "util/Debug.h"
     32#include "util/String.h"
    3033#include "ConsoleCommand.h"
    3134#include "Identifier.h"
    32 #include "util/Debug.h"
    33 #include "util/String.h"
    3435
    3536namespace orxonox
  • code/trunk/src/core/CommandExecutor.cc

    r3035 r3196  
    2828
    2929#include "CommandExecutor.h"
     30
     31#include "util/Debug.h"
     32#include "util/String.h"
    3033#include "ConsoleCommand.h"
    31 #include "util/String.h"
    32 #include "util/Debug.h"
    3334#include "Identifier.h"
    3435#include "Language.h"
  • code/trunk/src/core/CommandExecutor.h

    r3035 r3196  
    3333
    3434#include <map>
     35#include <set>
     36#include <string>
    3537
     38#include "util/MultiType.h"
    3639#include "CommandEvaluation.h"
    3740
  • code/trunk/src/core/CommandLine.cc

    r2759 r3196  
    3030
    3131#include <boost/filesystem.hpp>
     32
     33#include "util/Convert.h"
     34#include "util/Debug.h"
     35#include "util/Exception.h"
    3236#include "util/String.h"
    3337#include "util/SubString.h"
  • code/trunk/src/core/CommandLine.h

    r2662 r3196  
    3131
    3232#include "CorePrereqs.h"
     33
    3334#include <map>
    34 #include "util/Convert.h"
    35 #include "util/Debug.h"
    36 #include "util/Exception.h"
     35#include "util/OrxAssert.h"
    3736#include "util/MultiType.h"
    3837
  • code/trunk/src/core/ConfigFileManager.cc

    r2896 r3196  
    2929#include "ConfigFileManager.h"
    3030
    31 #include <cassert>
    3231#include <boost/filesystem.hpp>
    3332
    3433#include "util/Convert.h"
     34#include "util/Math.h"
    3535#include "util/String.h"
    3636#include "ConsoleCommand.h"
     
    312312                                // There might be an array index
    313313                                unsigned int index = 0;
    314                                 if (ConvertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
     314                                if (convertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
    315315                                {
    316316                                    // New array
  • code/trunk/src/core/ConfigFileManager.h

    r2662 r3196  
    3232#include "CorePrereqs.h"
    3333
    34 #include <iostream>
     34#include <cassert>
    3535#include <string>
    3636#include <list>
    3737#include <map>
    3838
    39 #include "util/Math.h"
    4039#include "util/OrxEnum.h"
    4140
  • code/trunk/src/core/ConfigValueContainer.cc

    r2662 r3196  
    3434#include "ConfigValueContainer.h"
    3535
    36 #include <fstream>
    37 
     36#include "util/Convert.h"
    3837#include "util/SubString.h"
    39 #include "util/Convert.h"
    4038#include "Language.h"
    41 #include "Identifier.h"
    42 
    43 
    4439
    4540namespace orxonox
     
    303298
    304299        if (token.size() > 0)
    305             success = ConvertValue(&index, token[0]);
     300            success = convertValue(&index, token[0]);
    306301
    307302        if (!success || index < 0 || index > (signed int)MAX_VECTOR_INDEX)
  • code/trunk/src/core/ConfigValueContainer.h

    r2662 r3196  
    4949#include <vector>
    5050
    51 #include "util/Math.h"
    5251#include "util/MultiType.h"
    5352#include "ConfigFileManager.h"
  • code/trunk/src/core/ConsoleCommand.h

    r2662 r3196  
    3232#include "CorePrereqs.h"
    3333
     34#include "ArgumentCompletionFunctions.h"
     35#include "CommandExecutor.h"
    3436#include "Executor.h"
    3537#include "Identifier.h"
    36 #include "CommandExecutor.h"
    37 #include "ArgumentCompletionFunctions.h"
    3838
    3939
  • code/trunk/src/core/ConsoleCommandCompilation.cc

    r1747 r3196  
    2828
    2929#include "ConsoleCommandCompilation.h"
    30 #include "ConsoleCommand.h"
     30
     31#include <fstream>
     32#include <set>
     33#include <string>
     34
    3135#include "util/Debug.h"
    3236#include "util/ExprParser.h"
     37#include "ConsoleCommand.h"
    3338
    3439namespace orxonox
     
    165170                COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << "'" << std::endl;
    166171            }
    167             return expr.getResult();
     172            return static_cast<float>(expr.getResult());
    168173        }
    169174        else
  • code/trunk/src/core/ConsoleCommandCompilation.h

    r1505 r3196  
    3232#include "CorePrereqs.h"
    3333
    34 #include <string>
    35 
    3634namespace orxonox
    3735{
  • code/trunk/src/core/Core.cc

    r3103 r3196  
    2929
    3030/**
    31     @file
    32     @brief Implementation of the Core class.
     31@file
     32@brief
     33    Implementation of the Core singleton with its global variables (avoids boost include)
    3334*/
    3435
     
    8182    static boost::filesystem::path logPath_g;                   //!< Path to the log file folder
    8283
     84    //! Static pointer to the singleton
    8385    Core* Core::singletonRef_s  = 0;
    8486
     
    365367        if (!bInitialized && this->bInitializeRandomNumberGenerator_)
    366368        {
    367             srand(time(0));
     369            srand(static_cast<unsigned int>(time(0)));
    368370            rand();
    369371            bInitialized = true;
     
    472474        If found it means that this is not an installed run, hence we
    473475        don't write the logs and config files to ~/.orxonox
     476    @throws
     477        GeneralException
    474478    */
    475479    void Core::checkDevBuild()
     
    532536        Checks for the log and the config directory and creates them
    533537        if necessary. Otherwise me might have problems opening those files.
     538    @throws
     539        orxonox::GeneralException if the directory to be created is a file.
    534540    */
    535541    void Core::createDirectories()
    536542    {
    537543        std::vector<std::pair<boost::filesystem::path, std::string> > directories;
    538         directories.push_back(std::pair<boost::filesystem::path, std::string>
    539             (boost::filesystem::path(configPath_g), "config"));
    540         directories.push_back(std::pair<boost::filesystem::path, std::string>
    541             (boost::filesystem::path(logPath_g),    "log"));
     544        directories.push_back(std::make_pair(boost::filesystem::path(configPath_g), "config"));
     545        directories.push_back(std::make_pair(boost::filesystem::path(logPath_g), "log"));
    542546
    543547        for (std::vector<std::pair<boost::filesystem::path, std::string> >::iterator it = directories.begin();
  • code/trunk/src/core/Core.h

    r2896 r3196  
    2929
    3030/**
    31     @file
    32     @brief Declaration of the Core class.
    33 
     31@file
     32@brief
     33    Declaration of the Core class.
     34@details
    3435    The Core class is a singleton, only used to configure some variables
    3536    in the core through the config-file.
     
    4546#include "util/OutputHandler.h"
    4647
    47 // boost::filesystem header has quite a large tail, use forward declaration
    48 namespace boost { namespace filesystem
    49 {
    50     struct path_traits;
    51     template<class String, class Traits> class basic_path;
    52     typedef basic_path< std::string, path_traits> path;
    53 } }
    54 
    5548namespace orxonox
    5649{
    57     //! The Core class is a singleton, only used to configure some config-values.
     50    /**
     51    @brief
     52        The Core class is a singleton used to configure the program basics.
     53    @details
     54        The class provides information about the media, config and log path.
     55        It determines those by the use of platform specific functions.
     56    */
    5857    class _CoreExport Core : public OrxonoxClass
    5958    {
    6059        public:
     60            /**
     61            @brief
     62                Determines the executable path, checks for build directory runs, creates
     63                the output directories and sets up the other core library singletons.
     64            @throws
     65                GeneralException
     66            */
    6167            Core();
    6268            ~Core();
     
    7682            static void tsetMediaPath(const std::string& path)
    7783            { assert(singletonRef_s); singletonRef_s->_tsetMediaPath(path); }
     84            //! Returns the path to the config files as boost::filesystem::path
    7885            static const boost::filesystem::path& getMediaPath();
     86            //! Returns the path to the config files as boost::filesystem::path
    7987            static const boost::filesystem::path& getConfigPath();
     88            //! Returns the path to the log files as boost::filesystem::path
    8089            static const boost::filesystem::path& getLogPath();
     90            //! Returns the path to the data files as std::string
    8191            static std::string getMediaPathString();
     92            //! Returns the path to the config files as std::string
    8293            static std::string getConfigPathString();
     94            //! Returns the path to the log files as std::string
    8395            static std::string getLogPathString();
    8496
    8597        private:
    86             Core(const Core&);
     98            Core(const Core&); //!< Don't use (undefined symbol)
    8799
    88100            void checkDevBuild();
  • code/trunk/src/core/CoreIncludes.h

    r2171 r3196  
    4343#include "CorePrereqs.h"
    4444
     45#include "util/Debug.h"
    4546#include "Identifier.h"
    4647#include "Factory.h"
    4748#include "ClassFactory.h"
    48 #include "Functor.h"
    49 #include "util/Debug.h"
     49#include "ObjectList.h"
    5050
    5151
     
    129129    orxonox::Factory::getIdentifier(networkID)
    130130
    131 /**
    132     @brief Registers a member function as callback when an object of 'type' is created.
    133     @param
    134 */
    135 #define RegisterConstructionCallback(ThisClassName, TargetClassName, FunctionName) \
    136     orxonox::ClassIdentifier<TargetClassName>::getIdentifier()->addConstructionCallback( \
    137         orxonox::createFunctor(&ThisClassName::FunctionName)->setObject(this))
    138 
    139131#endif /* _CoreIncludes_H__ */
  • code/trunk/src/core/CorePrereqs.h

    r2896 r3196  
    3636
    3737#include "OrxonoxConfig.h"
    38 
    39 #include <string>
    4038
    4139//-----------------------------------------------------------------------
     
    6462namespace orxonox
    6563{
    66   namespace XMLPort
    67   {
    68     enum Mode
     64    namespace XMLPort
    6965    {
    70       LoadObject,
    71       SaveObject,
    72       ExpandObject
     66        enum Mode
     67        {
     68            LoadObject,
     69            SaveObject,
     70            ExpandObject
     71        };
     72    }
     73
     74    namespace KeybindMode
     75    {
     76        enum Enum
     77        {
     78            OnPress,
     79            OnHold,
     80            OnRelease,
     81            None
     82        };
    7383    };
    74   }
    75 
    76   namespace KeybindMode
    77   {
    78     enum Enum
    79     {
    80       OnPress,
    81       OnHold,
    82       OnRelease,
    83       None
    84     };
    85   };
    86 
    87   typedef std::string LanguageEntryLabel;
    88 
    89   class ArgumentCompleter;
    90   class ArgumentCompletionListElement;
    91   class BaseFactory;
    92   class BaseMetaObjectListElement;
    93   class BaseObject;
    94   template <class T>
    95   class ClassFactory;
    96   template <class T>
    97   class ClassIdentifier;
    98   class ClassTreeMask;
    99   class ClassTreeMaskIterator;
    100   class ClassTreeMaskNode;
    101   class ClassTreeMaskObjectIterator;
    102   class Clock;
    103   class CommandEvaluation;
    104   class CommandExecutor;
    105   class CommandLine;
    106   class CommandLineArgument;
    107   class ConfigFile;
    108   class ConfigFileEntry;
    109   class ConfigFileEntryComment;
    110   class ConfigFileEntryValue;
    111   class ConfigFileManager;
    112   class ConfigFileSection;
    113   class ConfigValueContainer;
    114   class ConsoleCommand;
    115   class Core;
    116   struct Event;
    117   class EventContainer;
    118   class Executor;
    119   template <class T>
    120   class ExecutorMember;
    121   class ExecutorStatic;
    122   class Factory;
    123   class Functor;
    124   template <class T>
    125   class FunctorMember;
    126   class FunctorStatic;
    127   class Identifier;
    128   class IRC;
    129   template <class T>
    130   class Iterator;
    131   class IteratorBase;
    132   class Language;
    133   class LanguageEntry;
    134   class Loader;
    135   class LuaBind;
    136   class MetaObjectList;
    137   class MetaObjectListElement;
    138   class Namespace;
    139   class NamespaceNode;
    140   template <class T>
    141   class ObjectList;
    142   class ObjectListBase;
    143   class ObjectListBaseElement;
    144   template <class T>
    145   class ObjectListElement;
    146   template <class T>
    147   class ObjectListIterator;
    148   class OrxonoxClass;
    149   class Shell;
    150   class ShellListener;
    151   template <class T>
    152   class SubclassIdentifier;
    153   class TclBind;
    154   struct TclInterpreterBundle;
    155   class TclThreadManager;
    156   class Template;
    157   class Tickable;
    158   class XMLFile;
    159   class XMLNameListener;
    160   template <class T, class O>
    161   class XMLPortClassObjectContainer;
    162   template <class T>
    163   class XMLPortClassParamContainer;
    164   class XMLPortObjectContainer;
    165   class XMLPortParamContainer;
    166 
    167   // game states
    168   class Game;
    169   class GameState;
    170   struct GameStateTreeNode;
    171 
    172   // input
    173   class BaseCommand;
    174   class BufferedParamCommand;
    175   class Button;
    176   class CalibratorCallback;
    177   class ExtendedInputState;
    178   class HalfAxis;
    179   class InputBuffer;
    180   class InputManager;
    181   class InputState;
    182   class JoyStickHandler;
    183   class MouseHandler;
    184   class KeyBinder;
    185   class KeyDetector;
    186   class KeyHandler;
    187   class ParamCommand;
    188   class SimpleCommand;
    189   class SimpleInputState;
    190 }
     84
     85    typedef std::string LanguageEntryLabel;
     86
     87    class ArgumentCompleter;
     88    class ArgumentCompletionListElement;
     89    class BaseFactory;
     90    class BaseMetaObjectListElement;
     91    class BaseObject;
     92    template <class T>
     93    class ClassFactory;
     94    template <class T>
     95    class ClassIdentifier;
     96    class ClassTreeMask;
     97    class ClassTreeMaskIterator;
     98    class ClassTreeMaskNode;
     99    class ClassTreeMaskObjectIterator;
     100    class Clock;
     101    class CommandEvaluation;
     102    class CommandExecutor;
     103    class CommandLine;
     104    class CommandLineArgument;
     105    class ConfigFile;
     106    class ConfigFileEntry;
     107    class ConfigFileEntryComment;
     108    class ConfigFileEntryValue;
     109    class ConfigFileManager;
     110    class ConfigFileSection;
     111    class ConfigValueContainer;
     112    class ConsoleCommand;
     113    class Core;
     114    struct Event;
     115    class EventContainer;
     116    class Executor;
     117    template <class T>
     118    class ExecutorMember;
     119    class ExecutorStatic;
     120    class Factory;
     121    class Functor;
     122    template <class T>
     123    class FunctorMember;
     124    class FunctorStatic;
     125    class Identifier;
     126    class IRC;
     127    template <class T>
     128    class Iterator;
     129    class IteratorBase;
     130    class Language;
     131    class LanguageEntry;
     132    class Loader;
     133    class LuaBind;
     134    class MetaObjectList;
     135    class MetaObjectListElement;
     136    class Namespace;
     137    class NamespaceNode;
     138    template <class T>
     139    class ObjectList;
     140    class ObjectListBase;
     141    class ObjectListBaseElement;
     142    template <class T>
     143    class ObjectListElement;
     144    template <class T>
     145    class ObjectListIterator;
     146    class OrxonoxClass;
     147    class Shell;
     148    class ShellListener;
     149    template <class T>
     150    class SubclassIdentifier;
     151    class TclBind;
     152    struct TclInterpreterBundle;
     153    class TclThreadManager;
     154    class Template;
     155    class Tickable;
     156    class XMLFile;
     157    class XMLNameListener;
     158    template <class T, class O>
     159    class XMLPortClassObjectContainer;
     160    template <class T>
     161    class XMLPortClassParamContainer;
     162    class XMLPortObjectContainer;
     163    class XMLPortParamContainer;
     164
     165    // game states
     166    class Game;
     167    class GameState;
     168    struct GameStateTreeNode;
     169
     170    // input
     171    class BaseCommand;
     172    class BufferedParamCommand;
     173    class Button;
     174    class CalibratorCallback;
     175    class ExtendedInputState;
     176    class HalfAxis;
     177    class InputBuffer;
     178    class InputManager;
     179    class InputState;
     180    class JoyStickHandler;
     181    class MouseHandler;
     182    class KeyBinder;
     183    class KeyDetector;
     184    class KeyHandler;
     185    class ParamCommand;
     186    class SimpleCommand;
     187    class SimpleInputState;
     188}
     189
     190// CppTcl
     191namespace Tcl
     192{
     193    class interpreter;
     194    class object;
     195}
     196
     197// Boost
     198namespace boost { namespace filesystem
     199{
     200    struct path_traits;
     201    template <class String, class Traits> class basic_path;
     202    typedef basic_path<std::string, path_traits> path;
     203} }
     204
     205// TinyXML and TinyXML++
     206class TiXmlString;
     207class TiXmlOutStream;
     208class TiXmlNode;
     209class TiXmlHandle;
     210class TiXmlDocument;
     211class TiXmlElement;
     212class TiXmlComment;
     213class TiXmlUnknown;
     214class TiXmlAttribute;
     215class TiXmlText;
     216class TiXmlDeclaration;
     217class TiXmlParsingData;
     218namespace ticpp
     219{
     220    class Document;
     221    class Element;
     222    class Declaration;
     223    class StylesheetReference;
     224    class Text;
     225    class Comment;
     226    class Attribute;
     227}
     228namespace orxonox
     229{
     230    using ticpp::Document;
     231    using ticpp::Element;
     232    using ticpp::Declaration;
     233    using ticpp::StylesheetReference;
     234    using ticpp::Text;
     235    using ticpp::Comment;
     236    using ticpp::Attribute;
     237}
     238
    191239
    192240#endif /* _CorePrereqs_H__ */
  • code/trunk/src/core/Event.cc

    r2087 r3196  
    2828
    2929#include "Event.h"
     30
    3031#include "BaseObject.h"
    3132#include "Executor.h"
  • code/trunk/src/core/Event.h

    r2087 r3196  
    3131
    3232#include "CorePrereqs.h"
     33#include <string>
    3334
    3435namespace orxonox
  • code/trunk/src/core/EventIncludes.h

    r2087 r3196  
    3333#include "Executor.h"
    3434
    35 #define SetEvent(classname, eventname, functionname, event) \
    36     SetEventGeneric(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject)
     35#define ORXONOX_SET_EVENT(classname, eventname, functionname, event) \
     36    ORXONOX_SET_EVENT_GENERIC(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject)
    3737
    38 #define SetEventTemplate(classname, eventname, functionname, event, ...) \
    39     SetEventGenericTemplate(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject, __VA_ARGS__)
     38#define ORXONOX_SET_EVENT_TEMPLATE(classname, eventname, functionname, event, ...) \
     39    ORXONOX_SET_EVENT_GENERIC_TEMPLATE(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject, __VA_ARGS__)
    4040
    41 #define SetSubclassEvent(classname, eventname, functionname, event, subclassname) \
    42     SetEventGeneric(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname)
     41#define ORXONOX_SET_SUBCLASS_EVENT(classname, eventname, functionname, event, subclassname) \
     42    ORXONOX_SET_EVENT_GENERIC(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname)
    4343
    44 #define SetSubclassEventTemplate(classname, eventname, functionname, event, subclassname, ...) \
    45     SetEventGenericTemplate(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname, __VA_ARGS__)
     44#define ORXONOX_SET_SUBCLASS_EVENT_TEMPLATE(classname, eventname, functionname, event, subclassname, ...) \
     45    ORXONOX_SET_EVENT_GENERIC_TEMPLATE(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname, __VA_ARGS__)
    4646
    47 #define SetEventGeneric(containername, classname, eventname, functionname, event, subclassname) \
     47#define ORXONOX_SET_EVENT_GENERIC(containername, classname, eventname, functionname, event, subclassname) \
    4848    orxonox::EventContainer* containername = this->getEventContainer(eventname); \
    4949    if (!containername) \
     
    5757    containername->process(this, event)
    5858
    59 #define SetEventGenericTemplate(containername, classname, eventname, functionname, event, subclassname, ...) \
     59#define ORXONOX_SET_EVENT_GENERIC_TEMPLATE(containername, classname, eventname, functionname, event, subclassname, ...) \
    6060    orxonox::EventContainer* containername = this->getEventContainer(eventname); \
    6161    if (!containername) \
  • code/trunk/src/core/Executor.cc

    r1879 r3196  
    2929
    3030#include "Executor.h"
    31 #include "util/Math.h"
     31
    3232#include "util/Convert.h"
    3333#include "Language.h"
  • code/trunk/src/core/Executor.h

    r1889 r3196  
    3333#include "CorePrereqs.h"
    3434
     35#include "util/Debug.h"
     36#include "util/Math.h"
     37#include "util/String.h"
    3538#include "util/SubString.h"
    36 #include "util/String.h"
    37 #include "util/Math.h"
    3839#include "Functor.h"
    39 #include "util/Debug.h"
    4040
    4141
  • code/trunk/src/core/Factory.cc

    r2761 r3196  
    3333
    3434#include "Factory.h"
     35
     36#include "util/Debug.h"
    3537#include "Identifier.h"
    3638#include "BaseObject.h"
    37 #include "util/Debug.h"
    3839
    3940namespace orxonox
  • code/trunk/src/core/Functor.h

    r2710 r3196  
    3333#include "CorePrereqs.h"
    3434
     35#include "util/Debug.h"
    3536#include "util/MultiType.h"
    3637#include "util/String.h"
    37 #include "util/Debug.h"
    38 
    3938
    4039namespace orxonox
  • code/trunk/src/core/Game.cc

    r3084 r3196  
    3636
    3737#include <exception>
    38 #include <cassert>
     38#include <boost/weak_ptr.hpp>
    3939
    4040#include "util/Debug.h"
     
    5151namespace orxonox
    5252{
     53    using boost::shared_ptr;
     54    using boost::weak_ptr;
     55
    5356    static void stop_game()
    5457        { Game::getInstance().stop(); }
     
    5760    struct _CoreExport GameStateTreeNode
    5861    {
    59         GameState*                      state_;
    60         GameStateTreeNode*              parent_;
    61         std::vector<GameStateTreeNode*> children_;
     62        GameState* state_;
     63        weak_ptr<GameStateTreeNode> parent_;
     64        std::vector<shared_ptr<GameStateTreeNode> > children_;
    6265    };
    6366
     
    7376        assert(singletonRef_s == 0);
    7477        singletonRef_s = this;
    75 
    76         this->rootStateNode_ = 0;
    77         this->activeStateNode_ = 0;
    7878
    7979        this->abort_ = false;
     
    105105        // Destroy pretty much everyhting left
    106106        delete this->core_;
    107 
    108         // Delete all the created nodes
    109         for (std::vector<GameStateTreeNode*>::const_iterator it = this->allStateNodes_.begin(); it != this->allStateNodes_.end(); ++it)
    110             delete *it;
    111107
    112108        delete this->gameClock_;
     
    172168            {
    173169                // Note: this->requestedStateNodes_.front() is the currently active state node
    174                 std::vector<GameStateTreeNode*>::iterator it = this->requestedStateNodes_.begin() + 1;
    175                 if (*it == this->activeStateNode_->parent_)
     170                std::vector<shared_ptr<GameStateTreeNode> >::iterator it = this->requestedStateNodes_.begin() + 1;
     171                if (*it == this->activeStateNode_->parent_.lock())
    176172                    this->unloadState(this->activeStateNode_->state_);
    177173                else // has to be child
     
    194190
    195191                if ((*it)->getCountTickTime())
    196                     this->addTickTime(this->gameClock_->getRealMicroseconds() - timeBeforeTick);
     192                    this->addTickTime(static_cast<uint32_t>(this->gameClock_->getRealMicroseconds() - timeBeforeTick));
    197193            }
    198194
     
    216212
    217213                uint32_t framesPerPeriod = this->statisticsTickTimes_.size();
    218                 this->avgFPS_ = (float)framesPerPeriod / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0;
    219                 this->avgTickTime_ = (float)this->periodTickTime_ / framesPerPeriod / 1000.0;
     214                this->avgFPS_ = static_cast<float>(framesPerPeriod) / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0f;
     215                this->avgTickTime_ = static_cast<float>(this->periodTickTime_) / framesPerPeriod / 1000.0f;
    220216
    221217                this->periodTime_ -= this->statisticsRefreshCycle_;
     
    226222        while (!this->activeStates_.empty())
    227223            this->unloadState(this->activeStates_.back());
    228         this->activeStateNode_ = 0;
     224        this->activeStateNode_.reset();
    229225        this->requestedStateNodes_.clear();
    230226    }
     
    251247            return;
    252248
    253         GameStateTreeNode* requestedNode = 0;
     249        shared_ptr<GameStateTreeNode> requestedNode;
    254250
    255251        // this->requestedStateNodes_.back() is the currently active state
    256         GameStateTreeNode* lastRequestedNode = this->requestedStateNodes_.back();
     252        shared_ptr<GameStateTreeNode> lastRequestedNode = this->requestedStateNodes_.back();
    257253
    258254        // Already the active node?
     
    274270
    275271        // Check parent and all its grand parents
    276         GameStateTreeNode* currentNode = lastRequestedNode;
     272        shared_ptr<GameStateTreeNode> currentNode = lastRequestedNode;
    277273        while (requestedNode == NULL && currentNode != NULL)
    278274        {
    279275            if (currentNode->state_ == state)
    280276                requestedNode = currentNode;
    281             currentNode = currentNode->parent_;
     277            currentNode = currentNode->parent_.lock();
    282278        }
    283279
     
    297293    void Game::popState()
    298294    {
    299         if (this->activeStateNode_ != NULL && this->requestedStateNodes_.back()->parent_)
    300             this->requestState(this->requestedStateNodes_.back()->parent_->state_->getName());
     295        if (this->activeStateNode_ != NULL && this->requestedStateNodes_.back()->parent_.lock())
     296            this->requestState(this->requestedStateNodes_.back()->parent_.lock()->state_->getName());
    301297        else
    302298            COUT(2) << "Warning: Could not pop GameState. Ignoring." << std::endl;
     
    333329        }
    334330        unsigned int currentLevel = 0;
    335         GameStateTreeNode* currentNode = 0;
     331        shared_ptr<GameStateTreeNode> currentNode;
    336332        for (std::vector<std::pair<std::string, unsigned> >::const_iterator it = stateStrings.begin(); it != stateStrings.end(); ++it)
    337333        {
     
    346342                if (this->rootStateNode_ != NULL)
    347343                    ThrowException(GameState, "No two root GameStates are allowed!");
    348                 GameStateTreeNode* newNode = new GameStateTreeNode;
    349                 this->allStateNodes_.push_back(newNode);
     344                shared_ptr<GameStateTreeNode> newNode(new GameStateTreeNode);
    350345                newNode->state_ = newState;
    351                 newNode->parent_ = 0;
    352346                this->rootStateNode_ = newNode;
    353347                currentNode = this->rootStateNode_;
     
    355349            else if (currentNode)
    356350            {
    357                 GameStateTreeNode* newNode = new GameStateTreeNode;
    358                 this->allStateNodes_.push_back(newNode);
     351                shared_ptr<GameStateTreeNode> newNode(new GameStateTreeNode);
    359352                newNode->state_ = newState;
    360353                if (newLevel < currentLevel)
     
    362355                    // Get down the hierarchy
    363356                    do
    364                         currentNode = currentNode->parent_;
     357                        currentNode = currentNode->parent_.lock();
    365358                    while (newLevel < --currentLevel);
    366359                }
     
    369362                    // same level
    370363                    newNode->parent_ = currentNode->parent_;
    371                     newNode->parent_->children_.push_back(newNode);
     364                    newNode->parent_.lock()->children_.push_back(newNode);
    372365                }
    373366                else if (newLevel == currentLevel + 1)
  • code/trunk/src/core/Game.h

    r3084 r3196  
    3737
    3838#include "CorePrereqs.h"
     39
    3940#include <cassert>
    4041#include <list>
    4142#include <map>
     43#include <string>
    4244#include <vector>
     45#include <boost/shared_ptr.hpp>
     46#include <boost/preprocessor/cat.hpp>
     47
    4348#include "OrxonoxClass.h"
    4449
     
    4954*/
    5055#define AddGameState(classname, ...) \
    51     static bool MACRO_CONCATENATE(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(__VA_ARGS__))
     56    static bool BOOST_PP_CAT(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(__VA_ARGS__))
    5257
    5358// tolua_begin
     
    106111
    107112        std::vector<GameState*>         activeStates_;
    108         GameStateTreeNode*              rootStateNode_;
    109         GameStateTreeNode*              activeStateNode_;
    110         std::vector<GameStateTreeNode*> requestedStateNodes_;
    111         std::vector<GameStateTreeNode*> allStateNodes_;
     113        boost::shared_ptr<GameStateTreeNode> rootStateNode_;
     114        boost::shared_ptr<GameStateTreeNode> activeStateNode_;
     115        std::vector<boost::shared_ptr<GameStateTreeNode> > requestedStateNodes_;
    112116
    113117        Core*                           core_;
  • code/trunk/src/core/GameState.cc

    r3084 r3196  
    3434
    3535#include "GameState.h"
    36 #include <cassert>
     36
    3737#include "util/Debug.h"
    3838#include "util/Exception.h"
    39 #include "Clock.h"
     39#include "util/OrxAssert.h"
    4040
    4141namespace orxonox
  • code/trunk/src/core/GameState.h

    r3084 r3196  
    3838#include "CorePrereqs.h"
    3939
     40#include <map>
    4041#include <string>
    41 #include <map>
    42 #include "CorePrereqs.h"
    4342
    4443namespace orxonox
  • code/trunk/src/core/IRC.cc

    r1792 r3196  
    2929#include "IRC.h"
    3030
    31 #include <boost/thread/thread.hpp>
     31#include <cpptcl/cpptcl.h>
     32
     33#include "util/Convert.h"
    3234#include "ConsoleCommand.h"
     35#include "CoreIncludes.h"
    3336#include "TclThreadManager.h"
    34 #include "CoreIncludes.h"
    35 #include "util/Convert.h"
    36 
    3737
    3838namespace orxonox
  • code/trunk/src/core/IRC.h

    r2710 r3196  
    3232#include "CorePrereqs.h"
    3333
    34 #include <cpptcl/cpptcl.h>
     34#include <string>
    3535#include "OrxonoxClass.h"
    3636
  • code/trunk/src/core/Identifier.cc

    r2662 r3196  
    3636#include <ostream>
    3737
    38 #include "Factory.h"
     38#include "util/String.h"
    3939#include "ConfigValueContainer.h"
    4040#include "ConsoleCommand.h"
    41 #include "CommandExecutor.h"
     41#include "Factory.h"
    4242#include "XMLPort.h"
    4343
     
    6363        this->bHasConfigValues_ = false;
    6464        this->bHasConsoleCommands_ = false;
    65         this->bHasConstructionCallback_ = false;
    6665
    6766        this->children_ = new std::set<const Identifier*>();
     
    9392        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
    9493            delete (it->second);
    95         for (std::vector<Functor*>::iterator it = this->constructionCallbacks_.begin(); it != this->constructionCallbacks_.end(); ++it)
    96             delete *it;
    9794    }
    9895
     
    519516
    520517    /**
    521         @brief Adds a construction callback functor that gets called every time an object is created.
    522         @param functor Functor pointer to any function with no argument.
    523     */
    524     void Identifier::addConstructionCallback(Functor* functor)
    525     {
    526         for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
    527         {
    528             if (this->constructionCallbacks_[i] == functor)
    529                 return;
    530         }
    531         this->constructionCallbacks_.push_back(functor);
    532         this->bHasConstructionCallback_ = true;
    533     }
    534 
    535     /**
    536         @brief Removes a construction callback functor that gets called every time an object is created.
    537         @param functor Functor pointer to any function with no argument.
    538     */
    539     void Identifier::removeConstructionCallback(Functor* functor)
    540     {
    541         for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
    542         {
    543             if (this->constructionCallbacks_[i] == functor)
    544             {
    545                 this->constructionCallbacks_.erase(this->constructionCallbacks_.begin() + i);
    546             }
    547         }
    548         if (constructionCallbacks_.empty())
    549             this->bHasConstructionCallback_ = false;
    550     }
    551 
    552     /**
    553518        @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
    554519        @param out The outstream
  • code/trunk/src/core/Identifier.h

    r2784 r3196  
    5555#include "CorePrereqs.h"
    5656
     57#include <cassert>
     58#include <map>
    5759#include <set>
    58 #include <map>
    59 #include <vector>
    6060#include <string>
    61 #include <utility>
    6261#include <typeinfo>
    63 #include <cstdlib>
    64 #include <cassert>
    65 
     62
     63#include "util/Debug.h"
    6664#include "MetaObjectList.h"
    67 #include "Iterator.h"
     65#include "ObjectList.h"
     66#include "ObjectListBase.h"
    6867#include "Super.h"
    69 #include "Functor.h"
    70 #include "util/Debug.h"
    71 #include "util/String.h"
    7268
    7369namespace orxonox
     
    223219            /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */
    224220            inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }
    225             /** @brief Returns true if this class has at least one construction callback Functor registered. */
    226             inline bool hasConstructionCallback() const { return this->bHasConstructionCallback_; }
    227221
    228222            /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
     
    251245            ConsoleCommand* getConsoleCommand(const std::string& name) const;
    252246            ConsoleCommand* getLowercaseConsoleCommand(const std::string& name) const;
    253 
    254             void addConstructionCallback(Functor* functor);
    255             void removeConstructionCallback(Functor* functor);
    256247
    257248            void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
     
    276267            /** @brief Returns the direct children of the class the Identifier belongs to. @return The list of all direct children */
    277268            inline std::set<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }
    278 
    279             bool bHasConstructionCallback_;                                //!< True if at least one Functor is registered to get informed when an object of type T is created.
    280             std::vector<Functor*> constructionCallbacks_;                  //!< All construction callback Functors of this class.
    281269
    282270            ObjectListBase* objects_;                                      //!< The list of all objects of this class
     
    383371    */
    384372    template <class T>
    385     ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
     373    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
    386374    {
    387375        // check if the static field has already been filled
     
    398386    */
    399387    template <class T>
    400     ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier(const std::string& name)
     388    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier(const std::string& name)
    401389    {
    402390        ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
     
    435423    */
    436424    template <class T>
    437     void ClassIdentifier<T>::addObject(T* object)
     425    inline void ClassIdentifier<T>::addObject(T* object)
    438426    {
    439427        COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
    440428        object->getMetaList().add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
    441         if (this->bHasConstructionCallback_)
    442         {
    443             // Call all registered callbacks that a new object of type T has been created.
    444             // Do NOT deliver a T* pointer here because it's way too risky (object not yet fully created).
    445             for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
    446                 (*constructionCallbacks_[i])();
    447         }
    448429    }
    449430
  • code/trunk/src/core/Iterator.h

    r2896 r3196  
    4747#include "CorePrereqs.h"
    4848
     49#include "Identifier.h"
    4950#include "ObjectListBase.h"
    50 #include "ObjectListIterator.h"
    51 #include "OrxonoxClass.h"
    5251
    5352namespace orxonox
     
    305304}
    306305
    307 // Include ObjectList.h so the user only has to include one file: Iterator.h
    308 #include "ObjectList.h"
    309 
    310306#endif /* _Iterator_H__ */
  • code/trunk/src/core/Language.cc

    r2759 r3196  
    3737#include <boost/filesystem.hpp>
    3838
     39#include "util/Debug.h"
    3940#include "Core.h"
    40 #include "util/Debug.h"
    4141
    4242namespace orxonox
  • code/trunk/src/core/Loader.cc

    r3008 r3196  
    3232#include <boost/filesystem.hpp>
    3333
    34 #include "XMLFile.h"
     34#include "util/Debug.h"
     35#include "util/Exception.h"
    3536#include "BaseObject.h"
    36 #include "Identifier.h"
     37#include "Core.h"
    3738#include "Iterator.h"
    3839#include "ObjectList.h"
    39 #include "CoreIncludes.h"
    4040#include "LuaBind.h"
    4141#include "Namespace.h"
    42 #include "util/Debug.h"
    43 #include "util/Exception.h"
    44 #include "Core.h"
     42#include "XMLFile.h"
    4543
    4644namespace orxonox
  • code/trunk/src/core/Loader.h

    r3008 r3196  
    3333
    3434#include <vector>
    35 
    3635#include "ClassTreeMask.h"
    3736
  • code/trunk/src/core/LuaBind.cc

    r3068 r3196  
    3131#include <fstream>
    3232#include <map>
    33 
    3433extern "C" {
    35 #include <lua.h>
    3634#include <lualib.h>
    3735}
     
    3937#include <boost/filesystem.hpp>
    4038
     39#include "util/Debug.h"
    4140#include "util/String.h"
    42 #include "util/Debug.h"
    4341#include "ToluaBindCore.h"
    4442#include "Core.h"
     
    7270  }
    7371
    74   void LuaBind::luaPrint(std::string str)
     72  void LuaBind::luaPrint(const std::string& str)
    7573  {
    7674    output_ += str;
     
    8482      @param luaTags if true, the loaded file gets stripped off luaTags
    8583  */
    86   void LuaBind::loadFile(std::string filename, bool luaTags)
     84  void LuaBind::loadFile(const std::string& filename, bool luaTags)
    8785  {
    8886    boost::filesystem::path filepath(filename);
     
    117115  }
    118116
    119   void LuaBind::loadString(std::string code)
     117  void LuaBind::loadString(const std::string& code)
    120118  {
    121119    luaSource_ = code;
  • code/trunk/src/core/LuaBind.h

    r3068 r3196  
    3838#include "CorePrereqs.h"
    3939
     40#include <cassert>
     41#include <string>
    4042extern "C" {
    4143#include <lua.h>
    4244}
    43 
    44 #include <cassert>
    45 #include <list>
    46 #include <string>
    4745
    4846// tolua_begin
     
    6462      inline static LuaBind& getInstance() { assert(singletonRef_s); return *LuaBind::singletonRef_s; } // tolua_export
    6563
    66     void loadFile(std::string filename, bool luaTags);
    67     void loadString(std::string code);
     64    void loadFile(const std::string& filename, bool luaTags);
     65    void loadString(const std::string& code);
    6866    //void init(lua_State *state_);
    6967    //void xmlToLua();
    7068    void run();
    71     void luaPrint(std::string str); // tolua_export
     69    void luaPrint(const std::string& str); // tolua_export
    7270
    7371#if LUA_VERSION_NUM != 501
     
    7674
    7775    inline lua_State* getLuaState() { return luaState_; };
    78     inline std::string getLuaOutput() { return output_; };
     76    inline const std::string& getLuaOutput() { return output_; };
    7977    //inline std::string* getFileString() { return &fileString_; };
    8078    inline void clearLuaOutput() { output_ = ""; }
  • code/trunk/src/core/MetaObjectList.cc

    r2171 r3196  
    3333
    3434#include "MetaObjectList.h"
     35
     36#include "util/Debug.h"
     37#include "Identifier.h"
    3538#include "ObjectListBase.h"
    36 #include "Identifier.h"
    37 #include "util/Debug.h"
    3839
    3940namespace orxonox
  • code/trunk/src/core/Namespace.cc

    r2087 r3196  
    2828
    2929#include "Namespace.h"
     30
     31#include <set>
     32
    3033#include "NamespaceNode.h"
    3134#include "CoreIncludes.h"
  • code/trunk/src/core/Namespace.h

    r2087 r3196  
    3232#include "CorePrereqs.h"
    3333
    34 #include <map>
    35 
    36 #include "XMLIncludes.h"
     34#include <set>
     35#include <string>
    3736#include "BaseObject.h"
    3837
  • code/trunk/src/core/ObjectListBase.cc

    r2784 r3196  
    3535*/
    3636
     37#include "ObjectListBase.h"
     38
    3739#include <set>
    38 
    39 #include "CorePrereqs.h"
    40 
    41 #include "ObjectListBase.h"
    4240#include "Identifier.h"
    4341#include "Iterator.h"
     42#include "ObjectListIterator.h"
    4443
    4544namespace orxonox
  • code/trunk/src/core/ObjectListBase.h

    r2896 r3196  
    3838#define _ObjectListBase_H__
    3939
     40#include "CorePrereqs.h"
     41
    4042#include <vector>
    41 
    42 #include "CorePrereqs.h"
     43#include "OrxonoxClass.h"
    4344
    4445namespace orxonox
     
    139140
    140141        private:
    141             Identifier* identifier_;               //!< The Iterator owning this list
    142             ObjectListBaseElement* first_;         //!< The first element in the list
    143             ObjectListBaseElement* last_;          //!< The last element in the list
     142            Identifier* identifier_;                 //!< The Iterator owning this list
     143            ObjectListBaseElement* first_;           //!< The first element in the list
     144            ObjectListBaseElement* last_;            //!< The last element in the list
    144145            std::vector<void*> iterators_;           //!< A list of Iterators pointing on an element in this list
    145146            std::vector<void*> objectListIterators_; //!< A list of ObjectListIterators pointing on an element in this list
  • code/trunk/src/core/ObjectListIterator.h

    r2784 r3196  
    2828
    2929/**
    30     @file Iterator.h
     30    @file
    3131    @brief Definition and implementation of the Iterator class.
    3232
     
    4747
    4848#include "CorePrereqs.h"
    49 #include "ObjectListBase.h"
     49#include "Identifier.h"
     50#include "ObjectList.h"
    5051
    5152namespace orxonox
     
    230231}
    231232
    232 // Include ObjectList.h so the user only has to include one file: Iterator.h
    233 #include "ObjectList.h"
    234 
    235233#endif /* _ObjectListIterator_H__ */
  • code/trunk/src/core/OrxonoxClass.cc

    r2171 r3196  
    3333
    3434#include "OrxonoxClass.h"
     35
    3536#include "MetaObjectList.h"
    3637#include "Identifier.h"
  • code/trunk/src/core/OrxonoxClass.h

    r2171 r3196  
    3939
    4040#include "CorePrereqs.h"
    41 
    4241#include <set>
    43 #include <string>
    4442
    4543namespace orxonox
  • code/trunk/src/core/Shell.cc

    r2662 r3196  
    2828
    2929#include "Shell.h"
     30
     31#include "util/OutputHandler.h"
    3032#include "CommandExecutor.h"
    3133#include "CoreIncludes.h"
     
    3335#include "Core.h"
    3436#include "ConsoleCommand.h"
    35 #include "util/OutputHandler.h"
    3637
    3738#define SHELL_UPDATE_LISTENERS(function) \
  • code/trunk/src/core/Shell.h

    r1792 r3196  
    3232#include "CorePrereqs.h"
    3333
     34#include <cassert>
    3435#include <list>
     36#include <string>
    3537#include <vector>
    3638
  • code/trunk/src/core/Super.h

    r2662 r3196  
    6767#define _Super_H__
    6868
    69 #include <iostream>
    70 
    7169#include "CorePrereqs.h"
    7270
    7371#include "util/Debug.h"
    74 #include "XMLIncludes.h"
    7572#include "Event.h"
    7673
  • code/trunk/src/core/TclBind.cc

    r2710 r3196  
    2929#include "TclBind.h"
    3030
    31 #include <iostream>
     31#include <exception>
    3232#include <string>
    33 #include "ConsoleCommand.h"
    34 #include "CommandExecutor.h"
    35 #include "TclThreadManager.h"
     33#include <cpptcl/cpptcl.h>
     34
    3635#include "util/Debug.h"
    3736#include "util/String.h"
     37#include "CommandExecutor.h"
     38#include "ConsoleCommand.h"
     39#include "TclThreadManager.h"
    3840
    3941namespace orxonox
  • code/trunk/src/core/TclBind.h

    r2710 r3196  
    3232#include "CorePrereqs.h"
    3333
    34 #include <cpptcl/cpptcl.h>
     34#include <cassert>
     35#include <string>
    3536
    3637namespace orxonox
  • code/trunk/src/core/TclThreadManager.cc

    r2896 r3196  
    2929#include "TclThreadManager.h"
    3030
    31 #include <iostream>
    32 #include <string>
    33 #include <boost/thread/thread.hpp>
    3431#include <boost/bind.hpp>
    3532#include <OgreTimer.h>
    36 
     33#include <cpptcl/cpptcl.h>
     34
     35#include "util/Convert.h"
     36#include "util/Debug.h"
    3737#include "Clock.h"
     38#include "CommandExecutor.h"
     39#include "ConsoleCommand.h"
    3840#include "CoreIncludes.h"
    39 #include "ConsoleCommand.h"
    40 #include "CommandExecutor.h"
    4141#include "TclBind.h"
    42 #include "util/Debug.h"
    43 #include "util/Convert.h"
    44 
    4542
    4643namespace orxonox
  • code/trunk/src/core/TclThreadManager.h

    r2896 r3196  
    3232#include "CorePrereqs.h"
    3333
    34 #include <queue>
     34#include <list>
    3535#include <map>
    36 #include <list>
    37 
     36#include <string>
     37#include <boost/thread/condition.hpp>
    3838#include <boost/thread/mutex.hpp>
    39 #include <boost/thread/condition.hpp>
    4039#include <boost/thread/thread.hpp>
    4140
    42 #include <cpptcl/cpptcl.h>
    4341#include "core/OrxonoxClass.h"
    4442
  • code/trunk/src/core/Template.cc

    r3068 r3196  
    2929#include "Template.h"
    3030
     31#include <tinyxml/tinyxml.h>
    3132#include <tinyxml/ticpp.h>
    3233
     34#include "util/Debug.h"
    3335#include "core/CoreIncludes.h"
    3436#include "core/XMLPort.h"
    35 #include "util/Debug.h"
    3637
    3738namespace orxonox
     
    3940    CreateFactory(Template);
    4041
    41     Template::Template(BaseObject* creator) : BaseObject(creator), xmlelement_("")
     42    Template::Template(BaseObject* creator) : BaseObject(creator)
    4243    {
     44        this->xmlelement_ = new TiXmlElement("");
     45
    4346        RegisterObject(Template);
    4447
     
    5255    {
    5356        Template::getTemplateMap().erase(this->getName());
     57        delete this->xmlelement_;
    5458    }
    5559
     
    9094    }
    9195
     96    void Template::setXMLElement(const TiXmlElement& xmlelement)
     97    {
     98        *this->xmlelement_ = xmlelement;
     99    }
     100
    92101    const TiXmlElement& Template::getXMLElement() const
    93102    {
     
    115124        }
    116125
    117         return this->xmlelement_;
     126        return *this->xmlelement_;
    118127    }
    119128
  • code/trunk/src/core/Template.h

    r3068 r3196  
    3030#define _Template_H__
    3131
    32 #include <map>
    33 
    3432#include "CorePrereqs.h"
    3533
    36 #include <tinyxml/tinyxml.h>
     34#include <map>
     35#include <string>
    3736#include "BaseObject.h"
    3837
     
    5857                { return this->bLoadDefaults_; }
    5958
    60             inline void setXMLElement(const TiXmlElement& xmlelement)
    61                 { this->xmlelement_ = xmlelement; }
     59            void setXMLElement(const TiXmlElement& xmlelement);
    6260            const TiXmlElement& getXMLElement() const;
    6361
     
    7573
    7674        private:
    77             TiXmlElement xmlelement_;
     75            TiXmlElement* xmlelement_;
    7876            std::string link_;
    7977            std::string baseclass_;
  • code/trunk/src/core/XMLFile.h

    r3068 r3196  
    3333
    3434#include <string>
    35 
    3635#include "ClassTreeMask.h"
    3736
  • code/trunk/src/core/XMLPort.cc

    r1789 r3196  
    2828
    2929#include "XMLPort.h"
    30 #include "Language.h"
     30
    3131#include "Loader.h"
    3232#include "Namespace.h"
    33 #include "CoreIncludes.h"
    3433
    3534namespace orxonox
     
    4039    bool XMLPortObjectContainer::identifierIsIncludedInLoaderMask(const Identifier* identifier)
    4140    {
    42         return ((!this->bApplyLoaderMask_) || identifier->isA(Class(Namespace)) || Loader::currentMask_s.isIncluded(identifier));
     41        return ((!this->bApplyLoaderMask_) || identifier->isA(ClassIdentifier<Namespace>::getIdentifier()) || Loader::currentMask_s.isIncluded(identifier));
    4342    }
    4443}
  • code/trunk/src/core/XMLPort.h

    r2896 r3196  
    4444
    4545#include <cassert>
     46#include <string>
    4647#include <tinyxml/ticpp.h>
     48
    4749#include "util/Debug.h"
    4850#include "util/Exception.h"
    4951#include "util/MultiType.h"
    50 #include "XMLIncludes.h"
     52#include "util/OrxAssert.h"
     53#include "Factory.h"
     54#include "Identifier.h"
    5155#include "Executor.h"
    52 #include "CoreIncludes.h"
    5356#include "BaseObject.h"
    5457
     
    176179*/
    177180#define XMLPortParamGeneric(containername, classname, objectclass, object, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
    178     orxonox::XMLPortClassParamContainer<objectclass>* containername = (orxonox::XMLPortClassParamContainer<objectclass>*)(ClassIdentifier<classname>::getIdentifier()->getXMLPortParamContainer(paramname)); \
     181    orxonox::XMLPortClassParamContainer<objectclass>* containername = static_cast<orxonox::XMLPortClassParamContainer<objectclass>*>(ClassIdentifier<classname>::getIdentifier()->getXMLPortParamContainer(paramname)); \
    179182    if (!containername) \
    180183    { \
     
    545548                            for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++)
    546549                            {
    547                                 Identifier* identifier = ClassByString(child->Value());
     550                                Identifier* identifier = Factory::getIdentifier(child->Value());
    548551                                if (identifier)
    549552                                {
    550                                     if (identifier->isA(Class(O)))
     553                                    if (identifier->isA(ClassIdentifier<O>::getIdentifier()))
    551554                                    {
    552555                                        if (identifier->isLoadable())
     
    606609                                    else
    607610                                    {
    608                                         COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << Class(O)->getName() << "'." << std::endl;
     611                                        COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << ClassIdentifier<O>::getIdentifier()->getName() << "'." << std::endl;
    609612                                    }
    610613                                }
     
    626629                    {
    627630                        COUT(1) << std::endl;
    628                         COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ":" << std::endl;
     631                        COUT(1) << "An error occurred in XMLPort.h while loading a '" << ClassIdentifier<O>::getIdentifier()->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ":" << std::endl;
    629632                        COUT(1) << ex.what() << std::endl;
    630633                    }
  • code/trunk/src/core/input/CMakeLists.txt

    r2710 r3196  
    11ADD_SOURCE_FILES(CORE_SRC_FILES
    22  Button.cc
    3   CalibratorCallback.cc
    43  ExtendedInputState.cc
    54  HalfAxis.cc
  • code/trunk/src/core/input/ExtendedInputState.cc

    r2896 r3196  
    3636
    3737#include <cassert>
    38 #include "util/Debug.h"
     38#include "core/Executor.h"
    3939
    4040namespace orxonox
     
    457457        this->bHandlersChanged_ = true;
    458458    }
     459
     460    void ExtendedInputState::onEnter()
     461    {
     462        if (executorOnEnter_)
     463            (*executorOnEnter_)();
     464    }
     465
     466    void ExtendedInputState::onLeave()
     467    {
     468        if (executorOnLeave_)
     469            (*executorOnLeave_)();
     470    }
    459471}
  • code/trunk/src/core/input/ExtendedInputState.h

    r2896 r3196  
    3838
    3939#include <vector>
    40 
    4140#include "InputInterfaces.h"
    4241#include "InputState.h"
     
    8988        void update();
    9089
     90        void onEnter();
     91        void onLeave();
     92
    9193        std::vector<KeyHandler*>                    keyHandlers_;
    9294        std::vector<MouseHandler*>                  mouseHandlers_;
  • code/trunk/src/core/input/HalfAxis.h

    r2087 r3196  
    3737
    3838#include "core/CorePrereqs.h"
     39
    3940#include "Button.h"
    4041#include "InputCommands.h"
  • code/trunk/src/core/input/InputBuffer.cc

    r2896 r3196  
    2828
    2929#include "InputBuffer.h"
    30 
    31 #include <iostream>
    3230
    3331#include "util/Clipboard.h"
     
    5755    }
    5856
    59     InputBuffer::InputBuffer(const std::string allowedChars)
     57    InputBuffer::InputBuffer(const std::string& allowedChars)
    6058    {
    6159        RegisterRootObject(InputBuffer);
  • code/trunk/src/core/input/InputBuffer.h

    r2896 r3196  
    3232#include "core/CorePrereqs.h"
    3333
     34#include <list>
    3435#include <string>
    35 #include <list>
    36 
    3736#include "core/OrxonoxClass.h"
    3837#include "InputInterfaces.h"
     
    8079            InputBuffer();
    8180            ~InputBuffer();
    82             InputBuffer(const std::string allowedChars);
     81            InputBuffer(const std::string& allowedChars);
    8382
    8483            void setConfigValues();
     
    145144            void updated(const char& update, bool bSingleInput);
    146145
    147             inline std::string get() const
     146            inline const std::string& get() const
    148147                { return this->buffer_; }
    149148            inline unsigned int getSize() const
  • code/trunk/src/core/input/InputCommands.cc

    r2087 r3196  
    3535#include "InputCommands.h"
    3636#include "util/Math.h"
    37 #include "core/CommandExecutor.h"
    3837
    3938namespace orxonox
  • code/trunk/src/core/input/InputInterfaces.h

    r2896 r3196  
    3838#include "core/CorePrereqs.h"
    3939
    40 #include "ois/OISKeyboard.h"
    41 #include "ois/OISMouse.h"
    42 #include "ois/OISJoyStick.h"
     40#include <ois/OISKeyboard.h>
     41#include <ois/OISMouse.h>
     42#include <ois/OISJoyStick.h>
    4343#include "util/Math.h"
    4444
  • code/trunk/src/core/input/InputManager.cc

    r3084 r3196  
    3838#include <climits>
    3939#include <cassert>
    40 
    41 #include "ois/OISException.h"
    42 #include "ois/OISInputManager.h"
    43 #include "core/ConsoleCommand.h"
    44 
    45 // HACK
    46 #ifdef ORXONOX_PLATFORM_LINUX
    47 #  include "ois/linux/LinuxMouse.h"
    48 #endif
    49 
     40#include <ois/OISException.h>
     41#include <ois/OISInputManager.h>
     42
     43#include "util/Convert.h"
    5044#include "util/Exception.h"
     45#include "util/Debug.h"
    5146#include "core/Clock.h"
    5247#include "core/CoreIncludes.h"
    5348#include "core/ConfigValueIncludes.h"
    54 #include "core/CommandExecutor.h"
     49#include "core/ConsoleCommand.h"
    5550#include "core/CommandLine.h"
    56 #include "util/Debug.h"
    5751
    5852#include "InputBuffer.h"
    59 #include "KeyBinder.h"
    6053#include "KeyDetector.h"
    61 #include "CalibratorCallback.h"
    6254#include "InputState.h"
    6355#include "SimpleInputState.h"
    6456#include "ExtendedInputState.h"
    6557#include "JoyStickDeviceNumberListener.h"
     58
     59// HACK (include this as last, X11 seems to define some macros...)
     60#ifdef ORXONOX_PLATFORM_LINUX
     61#  include <ois/linux/LinuxMouse.h>
     62#endif
    6663
    6764namespace orxonox
     
    367364        for (unsigned int i = 0; i < configValueVectorSize; ++i)
    368365        {
    369             list[i] = omni_cast<int>(ConfigFileManager::getInstance().getValue(
    370                 ConfigFileType::JoyStickCalibration, sectionName, valueName, i, omni_cast<std::string>(defaultValue), false));
     366            list[i] = multi_cast<int>(ConfigFileManager::getInstance().getValue(
     367                ConfigFileType::JoyStickCalibration, sectionName, valueName, i, multi_cast<std::string>(defaultValue), false));
    371368        }
    372369
     
    403400            // Generate some sort of execution unique id per joy stick
    404401            std::string id = "JoyStick_";
    405             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button))  + "_";
    406             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis))    + "_";
    407             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider))  + "_";
    408             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV))     + "_";
    409             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
     402            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button))  + "_";
     403            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis))    + "_";
     404            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider))  + "_";
     405            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV))     + "_";
     406            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
    410407            id += joySticks_[iJoyStick]->vendor();
    411408            for (unsigned int i = 0; i < iJoyStick; ++i)
     
    414411                {
    415412                    // Two joysticks are probably equal --> add the index as well
    416                     id += "_" + omni_cast<std::string>(iJoyStick);
     413                    id += "_" + multi_cast<std::string>(iJoyStick);
    417414                }
    418415            }
     
    497494                    joyStickMinValues_[iJoyStick][i] = -32768;
    498495                ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
    499                     this->joyStickIDs_[iJoyStick], "MinValue", i, omni_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
     496                    this->joyStickIDs_[iJoyStick], "MinValue", i, multi_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
    500497
    501498                // Maximum values
     
    503500                    joyStickMaxValues_[iJoyStick][i] = 32767;
    504501                ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
    505                     this->joyStickIDs_[iJoyStick], "MaxValue", i, omni_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
     502                    this->joyStickIDs_[iJoyStick], "MaxValue", i, multi_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
    506503
    507504                // Middle values
    508505                ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
    509                     this->joyStickIDs_[iJoyStick], "MiddleValue", i, omni_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
     506                    this->joyStickIDs_[iJoyStick], "MiddleValue", i, multi_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
    510507            }
    511508        }
     
    11691166        else
    11701167        {
    1171             float fValue = value - joyStickCalibrations_[iJoyStick].middleValue[axis];
     1168            float fValue = static_cast<float>(value - joyStickCalibrations_[iJoyStick].middleValue[axis]);
    11721169            if (fValue > 0.0f)
    11731170                fValue *= joyStickCalibrations_[iJoyStick].positiveCoeff[axis];
  • code/trunk/src/core/input/InputManager.h

    r3084 r3196  
    4040
    4141#include <map>
     42#include <set>
     43#include <string>
    4244#include <vector>
    43 #include <stack>
     45#include <ois/OISKeyboard.h>
     46#include <ois/OISMouse.h>
     47#include <ois/OISJoyStick.h>
     48
    4449#include "util/Math.h"
    4550#include "util/OrxEnum.h"
  • code/trunk/src/core/input/InputState.h

    r2896 r3196  
    3939#include <string>
    4040#include <vector>
    41 #include "core/Executor.h"
    4241#include "InputInterfaces.h"
    4342
     
    6362        void resetHandlersChanged() { bHandlersChanged_ = false; }
    6463
    65         virtual void onEnter() { if (executorOnEnter_) (*executorOnEnter_)(); }
    66         virtual void onLeave() { if (executorOnLeave_) (*executorOnLeave_)(); }
     64        virtual void onEnter() = 0;
     65        virtual void onLeave() = 0;
    6766
    6867        virtual void registerOnEnter(Executor* executor)      { executorOnEnter_ = executor; }
     
    9291        InputState()
    9392            : bHandlersChanged_(false)
     93            , executorOnEnter_(0)
     94            , executorOnLeave_(0)
    9495            , priority_(0)
    9596            , bAlwaysGetsInput_(false)
    9697            , bTransparent_(false)
    97             , executorOnEnter_(0)
    98             , executorOnLeave_(0)
    9998        { }
    10099        virtual ~InputState() { }
     
    108107
    109108        bool bHandlersChanged_;
     109        Executor*                                   executorOnEnter_;
     110        Executor*                                   executorOnLeave_;
    110111
    111112    private:
     
    123124        bool                                        bAlwaysGetsInput_;
    124125        bool                                        bTransparent_;
    125 
    126         Executor*                                   executorOnEnter_;
    127         Executor*                                   executorOnLeave_;
    128126    };
    129127}
  • code/trunk/src/core/input/KeyBinder.cc

    r2896 r3196  
    3333
    3434#include "KeyBinder.h"
    35 
    36 #include <fstream>
    37 #include <string>
    3835
    3936#include "util/Convert.h"
     
    320317                    {
    321318                        mouseAxes_[2*i + 0].absVal_
    322                             = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
     319                            = -mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
    323320                        mouseAxes_[2*i + 1].absVal_ = 0.0f;
    324321                    }
     
    327324                        mouseAxes_[2*i + 0].absVal_ = 0.0f;
    328325                        mouseAxes_[2*i + 1].absVal_
    329                             =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
     326                            =  mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
    330327                    }
    331328                    else
  • code/trunk/src/core/input/KeyBinder.h

    r2896 r3196  
    3838#include "core/CorePrereqs.h"
    3939
     40#include <cassert>
     41#include <string>
    4042#include <vector>
    41 #include <cassert>
    4243
    4344#include "InputInterfaces.h"
  • code/trunk/src/core/input/KeyDetector.cc

    r1887 r3196  
    3434
    3535#include "KeyDetector.h"
     36
    3637#include "util/Debug.h"
    3738#include "core/CoreIncludes.h"
    38 #include "core/CommandExecutor.h"
    39 #include "core/CommandEvaluation.h"
    40 #include "InputCommands.h"
    4139#include "Button.h"
    4240
  • code/trunk/src/core/input/KeyDetector.h

    r1887 r3196  
    3838#include "core/CorePrereqs.h"
    3939
     40#include <string>
    4041#include "KeyBinder.h"
    4142
  • code/trunk/src/core/input/SimpleInputState.cc

    r1887 r3196  
    3434
    3535#include "SimpleInputState.h"
     36#include "core/Executor.h"
    3637
    3738namespace orxonox
     
    148149        bHandlersChanged_ = true;
    149150    }
     151
     152    void SimpleInputState::onEnter()
     153    {
     154        if (executorOnEnter_)
     155            (*executorOnEnter_)();
     156    }
     157
     158    void SimpleInputState::onLeave()
     159    {
     160        if (executorOnLeave_)
     161            (*executorOnLeave_)();
     162    }
    150163}
  • code/trunk/src/core/input/SimpleInputState.h

    r2896 r3196  
    7979        void update();
    8080        void numberOfJoySticksChanged(unsigned int n);
     81
     82        void onEnter();
     83        void onLeave();
    8184
    8285        KeyHandler*                   keyHandler_;
  • code/trunk/src/cpptcl/CMakeLists.txt

    r2710 r3196  
    3131  details/methods_v.h
    3232)
    33 GENERATE_SOURCE_GROUPS(${CPPTCL_FILES})
    3433
    3534# No warnings needed from third party libraries
     
    3736ADD_COMPILER_FLAGS("-w")
    3837
    39 IF(MSVC)
    40   ADD_LIBRARY(cpptcl_orxonox STATIC ${CPPTCL_FILES})
    41 ELSE()
    42   ADD_LIBRARY(cpptcl_orxonox SHARED ${CPPTCL_FILES})
    43   ORXONOX_INSTALL(cpptcl_orxonox)
    44 ENDIF()
    45 
    46 TARGET_LINK_LIBRARIES(cpptcl_orxonox ${TCL_LIBRARY})
    47 
    48 SET_TARGET_PROPERTIES(cpptcl_orxonox PROPERTIES VERSION 1.1.3)
     38ORXONOX_ADD_LIBRARY(cpptcl_orxonox
     39  ORXONOX_EXTERNAL
     40  NO_DLL_INTERFACE
     41  VERSION
     42    1.1.3
     43  LINK_LIBRARIES
     44    ${TCL_LIBRARY}
     45  SOURCE_FILES
     46    ${CPPTCL_FILES}
     47)
  • code/trunk/src/network/CMakeLists.txt

    r3084 r3196  
    3737ADD_SUBDIRECTORY(packet)
    3838ADD_SUBDIRECTORY(synchronisable)
    39 GET_ALL_HEADER_FILES(NETWORK_HDR_FILES)
    40 SET(NETWORK_FILES ${NETWORK_SRC_FILES} ${NETWORK_HDR_FILES})
    4139
    42 GENERATE_SOURCE_GROUPS(${NETWORK_FILES})
    43 
    44 ADD_LIBRARY(network SHARED ${NETWORK_FILES})
    45 SET_TARGET_PROPERTIES(network PROPERTIES DEFINE_SYMBOL "NETWORK_SHARED_BUILD")
    46 TARGET_LINK_LIBRARIES(network
    47   ${ZLIB_LIBRARY}
    48   ${ENET_LIBRARY}
    49   ${Boost_THREAD_LIBRARY}
    50   util
    51   core
     40ORXONOX_ADD_LIBRARY(network
     41  FIND_HEADER_FILES
     42  DEFINE_SYMBOL
     43    "NETWORK_SHARED_BUILD"
     44  PCH_FILE
     45    NetworkPrecompiledHeaders.h
     46  LINK_LIBRARIES
     47    ${ZLIB_LIBRARY}
     48    ${ENET_LIBRARY}
     49    ${Boost_THREAD_LIBRARY}
     50    util
     51    core
     52  SOURCE_FILES
     53    ${NETWORK_SRC_FILES}
    5254)
    53 
    54 ORXONOX_INSTALL(network)
  • code/trunk/src/network/GamestateClient.cc

    r3102 r3196  
    3434#include "core/CoreIncludes.h"
    3535#include "core/BaseObject.h"
    36 #include "core/Iterator.h"
    3736#include "synchronisable/Synchronisable.h"
    3837#include "synchronisable/NetworkCallbackManager.h"
  • code/trunk/src/network/Host.h

    r3084 r3196  
    3636namespace orxonox {
    3737
    38   const int CLIENTID_SERVER = 0;
     38  const unsigned int CLIENTID_SERVER = 0;
    3939  const unsigned int NETWORK_FREQUENCY = 30;
    4040  const float NETWORK_PERIOD = 1.0f/NETWORK_FREQUENCY;
  • code/trunk/src/network/NetworkFunction.h

    r3084 r3196  
    3636#include <map>
    3737#include <cassert>
     38#include <boost/preprocessor/cat.hpp>
    3839#include "util/MultiType.h"
     40#include "core/Functor.h"
    3941#include "synchronisable/Synchronisable.h"
    4042#include "OrxonoxConfig.h"
     
    214216
    215217#define registerStaticNetworkFunction( functionPointer ) \
    216   static void* MACRO_CONCATENATE( NETWORK_FUNCTION_, __LINE__ ) = registerStaticNetworkFunctionFct( functionPointer, #functionPointer );
     218  static void* BOOST_PP_CAT( NETWORK_FUNCTION_, __LINE__ ) = registerStaticNetworkFunctionFct( functionPointer, #functionPointer );
    217219#define registerMemberNetworkFunction( class, function ) \
    218   static void* MACRO_CONCATENATE( NETWORK_FUNCTION_##class, __LINE__ ) = registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function);
     220  static void* BOOST_PP_CAT( NETWORK_FUNCTION_##class, __LINE__ ) = registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function);
    219221  // call it with functionPointer, clientID, args
    220222#define callStaticNetworkFunction( functionPointer, ...) \
  • code/trunk/src/network/Server.cc

    r3102 r3196  
    5454#include "core/ConsoleCommand.h"
    5555#include "core/CoreIncludes.h"
    56 #include "core/Iterator.h"
    5756#include "packet/Chat.h"
    5857#include "packet/Packet.h"
  • code/trunk/src/network/packet/Gamestate.cc

    r3084 r3196  
    3636#include "core/GameMode.h"
    3737#include "core/CoreIncludes.h"
    38 #include "core/Iterator.h"
    3938
    4039
  • code/trunk/src/ogreceguirenderer/CMakeLists.txt

    r2710 r3196  
    2727  OgreCEGUITexture.cpp
    2828)
    29 GENERATE_SOURCE_GROUPS(${OCR_FILES})
    3029
    3130# No warnings needed from third party libraries
     
    3332ADD_COMPILER_FLAGS("-w")
    3433
    35 ADD_LIBRARY(ogreceguirenderer_orxonox SHARED ${OCR_FILES})
    36 SET_TARGET_PROPERTIES(ogreceguirenderer_orxonox PROPERTIES DEFINE_SYMBOL "OGRE_GUIRENDERER_EXPORTS")
    37 TARGET_LINK_LIBRARIES(ogreceguirenderer_orxonox
    38   ${OGRE_LIBRARY}
    39   ${CEGUI_LIBRARY}
     34ORXONOX_ADD_LIBRARY(ogreceguirenderer_orxonox
     35  ORXONOX_EXTERNAL
     36  LINK_LIBRARIES
     37    ${OGRE_LIBRARY}
     38    ${CEGUI_LIBRARY}
     39  DEFINE_SYMBOL
     40    "OGRE_GUIRENDERER_EXPORTS"
     41  VERSION
     42    1.4.9
     43  SOURCE_FILES
     44    ${OCR_FILES}
    4045)
    41 
    42 SET_TARGET_PROPERTIES(ogreceguirenderer_orxonox PROPERTIES VERSION 1.4.9)
    43 
    44 ORXONOX_INSTALL(ogreceguirenderer_orxonox)
  • code/trunk/src/ois/CMakeLists.txt

    r2710 r3196  
    5050ENDIF()
    5151
    52 GENERATE_SOURCE_GROUPS(${OIS_FILES})
    53 
    5452# No warnings needed from third party libraries
    5553REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC)
     
    5856INCLUDE_DIRECTORIES(.)
    5957
    60 ADD_LIBRARY(ois_orxonox SHARED ${OIS_FILES})
    61 SET_TARGET_PROPERTIES(ois_orxonox PROPERTIES DEFINE_SYMBOL "OIS_NONCLIENT_BUILD")
     58ORXONOX_ADD_LIBRARY(ois_orxonox
     59  ORXONOX_EXTERNAL
     60  DEFINE_SYMBOL
     61    "OIS_NONCLIENT_BUILD"
     62  VERSION
     63    1.2
     64  SOURCE_FILES
     65    ${OIS_FILES}
     66)
    6267
    6368IF(WIN32)
    6469  TARGET_LINK_LIBRARIES(ois_orxonox ${DIRECTX_LIBRARIES})
    6570ENDIF()
    66 
    67 SET_TARGET_PROPERTIES(ois_orxonox PROPERTIES VERSION 1.2)
    68 
    69 ORXONOX_INSTALL(ois_orxonox)
  • code/trunk/src/orxonox/CMakeLists.txt

    r3110 r3196  
    2828ADD_SUBDIRECTORY(gamestates)
    2929ADD_SUBDIRECTORY(gui)
     30ADD_SUBDIRECTORY(interfaces)
    3031ADD_SUBDIRECTORY(objects)
    3132ADD_SUBDIRECTORY(overlays)
     33ADD_SUBDIRECTORY(sound)
    3234ADD_SUBDIRECTORY(tools)
    33 ADD_SUBDIRECTORY(sound)
    34 GET_ALL_HEADER_FILES(ORXONOX_HDR_FILES)
    35 SET(ORXONOX_FILES ${ORXONOX_SRC_FILES} ${ORXONOX_HDR_FILES})
    3635
    37 GENERATE_SOURCE_GROUPS(${ORXONOX_FILES})
    38 GENERATE_TOLUA_BINDINGS(Orxonox ORXONOX_FILES INPUTFILES gui/GUIManager.h objects/quest/QuestManager.h objects/quest/QuestDescription.h objects/pickup/PickupInventory.h objects/pickup/BaseItem.h)
     36# Translate argument
     37IF(ORXONOX_USE_WINMAIN)
     38  SET(ORXONOX_WIN32 WIN32)
     39ENDIF()
    3940
    40 ADD_EXECUTABLE(orxonox ${ORXONOX_FILES})
     41ORXONOX_ADD_EXECUTABLE(orxonox
     42  FIND_HEADER_FILES
     43  TOLUA_FILES
     44    gui/GUIManager.h
     45    objects/pickup/BaseItem.h
     46    objects/pickup/PickupInventory.h
     47    objects/quest/QuestDescription.h
     48    objects/quest/QuestManager.h
     49  PCH_FILE
     50    OrxonoxPrecompiledHeaders.h
     51  PCH_NO_DEFAULT
     52  # When defined as WIN32 this removes the console window on Windows
     53  ${ORXONOX_WIN32}
     54  LINK_LIBRARIES
     55    ${OGRE_LIBRARY}
     56    ${CEGUI_LIBRARY}
     57    ${LUA_LIBRARIES}
     58    ${CEGUILUA_LIBRARY}
     59    ${Boost_SYSTEM_LIBRARY}
     60    ${OPENAL_LIBRARY}
     61    ${ALUT_LIBRARY}
     62    ${VORBISFILE_LIBRARY}
     63    ${VORBIS_LIBRARY}
     64    ${OGG_LIBRARY}
     65    ogreceguirenderer_orxonox
     66    tinyxml++_orxonox
     67    tolua++_orxonox
     68    bullet_orxonox
     69    util
     70    core
     71    network
     72  SOURCE_FILES ${ORXONOX_SRC_FILES}
     73)
     74
    4175GET_TARGET_PROPERTY(_exec_loc orxonox LOCATION)
    4276GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
    4377SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
    44 
    45 TARGET_LINK_LIBRARIES(orxonox
    46   ${OGRE_LIBRARY}
    47   ${CEGUI_LIBRARY}
    48   ${LUA_LIBRARIES}
    49   ${CEGUILUA_LIBRARY}
    50   ${Boost_SYSTEM_LIBRARY}
    51   ${OPENAL_LIBRARY}
    52   ${ALUT_LIBRARY}
    53   ${VORBISFILE_LIBRARY}
    54   ${VORBIS_LIBRARY}
    55   ${OGG_LIBRARY}
    56   ogreceguirenderer_orxonox
    57   tinyxml++_orxonox
    58   tolua++_orxonox
    59   bullet_orxonox
    60   util
    61   core
    62   network
    63 )
    64 
    65 ORXONOX_INSTALL(orxonox)
    6678
    6779
     
    8193  STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
    8294         VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
    83   CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox.vcproj.user" "${CMAKE_CURRENT_BINARY_DIR}/orxonox.vcproj.user")
     95  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox.vcproj.user")
    8496ENDIF(MSVC)
  • code/trunk/src/orxonox/CameraManager.cc

    r3110 r3196  
    3030#include <OgreSceneManager.h>
    3131#include <OgreViewport.h>
    32 #include <OgreCamera.h>
    3332#include <OgreCompositorManager.h>
    34 #include <OgreResource.h>
    3533
     34#include "util/String.h"
    3635#include "core/GameMode.h"
    37 #include "core/Iterator.h"
     36#include "core/ObjectList.h"
     37#include "tools/Shader.h"
    3838#include "objects/worldentities/Camera.h"
    3939#include "objects/Scene.h"
    40 #include "tools/Shader.h"
    41 #include "util/String.h"
    4240#include "gui/GUIManager.h"
    4341
  • code/trunk/src/orxonox/CameraManager.h

    r3068 r3196  
    4040#include <cassert>
    4141#include <list>
    42 #include <OgrePrerequisites.h>
     42#include "util/OgreForwardRefs.h"
    4343
    4444namespace orxonox
     
    5555            void releaseFocus(Camera* camera);
    5656
     57            void useCamera(Ogre::Camera* camera);
     58
    5759            static CameraManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
    5860            static CameraManager* getInstancePtr() { return singletonRef_s; }
    5961
    60             void useCamera(Ogre::Camera* camera);
     62        private:
     63            CameraManager(const CameraManager&); // don't use
    6164
    62         private:
    63             CameraManager(const CameraManager&);
    64 
    65             std::list<Camera*> cameraList_;
    66             Ogre::Viewport* viewport_;
    67             Ogre::Camera* fallbackCamera_;
     65            std::list<Camera*>    cameraList_;
     66            Ogre::Viewport*       viewport_;
     67            Ogre::Camera*         fallbackCamera_;
    6868
    6969            static CameraManager* singletonRef_s;
  • code/trunk/src/orxonox/GraphicsManager.cc

    r3110 r3196  
    5252
    5353#include "SpecialConfig.h"
    54 #include "util/Debug.h"
    5554#include "util/Exception.h"
    5655#include "util/String.h"
     
    6362#include "core/Game.h"
    6463#include "core/GameMode.h"
    65 #include "tools/WindowEventListener.h"
    6664#include "tools/ParticleInterface.h"
     65#include "interfaces/WindowEventListener.h"
     66
     67// HACK!
     68#include "overlays/map/Map.h"
    6769
    6870namespace orxonox
     
    8890        , viewport_(0)
    8991        , ogreWindowEventListener_(0)
    90         , avgTickTime_(0.0f)
    91         , avgFramesPerSecond_(0.0f)
    9292    {
    9393        RegisterObject(GraphicsManager);
     
    144144//            Ogre::RenderSystem* renderer = this->ogreRoot_->getRenderSystem();
    145145//            renderer->destroyRenderWindow("Orxonox");
     146
     147            // HACK! This fixes an exit crash
     148            Map::hackDestroyMap();
    146149
    147150            // unload all compositors
  • code/trunk/src/orxonox/GraphicsManager.h

    r2896 r3196  
    3939#include "OrxonoxPrereqs.h"
    4040
     41#include <cassert>
    4142#include <string>
    42 #include <cassert>
    4343#include <OgreLog.h>
    44 
    4544#include "core/OrxonoxClass.h"
    4645
     
    6665            { return this->detailLevelParticle_; }
    6766
    68         inline Ogre::Viewport* getViewport() const
     67        inline Ogre::Viewport* getViewport()
    6968            { return this->viewport_; }
    7069        inline Ogre::RenderWindow* getRenderWindow()
     
    7372        void setCamera(Ogre::Camera* camera);
    7473
    75         static GraphicsManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
     74        inline static GraphicsManager& getInstance()
     75            { assert(singletonRef_s); return *singletonRef_s; }
    7676
    7777    private:
     
    101101        OgreWindowEventListener* ogreWindowEventListener_;
    102102
    103         // stats (Hack)
    104         float               avgTickTime_;              //!< time in ms to tick() one frame
    105         float               avgFramesPerSecond_;       //!< number of frames processed in one second
    106 
    107103        // config values
    108104        unsigned int        detailLevelParticle_;      //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
  • code/trunk/src/orxonox/LevelManager.cc

    r3110 r3196  
    2929#include "LevelManager.h"
    3030
     31#include <map>
    3132#include "PlayerManager.h"
    3233#include "objects/Level.h"
  • code/trunk/src/orxonox/LevelManager.h

    r2171 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <cassert>
    3435#include <list>
    35 #include <map>
    36 #include <cassert>
    3736
    3837namespace orxonox
     
    5756
    5857            std::list<Level*> levels_s;
     58
    5959            static LevelManager* singletonRef_s;
    6060    };
  • code/trunk/src/orxonox/Main.cc

    r3110 r3196  
    2828 */
    2929 
    30  /**
    31  @mainpage Orxonox Documentation
    32  */
     30/**
     31@file
     32@brief
     33    Entry point of the program.
     34*/
    3335
    34  /**
    35  @file
    36  @brief Entry point of the program.
    37   */
    38 
    39 #include "OrxonoxConfig.h"
     36#include "OrxonoxPrereqs.h"
    4037
    4138#include "util/Debug.h"
     
    4744    Main method. Game starts here (except for static initialisations).
    4845*/
     46#ifdef ORXONOX_USE_WINMAIN
     47INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
     48#else
    4949int main(int argc, char** argv)
     50#endif
    5051{
    5152    {
  • code/trunk/src/orxonox/OrxonoxPrereqs.h

    r3099 r3196  
    247247    template <class T>
    248248    class Timer;
    249     class DynamicLines;
    250     class DynamicRenderable;
    251249
    252250    // overlays
     
    254252    class DebugFPSText;
    255253    class DebugRTRText;
     254    class GUIOverlay;
    256255    class HUDBar;
    257256    class HUDNavigation;
     
    288287namespace Ogre
    289288{
    290     // some got forgotten in OgrePrerequisites
    291     class BorderPanelOverlayElement;
    292     class PanelOverlayElement;
    293     class TextAreaOverlayElement;
     289    // OGRE Wiki adapted code
     290    class DynamicLines;
     291    class DynamicRenderable;
    294292}
    295293
    296294namespace CEGUI
    297295{
     296    class DefaultLogger;
    298297    class LuaScriptModule;
    299298
     
    304303
    305304// Bullet Physics Engine
    306 
    307305class btTransform;
    308306class btVector3;
     
    324322class btSequentialImpulseConstraintSolver;
    325323
    326 // lua
     324// ALUT
     325typedef struct ALCcontext_struct ALCcontext;
     326typedef struct ALCdevice_struct ALCdevice;
     327typedef unsigned int ALuint;
     328typedef int ALint;
     329
     330// Lua
    327331struct lua_State;
    328332
  • code/trunk/src/orxonox/PawnManager.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "objects/worldentities/pawns/Pawn.h"
    33 
    3433
    3534namespace orxonox
  • code/trunk/src/orxonox/PawnManager.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include "objects/Tickable.h"
     33#include "interfaces/Tickable.h"
    3434
    3535namespace orxonox
  • code/trunk/src/orxonox/PlayerManager.cc

    r3110 r3196  
    2929#include "PlayerManager.h"
    3030
    31 #include "LevelManager.h"
     31#include "core/CoreIncludes.h"
    3232#include "core/GameMode.h"
    33 #include "core/CoreIncludes.h"
    3433#include "objects/Level.h"
    3534#include "objects/infos/HumanPlayer.h"
     35#include "LevelManager.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/PlayerManager.h

    r2662 r3196  
    4444            virtual ~PlayerManager();
    4545
    46             static PlayerManager& getInstance()
    47             { assert(singletonRef_s); return *singletonRef_s; }
     46            inline static PlayerManager& getInstance()
     47                { assert(singletonRef_s); return *singletonRef_s; }
    4848
    4949            PlayerInfo* getClient(unsigned int clientID) const;
  • code/trunk/src/orxonox/gamestates/GSClient.cc

    r3110 r3196  
    2929#include "GSClient.h"
    3030
    31 #include "core/input/InputManager.h"
     31#include "util/Exception.h"
    3232#include "core/Clock.h"
    3333#include "core/CommandLine.h"
  • code/trunk/src/orxonox/gamestates/GSClient.h

    r2896 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
    3334#include "core/GameState.h"
    3435#include "network/NetworkPrereqs.h"
  • code/trunk/src/orxonox/gamestates/GSDedicated.cc

    r3110 r3196  
    2929#include "GSDedicated.h"
    3030
     31#include "util/Debug.h"
     32#include "util/Sleep.h"
    3133#include "core/Clock.h"
    3234#include "core/CommandLine.h"
    3335#include "core/Game.h"
    3436#include "core/GameMode.h"
    35 #include "core/Iterator.h"
    3637#include "network/Server.h"
    37 #include "objects/Tickable.h"
    38 #include "util/Sleep.h"
    3938
    4039namespace orxonox
  • code/trunk/src/orxonox/gamestates/GSDedicated.h

    r2896 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
    3334#include "core/GameState.h"
    3435#include "network/NetworkPrereqs.h"
  • code/trunk/src/orxonox/gamestates/GSGraphics.cc

    r3110 r3196  
    2828
    2929/**
    30     @file
    31     @brief Implementation of Graphics GameState class.
     30@file
     31@brief
     32    Implementation of Graphics GameState class.
    3233 */
    3334
     
    3738#include <OgreRenderWindow.h>
    3839
    39 #include "util/Debug.h"
    4040#include "core/ConfigValueIncludes.h"
    4141#include "core/Clock.h"
     
    5252#include "overlays/console/InGameConsole.h"
    5353#include "gui/GUIManager.h"
     54#include "sound/SoundManager.h"
    5455#include "GraphicsManager.h"
    5556
     
    6465        , guiManager_(0)
    6566        , graphicsManager_(0)
     67        , soundManager_(0)
    6668        , masterKeyBinder_(0)
    6769        , masterInputState_(0)
     
    9597        \li creates input manager
    9698        \li loads master key bindings
     99        \li loads the SoundManager
    97100        \li loads ingame console
    98101        \li loads GUI interface (GUIManager)
     
    128131        masterKeyBinder_->loadBindings("masterKeybindings.ini");
    129132        masterInputState_->setKeyHandler(masterKeyBinder_);
     133
     134        // Load the SoundManager
     135        soundManager_ = new SoundManager();
    130136
    131137        // Load the InGameConsole
     
    173179        delete this->debugOverlay_;
    174180
     181        delete this->soundManager_;
     182
    175183        delete this->inputManager_;
    176184        this->inputManager_ = 0;
  • code/trunk/src/orxonox/gamestates/GSGraphics.h

    r3084 r3196  
    2727 */
    2828
    29  /**
    30     @file
    31     @brief Declaration of the Graphics GameState class.
    32   */
     29/**
     30@file
     31@brief
     32    Declaration of the Graphics GameState class.
     33*/
    3334
    3435#ifndef _GSGraphics_H__
     
    3637
    3738#include "OrxonoxPrereqs.h"
     39
    3840#include "core/GameState.h"
    39 #include "tools/WindowEventListener.h"
     41#include "interfaces/WindowEventListener.h"
    4042
    4143namespace orxonox
    4244{
    4345    /**
    44     @class GSGraphics
    4546    @brief
    46         Game state used when displaying graphics of any kind
     47        Game state used when displaying graphics of any kind. Another blubb resides here.
    4748
    4849        This game state is only left out if we start a dedicated server where no graphics are present.
     
    7172        GUIManager*           guiManager_;          //!< Interface to GUI
    7273        GraphicsManager*      graphicsManager_;     //!< Interface to Ogre
     74        SoundManager*         soundManager_;        //!< Keeps track of SoundBase objects
    7375
    7476        KeyBinder*            masterKeyBinder_;     //!< Key binder for master key bindings
  • code/trunk/src/orxonox/gamestates/GSIOConsole.cc

    r3110 r3196  
    3030
    3131#include <iostream>
    32 #include <OgreFrameListener.h>
    33 #include <OgreRoot.h>
    34 #include <OgreTimer.h>
    3532
    3633#include "core/ConsoleCommand.h"
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r3110 r3196  
    3333#include "core/input/SimpleInputState.h"
    3434#include "core/input/KeyBinder.h"
    35 #include "core/Loader.h"
    36 #include "core/XMLFile.h"
    37 #include "core/CommandExecutor.h"
     35#include "core/Clock.h"
     36#include "core/CommandLine.h"
    3837#include "core/ConsoleCommand.h"
    39 #include "core/CommandLine.h"
    4038#include "core/ConfigValueIncludes.h"
    41 #include "core/Core.h"
    4239#include "core/CoreIncludes.h"
    4340#include "core/Game.h"
    4441#include "core/GameMode.h"
    45 #include "objects/Tickable.h"
     42#include "core/Core.h"
     43#include "core/Loader.h"
     44#include "core/XMLFile.h"
     45
     46#include "interfaces/Tickable.h"
    4647#include "objects/Radar.h"
     48#include "objects/quest/QuestManager.h"
     49#include "overlays/notifications/NotificationManager.h"
     50#include "gui/GUIManager.h"
    4751#include "CameraManager.h"
    4852#include "GraphicsManager.h"
    4953#include "LevelManager.h"
    5054#include "PlayerManager.h"
    51 #include "gui/GUIManager.h"
    52 #include "objects/quest/QuestManager.h"
    53 #include "overlays/notifications/NotificationManager.h"
    5455
    5556namespace orxonox
     
    148149        if (show)
    149150        {
    150             GUIManager::getInstancePtr()->showGUI("inGameTest");
    151             GUIManager::getInstancePtr()->executeCode("showCursor()");
     151            GUIManager::getInstance().showGUI("inGameTest");
     152            GUIManager::getInstance().executeCode("showCursor()");
    152153            InputManager::getInstance().requestEnterState("guiMouseOnly");
    153154        }
    154155        else
    155156        {
    156             GUIManager::getInstancePtr()->executeCode("hideGUI(\"inGameTest\")");
    157             GUIManager::getInstancePtr()->executeCode("hideCursor()");
     157            GUIManager::getInstance().executeCode("hideGUI(\"inGameTest\")");
     158            GUIManager::getInstance().executeCode("hideCursor()");
    158159            InputManager::getInstance().requestLeaveState("guiMouseOnly");
    159160        }
  • code/trunk/src/orxonox/gamestates/GSLevel.h

    r3008 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <string>
    3335#include "core/OrxonoxClass.h"
    3436#include "core/GameState.h"
     
    4850
    4951        static void showIngameGUI(bool show);
    50         static void setLevel(std::string levelName);
    5152
    5253        static XMLFile* startFile_s;
     
    6970        LevelManager*         levelManager_;            //!< global level manager
    7071        PlayerManager*        playerManager_;           //!< player manager for this level
    71         QuestManager*          questManager_;
     72        QuestManager*         questManager_;
    7273        NotificationManager*  notificationManager_;
    7374
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r3110 r3196  
    2929#include "GSMainMenu.h"
    3030
    31 //#include <OgreViewport.h>
    3231#include <OgreSceneManager.h>
     32
     33#include "core/input/InputManager.h"
     34#include "core/input/SimpleInputState.h"
     35#include "core/Game.h"
    3336#include "core/Clock.h"
    3437#include "core/ConsoleCommand.h"
    35 #include "core/Game.h"
    36 #include "core/input/InputManager.h"
    37 #include "core/input/SimpleInputState.h"
     38#include "objects/Scene.h"
    3839#include "gui/GUIManager.h"
    39 #include "objects/Scene.h"
     40#include "sound/SoundMainMenu.h"
    4041#include "GraphicsManager.h"
    41 #include "sound/SoundMainMenu.h"
    4242
    4343namespace orxonox
  • code/trunk/src/orxonox/gamestates/GSMainMenu.h

    r3094 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include <OgrePrerequisites.h>
     33
     34#include "util/OgreForwardRefs.h"
    3435#include "core/GameState.h"
    3536
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r3110 r3196  
    2929#include "GSRoot.h"
    3030
    31 #include "util/Exception.h"
    32 #include "util/Debug.h"
    3331#include "core/Clock.h"
     32#include "core/CommandLine.h"
     33#include "core/ConsoleCommand.h"
    3434#include "core/Game.h"
    3535#include "core/GameMode.h"
    36 #include "core/CommandLine.h"
    37 #include "core/ConsoleCommand.h"
    38 #include "tools/TimeFactorListener.h"
    3936#include "tools/Timer.h"
    40 #include "objects/Tickable.h"
     37#include "interfaces/TimeFactorListener.h"
     38#include "interfaces/Tickable.h"
    4139
    4240namespace orxonox
  • code/trunk/src/orxonox/gamestates/GSRoot.h

    r3084 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333#include "core/GameState.h"
    34 #include "core/OrxonoxClass.h"
    3534
    3635namespace orxonox
  • code/trunk/src/orxonox/gamestates/GSServer.cc

    r3110 r3196  
    2929#include "GSServer.h"
    3030
     31#include "util/Debug.h"
    3132#include "core/CommandLine.h"
    3233#include "core/Game.h"
  • code/trunk/src/orxonox/gamestates/GSServer.h

    r2896 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
    3334#include "core/GameState.h"
    3435#include "network/NetworkPrereqs.h"
  • code/trunk/src/orxonox/gamestates/GSStandalone.cc

    r3110 r3196  
    2929#include "GSStandalone.h"
    3030
    31 #include <OgreViewport.h>
    32 #include <OgreCamera.h>
    3331#include "core/Game.h"
    3432#include "core/GameMode.h"
    35 #include "core/ConsoleCommand.h"
    36 #include "gui/GUIManager.h"
    37 #include "GraphicsManager.h"
    3833
    3934namespace orxonox
  • code/trunk/src/orxonox/gui/GUIManager.cc

    r3110 r3196  
    2424 *      Benjamin Knecht
    2525 *   Co-authors:
    26  *
     26 *      ...
    2727 *
    2828 */
    2929
    3030/**
    31     @file
    32     @brief
    33         Implementation of the GUIManager class.
     31@file
     32@brief
     33    Implementation of the GUIManager class.
    3434*/
    3535
    3636#include "GUIManager.h"
    3737
    38 #include <boost/filesystem/path.hpp>
    39 #include <OgreRenderWindow.h>
    40 #include <CEGUI.h>
     38extern "C" {
     39#include <lua.h>
     40}
    4141#include <CEGUIDefaultLogger.h>
     42#include <CEGUIExceptions.h>
     43#include <CEGUIInputEvent.h>
     44#include <CEGUIResourceProvider.h>
     45#include <CEGUISystem.h>
    4246#include <ogreceguirenderer/OgreCEGUIRenderer.h>
     47
    4348#include "SpecialConfig.h" // Configures the macro below
    4449#ifdef CEGUILUA_USE_INTERNAL_LIBRARY
     
    4954
    5055#include "util/Exception.h"
    51 #include "core/ConsoleCommand.h"
    5256#include "core/Core.h"
    5357#include "core/Clock.h"
     
    5660#include "core/Loader.h"
    5761
    58 extern "C" {
    59 #include <lua.h>
    60 }
    61 
    6262namespace orxonox
    6363{
     64    static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
    6465    GUIManager* GUIManager::singletonRef_s = 0;
    6566
     
    139140
    140141                // Create our own logger to specify the filepath
    141                 boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");
    142142                this->ceguiLogger_ = new DefaultLogger();
    143                 this->ceguiLogger_->setLogFilename(ceguiLogFilepath.string());
     143                this->ceguiLogger_->setLogFilename(Core::getLogPathString() + "cegui.log");
    144144                // set the log level according to ours (translate by subtracting 1)
    145145                this->ceguiLogger_->setLoggingLevel(
     
    271271        Returns false if the Overlay was already present.
    272272    */
    273     bool GUIManager::registerOverlay(std::string name, GUIOverlay* overlay)
     273    bool GUIManager::registerOverlay(const std::string& name, GUIOverlay* overlay)
    274274    {
    275275        return (this->guiOverlays_.insert(std::pair<std::string, GUIOverlay*>(name, overlay))).second;
     
    284284        Returns a pointer to the GUIOverlay.
    285285    */
    286     GUIOverlay* GUIManager::getOverlay(std::string name)
     286    GUIOverlay* GUIManager::getOverlay(const std::string& name)
    287287    {
    288288        return (this->guiOverlays_.find(name))->second;
     
    340340    }
    341341
     342    void GUIManager::keyPressed(const KeyEvent& evt)
     343    {
     344        guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text);
     345    }
     346    void GUIManager::keyReleased(const KeyEvent& evt)
     347    {
     348        guiSystem_->injectKeyUp(evt.key);
     349    }
     350
    342351    /**
    343352    @brief
     
    382391            COUT(1) << ex.getMessage() << std::endl;
    383392        }
     393    }
     394
     395    void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
     396    {
     397        guiSystem_->injectMouseMove(static_cast<float>(rel.x), static_cast<float>(rel.y));
     398    }
     399    void GUIManager::mouseScrolled(int abs, int rel)
     400    {
     401        guiSystem_->injectMouseWheelChange(static_cast<float>(rel));
    384402    }
    385403
     
    394412        Simple convertion from mouse event code in Orxonox to the one used in CEGUI.
    395413     */
    396     inline CEGUI::MouseButton GUIManager::convertButton(MouseButtonCode::ByEnum button)
     414    static inline CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button)
    397415    {
    398416        switch (button)
  • code/trunk/src/orxonox/gui/GUIManager.h

    r3008 r3196  
    2222 *   Author:
    2323 *      Reto Grieder
     24 *      Benjamin Knecht
    2425 *   Co-authors:
    25  *      Benjamin Knecht
     26 *      ...
    2627 *
    2728 */
    2829
    2930/**
    30     @file
    31     @brief Declaration of the GUIManager class.
     31@file
     32@brief
     33    Declaration of the GUIManager class.
    3234*/
    3335
     
    3638
    3739#include "OrxonoxPrereqs.h"
    38 #include <OgrePrerequisites.h>
     40
     41#include <map>
     42#include <string>
    3943#include <CEGUIForwardRefs.h>
    40 #include <CEGUIInputEvent.h>
    41 #include <CEGUISystem.h>
     44
     45#include "util/OgreForwardRefs.h"
    4246#include "core/input/InputInterfaces.h"
    43 #include <map>
    44 #include "overlays/GUIOverlay.h"
    45 
    46 // Forward declaration
    47 namespace CEGUI { class DefaultLogger; }
    4847
    4948// tolua_begin
     
    8988        void executeCode(const std::string& str);
    9089
    91         bool registerOverlay(std::string name, GUIOverlay* overlay); //!< Register a GUIOverlay with the GUIManager.
    92         GUIOverlay* getOverlay(std::string name); // Get the GUIOverlay of the GUI with the given name.
     90        bool registerOverlay(const std::string& name, GUIOverlay* overlay); //!< Register a GUIOverlay with the GUIManager.
     91        GUIOverlay* getOverlay(const std::string& name); // Get the GUIOverlay of the GUI with the given name.
    9392
    9493        void setCamera(Ogre::Camera* camera);
     
    105104
    106105        // keyHandler functions
    107         void keyPressed (const KeyEvent& evt)
    108             { guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text); }
    109         void keyReleased(const KeyEvent& evt)
    110             { guiSystem_->injectKeyUp(evt.key); }
     106        void keyPressed (const KeyEvent& evt);
     107        void keyReleased(const KeyEvent& evt);
    111108        void keyHeld    (const KeyEvent& evt) { }
    112109
     
    115112        void mouseButtonReleased(MouseButtonCode::ByEnum id);
    116113        void mouseButtonHeld    (MouseButtonCode::ByEnum id) { }
    117         void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    118             { guiSystem_->injectMouseMove(rel.x, rel.y); }
    119         void mouseScrolled      (int abs, int rel)
    120             { guiSystem_->injectMouseWheelChange(rel);}
     114        void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
     115        void mouseScrolled      (int abs, int rel);
    121116
    122117        void updateInput(float dt)  { }
    123118        void updateKey  (float dt)  { }
    124119        void updateMouse(float dt)  { }
    125 
    126         static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
    127120
    128121        Ogre::RenderWindow*         renderWindow_;      //!< Ogre's render window to give CEGUI access to it
  • code/trunk/src/orxonox/objects/CMakeLists.txt

    r3099 r3196  
    33  EventDispatcher.cc
    44  EventTarget.cc
    5   GametypeMessageListener.cc
    65  GlobalShader.cc
    76  Level.cc
    87  Radar.cc
    9   RadarListener.cc
    10   RadarViewable.cc
    11   Teamcolourable.cc
    12   Tickable.cc
    138  Scene.cc
    149  Script.cc
  • code/trunk/src/orxonox/objects/EventDispatcher.cc

    r3110 r3196  
    3232#include "core/EventIncludes.h"
    3333#include "core/XMLPort.h"
    34 #include "core/EventIncludes.h"
    3534#include "EventTarget.h"
    3635
  • code/trunk/src/orxonox/objects/EventDispatcher.h

    r2087 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <list>
    3335#include "core/BaseObject.h"
    3436
  • code/trunk/src/orxonox/objects/EventListener.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/EventIncludes.h"
    3332#include "core/XMLPort.h"
    3433
  • code/trunk/src/orxonox/objects/EventListener.h

    r2087 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <string>
    3335#include "core/BaseObject.h"
    3436#include "core/XMLNameListener.h"
  • code/trunk/src/orxonox/objects/EventTarget.cc

    r3110 r3196  
    2828
    2929#include "EventTarget.h"
    30 
    3130#include "core/CoreIncludes.h"
    32 #include "core/EventIncludes.h"
    3331
    3432namespace orxonox
  • code/trunk/src/orxonox/objects/EventTarget.h

    r2087 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
    3334#include "core/BaseObject.h"
    3435#include "core/XMLNameListener.h"
  • code/trunk/src/orxonox/objects/GlobalShader.cc

    r3110 r3196  
    2929#include "GlobalShader.h"
    3030
     31#include "util/Exception.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/XMLPort.h"
    3334#include "objects/Scene.h"
    34 #include "util/Exception.h"
    3535
    3636namespace orxonox
  • code/trunk/src/orxonox/objects/Level.cc

    r3110 r3196  
    2929#include "Level.h"
    3030
     31#include "util/Math.h"
     32#include "core/Core.h"
    3133#include "core/CoreIncludes.h"
     34#include "core/Loader.h"
     35#include "core/Template.h"
     36#include "core/XMLFile.h"
    3237#include "core/XMLPort.h"
    33 #include "core/Loader.h"
    34 #include "core/XMLFile.h"
    35 #include "core/Template.h"
    36 #include "core/Core.h"
    3738
    38 #include "LevelManager.h"
    3939#include "objects/infos/PlayerInfo.h"
    4040#include "objects/gametypes/Gametype.h"
    4141#include "overlays/OverlayGroup.h"
    4242#include "sound/SoundBase.h"
    43 
    44 #include "util/Math.h"
     43#include "LevelManager.h"
    4544
    4645namespace orxonox
  • code/trunk/src/orxonox/objects/Level.h

    r3068 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <list>
     35#include <string>
     36#include "core/BaseObject.h"
    3437#include "network/synchronisable/Synchronisable.h"
    35 #include "core/BaseObject.h"
    3638
    3739namespace orxonox
  • code/trunk/src/orxonox/objects/Radar.cc

    r3110 r3196  
    2828
    2929/**
    30     @file
    31     @brief
     30@file
     31@brief
    3232*/
    3333
    3434#include "Radar.h"
    35 #include <cfloat>
     35
    3636#include <cassert>
    37 #include "core/CoreIncludes.h"
     37
     38//#include "util/Math.h"
    3839#include "core/ConsoleCommand.h"
    39 #include "core/Iterator.h"
    40 #include "RadarListener.h"
     40#include "core/ObjectList.h"
     41#include "interfaces/RadarListener.h"
    4142
    4243namespace orxonox
  • code/trunk/src/orxonox/objects/Radar.h

    r1818 r3196  
    2828
    2929/**
    30     @file
    31     @brief
     30@file
     31@brief
    3232*/
    3333
     
    3939#include <map>
    4040#include <string>
    41 #include "core/Iterator.h"
    42 #include "core/OrxonoxClass.h"
    43 #include "objects/Tickable.h"
    44 #include "RadarViewable.h"
     41
     42#include "core/ObjectListIterator.h"
     43#include "interfaces/RadarViewable.h"
     44#include "interfaces/Tickable.h"
    4545
    4646namespace orxonox
  • code/trunk/src/orxonox/objects/Scene.cc

    r3110 r3196  
    3131
    3232#include <OgreRoot.h>
     33#include <OgreSceneManager.h>
    3334#include <OgreSceneManagerEnumerator.h>
    3435#include <OgreSceneNode.h>
    3536
    36 #include "BulletCollision/BroadphaseCollision/btAxisSweep3.h"
    37 #include "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h"
    38 #include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
    39 #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
     37#include <BulletCollision/BroadphaseCollision/btAxisSweep3.h>
     38#include <BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h>
     39#include <BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h>
     40#include <BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h>
    4041
    4142#include "core/CoreIncludes.h"
     
    5859        if (GameMode::showsGraphics())
    5960        {
    60             if (Ogre::Root::getSingletonPtr())
    61             {
    62                 this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
    63                 this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
    64             }
    65             else
    66             {
    67                 this->sceneManager_ = 0;
    68                 this->rootSceneNode_ = 0;
    69             }
     61            assert(Ogre::Root::getSingletonPtr());
     62            this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
     63            this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
    7064        }
    7165        else
     
    9488        if (this->isInitialized())
    9589        {
    96             if (Ogre::Root::getSingletonPtr())
    97             {
     90            if (GameMode::showsGraphics())
    9891                Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_);
    99             }
    100             else if (!GameMode::showsGraphics())
    101             {
     92            else
    10293                delete this->sceneManager_;
    103             }
    10494
    10595            this->setPhysicalWorld(false);
     
    112102
    113103        XMLPortParam(Scene, "skybox", setSkybox, getSkybox, xmlelement, mode);
    114         XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2, 0.2, 0.2, 1));
     104        XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2f, 0.2f, 0.2f, 1.0f));
    115105        XMLPortParam(Scene, "shadow", setShadow, getShadow, xmlelement, mode).defaultValues(true);
    116106
     
    139129        {
    140130            CCOUT(2) << "Warning: Setting the negative world range to a very small value: "
    141                      << omni_cast<std::string>(range) << std::endl;
     131                     << multi_cast<std::string>(range) << std::endl;
    142132        }
    143133        if (this->hasPhysics())
     
    158148        {
    159149            CCOUT(2) << "Warning: Setting the positive world range to a very small value: "
    160                      << omni_cast<std::string>(range) << std::endl;
     150                     << multi_cast<std::string>(range) << std::endl;
    161151        }
    162152        if (this->hasPhysics())
     
    176166        this->gravity_ = gravity;
    177167        if (this->hasPhysics())
    178             this->physicalWorld_->setGravity(omni_cast<btVector3>(this->gravity_));
     168            this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_));
    179169    }
    180170
     
    187177            //       It would require further investigation to properly dertermine the right choices.
    188178            this->broadphase_      = new bt32BitAxisSweep3(
    189                 omni_cast<btVector3>(this->negativeWorldRange_), omni_cast<btVector3>(this->positiveWorldRange_));
     179                multi_cast<btVector3>(this->negativeWorldRange_), multi_cast<btVector3>(this->positiveWorldRange_));
    190180            this->collisionConfig_ = new btDefaultCollisionConfiguration();
    191181            this->dispatcher_      = new btCollisionDispatcher(this->collisionConfig_);
     
    193183
    194184            this->physicalWorld_   = new btDiscreteDynamicsWorld(this->dispatcher_, this->broadphase_, this->solver_, this->collisionConfig_);
    195             this->physicalWorld_->setGravity(omni_cast<btVector3>(this->gravity_));
     185            this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_));
    196186
    197187            // also set the collision callback variable.
  • code/trunk/src/orxonox/objects/Scene.h

    r2662 r3196  
    3333#include "OrxonoxPrereqs.h"
    3434
     35#include <list>
     36#include <set>
     37#include <string>
     38
     39#include "util/Math.h"
     40#include "util/OgreForwardRefs.h"
     41#include "core/BaseObject.h"
    3542#include "network/synchronisable/Synchronisable.h"
    36 #include "core/BaseObject.h"
    37 #include "util/Math.h"
    38 #include "objects/Tickable.h"
     43#include "interfaces/Tickable.h"
    3944
    4045namespace orxonox
  • code/trunk/src/orxonox/objects/Script.cc

    r3110 r3196  
    2929#include "Script.h"
    3030
    31 #include "util/Debug.h"
     31#include <tinyxml/ticpp.h>
    3232#include "core/CoreIncludes.h"
    33 #include "core/XMLPort.h"
    3433#include "core/LuaBind.h"
    3534
  • code/trunk/src/orxonox/objects/Script.h

    r2087 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <string>
    3435#include "core/BaseObject.h"
    3536
  • code/trunk/src/orxonox/objects/Test.h

    r3084 r3196  
    3333#include "core/BaseObject.h"
    3434#include "network/synchronisable/Synchronisable.h"
    35 #include "Tickable.h"
     35#include "interfaces/Tickable.h"
    3636
    3737
  • code/trunk/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc

    r3110 r3196  
    2929#include "BoxCollisionShape.h"
    3030
    31 #include "BulletCollision/CollisionShapes/btBoxShape.h"
     31#include <BulletCollision/CollisionShapes/btBoxShape.h>
    3232
    3333#include "core/CoreIncludes.h"
     
    7272    btCollisionShape* BoxCollisionShape::createNewShape() const
    7373    {
    74         return new btBoxShape(omni_cast<btVector3>(this->halfExtents_));
     74        return new btBoxShape(multi_cast<btVector3>(this->halfExtents_));
    7575    }
    7676}
  • code/trunk/src/orxonox/objects/collisionshapes/BoxCollisionShape.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
    3435#include "CollisionShape.h"
    3536
  • code/trunk/src/orxonox/objects/collisionshapes/CollisionShape.cc

    r3110 r3196  
    2929#include "CollisionShape.h"
    3030
    31 #include "BulletCollision/CollisionShapes/btCollisionShape.h"
     31#include <BulletCollision/CollisionShapes/btCollisionShape.h>
    3232
    33 #include "util/Exception.h"
    3433#include "core/CoreIncludes.h"
    3534#include "core/XMLPort.h"
    36 #include "tools/BulletConversions.h"
    37 
    3835#include "objects/worldentities/WorldEntity.h"
    3936#include "CompoundCollisionShape.h"
     
    129126    bool CollisionShape::hasTransform() const
    130127    {
    131         return (!this->position_.positionEquals(Vector3(0, 0, 0), 0.001) ||
    132                 !this->orientation_.equals(Quaternion(1,0,0,0), Degree(0.1)));
     128        return (!this->position_.positionEquals(Vector3(0, 0, 0), 0.001f) ||
     129                !this->orientation_.equals(Quaternion(1,0,0,0), Degree(0.1f)));
    133130    }
    134131
  • code/trunk/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc

    r3110 r3196  
    2929#include "CompoundCollisionShape.h"
    3030
    31 #include "BulletCollision/CollisionShapes/btCompoundShape.h"
     31#include <BulletCollision/CollisionShapes/btCompoundShape.h>
    3232
    33 #include "util/Exception.h"
    3433#include "core/CoreIncludes.h"
    3534#include "core/XMLPort.h"
     
    8988        {
    9089            // Only actually attach if we didn't pick a CompoundCollisionShape with no content
    91             btTransform transf(omni_cast<btQuaternion>(shape->getOrientation()), omni_cast<btVector3>(shape->getPosition()));
     90            btTransform transf(multi_cast<btQuaternion>(shape->getOrientation()), multi_cast<btVector3>(shape->getPosition()));
    9291            this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
    9392
     
    134133        {
    135134            // Only actually attach if we didn't pick a CompoundCollisionShape with no content
    136             btTransform transf(omni_cast<btQuaternion>(shape->getOrientation()), omni_cast<btVector3>(shape->getPosition()));
     135            btTransform transf(multi_cast<btQuaternion>(shape->getOrientation()), multi_cast<btVector3>(shape->getPosition()));
    137136            this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
    138137            it->second = shape->getCollisionShape();
  • code/trunk/src/orxonox/objects/collisionshapes/CompoundCollisionShape.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <vector>
    3534#include <cassert>
     35#include <map>
    3636#include "CollisionShape.h"
    3737
  • code/trunk/src/orxonox/objects/collisionshapes/ConeCollisionShape.cc

    r3110 r3196  
    2929#include "ConeCollisionShape.h"
    3030
    31 #include "BulletCollision/CollisionShapes/btConeShape.h"
     31#include <BulletCollision/CollisionShapes/btConeShape.h>
    3232
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
    35 #include "tools/BulletConversions.h"
    3635
    3736namespace orxonox
  • code/trunk/src/orxonox/objects/collisionshapes/ConeCollisionShape.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "CollisionShape.h"
    3534
  • code/trunk/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc

    r3110 r3196  
    2929#include "PlaneCollisionShape.h"
    3030
    31 #include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
     31#include <BulletCollision/CollisionShapes/btStaticPlaneShape.h>
    3232
    3333#include "core/CoreIncludes.h"
     
    7272    btCollisionShape* PlaneCollisionShape::createNewShape() const
    7373    {
    74         return new btStaticPlaneShape(omni_cast<btVector3>(this->normal_), this->offset_);
     74        return new btStaticPlaneShape(multi_cast<btVector3>(this->normal_), this->offset_);
    7575    }
    7676}
  • code/trunk/src/orxonox/objects/collisionshapes/PlaneCollisionShape.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
    3435#include "CollisionShape.h"
    3536
  • code/trunk/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc

    r3110 r3196  
    2929#include "SphereCollisionShape.h"
    3030
    31 #include "BulletCollision/CollisionShapes/btSphereShape.h"
     31#include <BulletCollision/CollisionShapes/btSphereShape.h>
    3232
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
    35 #include "tools/BulletConversions.h"
    3635
    3736namespace orxonox
  • code/trunk/src/orxonox/objects/collisionshapes/SphereCollisionShape.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "CollisionShape.h"
    3534
  • code/trunk/src/orxonox/objects/collisionshapes/WorldEntityCollisionShape.cc

    r3110 r3196  
    2929#include "WorldEntityCollisionShape.h"
    3030
    31 #include "BulletCollision/CollisionShapes/btCompoundShape.h"
     31#include <BulletCollision/CollisionShapes/btCompoundShape.h>
    3232
    33 #include "util/Exception.h"
     33#include "util/OrxAssert.h"
    3434#include "core/CoreIncludes.h"
    3535#include "objects/worldentities/WorldEntity.h"
  • code/trunk/src/orxonox/objects/collisionshapes/WorldEntityCollisionShape.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "CompoundCollisionShape.h"
    3534
  • code/trunk/src/orxonox/objects/controllers/AIController.cc

    r3110 r3196  
    2929#include "AIController.h"
    3030
     31#include "util/Math.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/Executor.h"
     
    107108            this->moveToTargetPosition();
    108109
    109         if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
     110        if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
    110111            this->getControllableEntity()->fire(0);
    111112
  • code/trunk/src/orxonox/objects/controllers/AIController.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
     35#include "interfaces/Tickable.h"
    3436#include "ArtificialController.h"
    35 #include "objects/Tickable.h"
    36 #include "tools/Timer.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/ArtificialController.cc

    r3110 r3196  
    3232#include "objects/worldentities/ControllableEntity.h"
    3333#include "objects/worldentities/pawns/Pawn.h"
    34 
     34#include "objects/worldentities/pawns/TeamBaseMatchBase.h"
    3535#include "objects/gametypes/TeamDeathmatch.h"
    3636#include "objects/controllers/WaypointPatrolController.h"
    37 #include "objects/worldentities/pawns/TeamBaseMatchBase.h"
    3837
    3938namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/ArtificialController.h

    r3049 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
     35#include "interfaces/PawnListener.h"
    3436#include "Controller.h"
    35 #include "objects/worldentities/pawns/Pawn.h"
    36 #include "util/Math.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/Controller.cc

    r3110 r3196  
    2828
    2929#include "Controller.h"
    30 
    3130#include "core/CoreIncludes.h"
    32 #include "overlays/OverlayGroup.h"
    3331
    3432namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/Controller.h

    r2826 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "core/BaseObject.h"
    3534
  • code/trunk/src/orxonox/objects/controllers/HumanController.cc

    r3110 r3196  
    192192            HumanController::localController_s->controllableEntity_->dropItems();
    193193    }
     194
     195    Pawn* HumanController::getLocalControllerEntityAsPawn()
     196    {
     197        if (HumanController::localController_s)
     198            return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
     199        else
     200            return NULL;
     201    }
    194202}
  • code/trunk/src/orxonox/objects/controllers/HumanController.h

    r3089 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    34 #include "util/Math.h"
    3533#include "Controller.h"
    36 #include "objects/worldentities/pawns/Pawn.h"
    3734
    3835namespace orxonox
     
    6966            static inline HumanController* getLocalControllerSingleton()
    7067                { return HumanController::localController_s; }
    71             static inline Pawn* getLocalControllerEntityAsPawn()
    72             {
    73                 if (HumanController::localController_s) {
    74                     return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
    75                 } else {
    76                     return NULL;
    77                 }
    78             }
    79 
     68            static Pawn* getLocalControllerEntityAsPawn();
    8069            //friend class, for mouselook
    8170            friend class Map;
  • code/trunk/src/orxonox/objects/controllers/PongAI.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/ConfigValueIncludes.h"
     33#include "tools/Timer.h"
    3334#include "objects/worldentities/ControllableEntity.h"
    3435#include "objects/worldentities/PongBall.h"
    35 #include "tools/Timer.h"
    3636
    3737namespace orxonox
     
    3939    CreateUnloadableFactory(PongAI);
    4040
    41     const static float MAX_REACTION_TIME = 0.4;
     41    const static float MAX_REACTION_TIME = 0.4f;
    4242
    4343    PongAI::PongAI(BaseObject* creator) : Controller(creator)
     
    4949        this->ballEndPosition_ = 0;
    5050        this->randomOffset_ = 0;
    51         this->relHysteresisOffset_ = 0.02;
    52         this->strength_ = 0.5;
     51        this->relHysteresisOffset_ = 0.02f;
     52        this->strength_ = 0.5f;
    5353        this->movement_ = 0;
    5454        this->oldMove_ = 0;
     
    171171
    172172        // The position shouln't be larger than 0.5 (50% of the bat-length from the middle is the end)
    173         position *= 0.48;
     173        position *= 0.48f;
    174174
    175175        // Both sides are equally probable
     
    190190
    191191        // Calculate bounces
    192         for (float limit = 0.35; limit < this->strength_ || this->strength_ > 0.99; limit += 0.4)
     192        for (float limit = 0.35f; limit < this->strength_ || this->strength_ > 0.99f; limit += 0.4f)
    193193        {
    194194            // Calculate a random prediction error, based on the vertical speed of the ball and the strength of the AI
  • code/trunk/src/orxonox/objects/controllers/PongAI.h

    r2885 r3196  
    3333
    3434#include <list>
    35 
     35#include "util/Math.h"
     36#include "interfaces/Tickable.h"
    3637#include "Controller.h"
    37 #include "objects/Tickable.h"
    38 #include "util/Math.h"
    3938
    4039namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/ScriptController.cc

    r3110 r3196  
    2828
    2929#include "ScriptController.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
     
    3938        RegisterObject(ScriptController);
    4039    }
    41 
    42     ScriptController::~ScriptController()
    43     {
    44     }
    4540}
  • code/trunk/src/orxonox/objects/controllers/ScriptController.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "ArtificialController.h"
    3534
     
    4039        public:
    4140            ScriptController(BaseObject* creator);
    42             virtual ~ScriptController();
    43 
    44         protected:
     41            virtual ~ScriptController() { }
    4542
    4643        private:
  • code/trunk/src/orxonox/objects/controllers/WaypointController.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/XMLPort.h"
     33#include "objects/worldentities/ControllableEntity.h"
    3334
    3435namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/WaypointController.h

    r3078 r3196  
    3333
    3434#include <vector>
    35 
     35#include "interfaces/Tickable.h"
    3636#include "ArtificialController.h"
    37 #include "objects/Tickable.h"
    3837
    3938namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc

    r3110 r3196  
    2929#include "WaypointPatrolController.h"
    3030
     31#include "util/Math.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/XMLPort.h"
     34#include "objects/worldentities/pawns/Pawn.h"
    3335
    3436namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.h

    r3078 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
    3435#include "WaypointController.h"
    35 #include "tools/Timer.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/objects/gametypes/Asteroids.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "objects/infos/PlayerInfo.h"
     32#include "network/Host.h"
    3333#include "objects/worldentities/pawns/Pawn.h"
    34 
    35 #include "network/Host.h"
    3634
    3735namespace orxonox
  • code/trunk/src/orxonox/objects/gametypes/Asteroids.h

    r3064 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "Gametype.h"
    3534
  • code/trunk/src/orxonox/objects/gametypes/Deathmatch.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
     32#include "network/Host.h"
    3233#include "objects/infos/PlayerInfo.h"
    3334#include "objects/worldentities/pawns/Pawn.h"
    34 
    35 #include "network/Host.h"
    3635
    3736namespace orxonox
  • code/trunk/src/orxonox/objects/gametypes/Deathmatch.h

    r2826 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "Gametype.h"
    3534
  • code/trunk/src/orxonox/objects/gametypes/Gametype.cc

    r3110 r3196  
    2929#include "Gametype.h"
    3030
    31 #include <cstdlib>
    32 #include <ctime>
    33 
     31#include "util/Math.h"
    3432#include "core/CoreIncludes.h"
    3533#include "core/ConfigValueIncludes.h"
    36 #include "core/Template.h"
    3734#include "core/GameMode.h"
    38 #include "overlays/OverlayGroup.h"
     35
    3936#include "objects/infos/PlayerInfo.h"
    4037#include "objects/infos/Bot.h"
     38#include "objects/worldentities/Camera.h"
     39#include "objects/worldentities/ControllableEntity.h"
     40#include "objects/worldentities/SpawnPoint.h"
    4141#include "objects/worldentities/pawns/Spectator.h"
    42 #include "objects/worldentities/SpawnPoint.h"
    43 #include "objects/worldentities/Camera.h"
     42#include "objects/worldentities/pawns/Pawn.h"
     43#include "overlays/OverlayGroup.h"
    4444
    4545namespace orxonox
     
    287287        if (this->spawnpoints_.size() > 0)
    288288        {
    289             unsigned int randomspawn = (unsigned int)rnd(this->spawnpoints_.size());
     289            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size())));
    290290            unsigned int index = 0;
    291291            for (std::set<SpawnPoint*>::const_iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); ++it)
  • code/trunk/src/orxonox/objects/gametypes/Gametype.h

    r3033 r3196  
    3333
    3434#include <map>
     35#include <set>
     36#include <string>
    3537
    3638#include "core/BaseObject.h"
    3739#include "core/Identifier.h"
    38 #include "objects/worldentities/ControllableEntity.h"
    39 #include "objects/Tickable.h"
     40#include "interfaces/Tickable.h"
    4041#include "objects/infos/GametypeInfo.h"
    4142
  • code/trunk/src/orxonox/objects/gametypes/Pong.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConfigValueIncludes.h"
    3332#include "core/Executor.h"
    34 #include "objects/worldentities/Model.h"
    3533#include "objects/worldentities/PongCenterpoint.h"
    3634#include "objects/worldentities/PongBall.h"
    3735#include "objects/worldentities/PongBat.h"
    38 #include "objects/infos/HumanPlayer.h"
    3936#include "objects/infos/PongBot.h"
    4037#include "objects/controllers/PongAI.h"
  • code/trunk/src/orxonox/objects/gametypes/Pong.h

    r2890 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
    3435#include "Deathmatch.h"
    35 #include "tools/Timer.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.cc

    r3104 r3196  
    2929#include "TeamBaseMatch.h"
    3030
     31#include "core/CoreIncludes.h"
     32#include "core/Executor.h"
    3133#include "objects/worldentities/pawns/TeamBaseMatchBase.h"
    32 #include "core/CoreIncludes.h"
    3334#include "objects/infos/PlayerInfo.h"
    3435
  • code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.h

    r3104 r3196  
    3333
    3434#include <set>
     35#include "tools/Timer.h"
    3536#include "TeamDeathmatch.h"
    36 #include "tools/Timer.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/ConfigValueIncludes.h"
    33 #include "objects/Teamcolourable.h"
     33#include "interfaces/TeamColourable.h"
    3434#include "objects/worldentities/TeamSpawnPoint.h"
     35#include "objects/worldentities/pawns/Pawn.h"
    3536
    3637namespace orxonox
     
    5354        static ColourValue colours[] =
    5455        {
    55             ColourValue(1.0, 0.3, 0.3),
    56             ColourValue(0.3, 0.3, 1.0),
    57             ColourValue(0.3, 1.0, 0.3),
    58             ColourValue(1.0, 1.0, 0.0)
     56            ColourValue(1.0f, 0.3f, 0.3f),
     57            ColourValue(0.3f, 0.3f, 1.0f),
     58            ColourValue(0.3f, 1.0f, 0.3f),
     59            ColourValue(1.0f, 1.0f, 0.0f)
    5960        };
    6061        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
     
    138139        if (teamSpawnPoints.size() > 0)
    139140        {
    140             unsigned int randomspawn = (unsigned int)rnd(teamSpawnPoints.size());
     141            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
    141142            unsigned int index = 0;
    142143            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
     
    168169                for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
    169170                {
    170                     if ((*it)->isA(Class(Teamcolourable)))
     171                    if ((*it)->isA(Class(TeamColourable)))
    171172                    {
    172                         Teamcolourable* tc = dynamic_cast<Teamcolourable*>(*it);
     173                        TeamColourable* tc = dynamic_cast<TeamColourable*>(*it);
    173174                        tc->setTeamColour(this->teamcolours_[it_player->second]);
    174175                    }
  • code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.h

    r3068 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <map>
    3435#include <vector>
    35 
    3636#include "Deathmatch.h"
    3737
  • code/trunk/src/orxonox/objects/gametypes/UnderAttack.cc

    r3110 r3196  
    2929#include "UnderAttack.h"
    3030
     31#include "util/Convert.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/ConfigValueIncludes.h"
    33 #include "util/Convert.h"
    3434#include "network/Host.h"
    35 
    3635#include "objects/worldentities/pawns/Destroyer.h"
    3736#include "objects/infos/PlayerInfo.h"
  • code/trunk/src/orxonox/objects/gametypes/UnderAttack.h

    r3033 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/PawnListener.h"
    3435#include "TeamDeathmatch.h"
    35 #include "objects/worldentities/pawns/Pawn.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/objects/infos/Bot.cc

    r3110 r3196  
    2929#include "Bot.h"
    3030
     31#include "util/Math.h"
    3132#include "core/GameMode.h"
    3233#include "core/CoreIncludes.h"
     
    3435#include "objects/gametypes/Gametype.h"
    3536#include "objects/controllers/AIController.h"
    36 #include "util/Math.h"
    3737
    3838namespace orxonox
     
    6666    void Bot::setConfigValues()
    6767    {
    68         static std::string names[] =
     68        static const std::string names[] =
    6969        {
    7070            "Dr. Julius No",
  • code/trunk/src/orxonox/objects/infos/Bot.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
    3334#include <vector>
    34 
    3535#include "PlayerInfo.h"
    3636
  • code/trunk/src/orxonox/objects/infos/GametypeInfo.cc

    r3110 r3196  
    3333#include "network/NetworkFunction.h"
    3434#include "network/Host.h"
    35 #include "objects/GametypeMessageListener.h"
     35#include "interfaces/GametypeMessageListener.h"
    3636
    3737namespace orxonox
     
    6868    }
    6969
    70     void GametypeInfo::sendAnnounceMessage(const std::string& message) const
     70    void GametypeInfo::sendAnnounceMessage(const std::string& message)
    7171    {
    7272        if (GameMode::isMaster())
     
    7777    }
    7878
    79     void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID) const
     79    void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID)
    8080    {
    8181        if (GameMode::isMaster())
     
    8888    }
    8989
    90     void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID) const
     90    void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID)
    9191    {
    9292        if (GameMode::isMaster())
     
    9999    }
    100100
    101     void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID) const
     101    void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID)
    102102    {
    103103        if (GameMode::isMaster())
     
    110110    }
    111111
    112     void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const
     112    void GametypeInfo::dispatchAnnounceMessage(const std::string& message)
    113113    {
    114114        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
     
    116116    }
    117117
    118     void GametypeInfo::dispatchKillMessage(const std::string& message) const
     118    void GametypeInfo::dispatchKillMessage(const std::string& message)
    119119    {
    120120        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
     
    122122    }
    123123
    124     void GametypeInfo::dispatchDeathMessage(const std::string& message) const
     124    void GametypeInfo::dispatchDeathMessage(const std::string& message)
    125125    {
    126126        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
  • code/trunk/src/orxonox/objects/infos/GametypeInfo.h

    r3099 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <string>
    3435#include "Info.h"
    3536
     
    5960                { return this->hudtemplate_; }
    6061
    61             void sendAnnounceMessage(const std::string& message) const;
    62             void sendAnnounceMessage(const std::string& message, unsigned int clientID) const;
    63             void sendKillMessage(const std::string& message, unsigned int clientID) const;
    64             void sendDeathMessage(const std::string& message, unsigned int clientID) const;
     62            void sendAnnounceMessage(const std::string& message);
     63            void sendAnnounceMessage(const std::string& message, unsigned int clientID);
     64            void sendKillMessage(const std::string& message, unsigned int clientID);
     65            void sendDeathMessage(const std::string& message, unsigned int clientID);
    6566
    66             void dispatchAnnounceMessage(const std::string& message) const;
    67             void dispatchKillMessage(const std::string& message) const;
    68             void dispatchDeathMessage(const std::string& message) const;
     67            void dispatchAnnounceMessage(const std::string& message);
     68            void dispatchKillMessage(const std::string& message);
     69            void dispatchDeathMessage(const std::string& message);
    6970
    7071        private:
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.cc

    r3110 r3196  
    2929#include "HumanPlayer.h"
    3030
    31 #include "core/GameMode.h"
    3231#include "core/CoreIncludes.h"
    3332#include "core/ConfigValueIncludes.h"
     33#include "core/GameMode.h"
    3434#include "network/ClientInformation.h"
    3535#include "network/Host.h"
     
    143143    float HumanPlayer::getPing() const
    144144    {
    145         return ClientInformation::findClient(this->getClientID())->getRTT();
     145        return static_cast<float>(ClientInformation::findClient(this->getClientID())->getRTT());
    146146    }
    147147
    148148    float HumanPlayer::getPacketLossRatio() const
    149149    {
    150         return ClientInformation::findClient(this->getClientID())->getPacketLoss();
     150        return static_cast<float>(ClientInformation::findClient(this->getClientID())->getPacketLoss());
    151151    }
    152152
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.h

    r2973 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <string>
    3435#include "PlayerInfo.h"
    3536
  • code/trunk/src/orxonox/objects/infos/Info.cc

    r3110 r3196  
    2828
    2929#include "Info.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
  • code/trunk/src/orxonox/objects/infos/PlayerInfo.cc

    r3110 r3196  
    3434#include "network/ClientInformation.h"
    3535#include "objects/gametypes/Gametype.h"
     36#include "objects/worldentities/ControllableEntity.h"
    3637
    3738namespace orxonox
  • code/trunk/src/orxonox/objects/infos/PongBot.h

    r2839 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "Bot.h"
    3534
  • code/trunk/src/orxonox/objects/items/Engine.cc

    r3110 r3196  
    2929#include "Engine.h"
    3030
     31#include "util/Math.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/ConfigValueIncludes.h"
     
    3435#include "objects/Scene.h"
    3536#include "objects/worldentities/pawns/SpaceShip.h"
     37#include "objects/pickup/ModifierType.h"
    3638#include "tools/Shader.h"
    3739#include "sound/SoundBase.h"
  • code/trunk/src/orxonox/objects/items/Engine.h

    r3060 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/Tickable.h"
    3435#include "Item.h"
    35 #include "objects/Tickable.h"
    36 #include "util/Math.h"
    3736
    3837namespace orxonox
  • code/trunk/src/orxonox/objects/items/Item.cc

    r3110 r3196  
    2828
    2929#include "Item.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
     
    3736        RegisterObject(Item);
    3837    }
    39 
    40     Item::~Item()
    41     {
    42     }
    4338}
  • code/trunk/src/orxonox/objects/items/Item.h

    r2662 r3196  
    4141        public:
    4242            Item(BaseObject* creator);
    43             virtual ~Item();
     43            virtual ~Item() {}
    4444    };
    4545}
  • code/trunk/src/orxonox/objects/items/MultiStateEngine.cc

    r3110 r3196  
    2929#include "MultiStateEngine.h"
    3030
     31#include "core/CoreIncludes.h"
    3132#include "core/GameMode.h"
    32 #include "core/CoreIncludes.h"
    3333#include "core/XMLPort.h"
    3434#include "objects/worldentities/pawns/SpaceShip.h"
  • code/trunk/src/orxonox/objects/items/MultiStateEngine.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <list>
    3435#include "Engine.h"
    3536
  • code/trunk/src/orxonox/objects/pickup/BaseItem.cc

    r3073 r3196  
    3434#include "BaseItem.h"
    3535
    36 #include "PickupCollection.h"
    37 
    3836#include "core/CoreIncludes.h"
    3937#include "core/XMLPort.h"
     
    5553        this->setGUIText("");
    5654    }
    57     //! Deconstructor.
     55    //! Destructor.
    5856    BaseItem::~BaseItem()
    5957    {
     
    105103    }
    106104
    107     const std::string& BaseItem::getGUIText() const { return this->guiText_; }
     105    const std::string& BaseItem::getGUIText() const
     106    {
     107        return this->guiText_;
     108    }
    108109}
  • code/trunk/src/orxonox/objects/pickup/BaseItem.h

    r3073 r3196  
    3737#include "OrxonoxPrereqs.h"
    3838
     39#include <string>
    3940#include "core/BaseObject.h"
    4041
  • code/trunk/src/orxonox/objects/pickup/DroppedItem.cc

    r3079 r3196  
    2929#include "DroppedItem.h"
    3030
     31#include "util/Math.h"
     32#include "core/CoreIncludes.h"
     33#include "core/Executor.h"
    3134#include "BaseItem.h"
     35#include "objects/worldentities/Billboard.h"
     36#include "objects/worldentities/Model.h"
    3237#include "objects/worldentities/pawns/Pawn.h"
    33 #include "objects/worldentities/Model.h"
    34 #include "objects/worldentities/Billboard.h"
    35 
    36 #include "core/CoreIncludes.h"
    3738
    3839namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/DroppedItem.h

    r3079 r3196  
    2929/**
    3030    @file
    31     @brief Definition of BaseItem (base-class for items/pickups).
     31    @brief Definition of DroppedItem
    3232*/
    3333
     
    3737#include "OrxonoxPrereqs.h"
    3838
    39 #include "objects/Tickable.h"
     39#include "tools/Timer.h"
     40#include "interfaces/Tickable.h"
    4041#include "objects/worldentities/StaticEntity.h"
    41 #include "tools/Timer.h"
    4242
    4343namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/EquipmentItem.cc

    r3073 r3196  
    3333
    3434#include "EquipmentItem.h"
    35 
    3635#include "core/CoreIncludes.h"
    3736
     
    4645        RegisterObject(EquipmentItem);
    4746    }
    48     //! Deconstructor.
    49     EquipmentItem::~EquipmentItem()
    50     {
    51     }
    5247}
  • code/trunk/src/orxonox/objects/pickup/EquipmentItem.h

    r3073 r3196  
    3838
    3939#include "BaseItem.h"
    40 
    4140namespace orxonox
    4241{
     
    4948    public:
    5049        EquipmentItem(BaseObject* creator);
    51         virtual ~EquipmentItem();
     50        virtual ~EquipmentItem() {}
    5251    };
    5352}
  • code/trunk/src/orxonox/objects/pickup/ModifierPickup.cc

    r3079 r3196  
    3333
    3434#include "ModifierPickup.h"
    35 #include "PickupCollection.h"
    3635
    3736#include "core/CoreIncludes.h"
    3837#include "core/XMLPort.h"
    39 
    4038#include "objects/worldentities/pawns/Pawn.h"
    4139
  • code/trunk/src/orxonox/objects/pickup/ModifierPickup.h

    r3073 r3196  
    3535#define _ModifierPickup_H__
    3636
    37 #include <climits>
    38 
    3937#include "OrxonoxPrereqs.h"
    4038
     39#include <climits>
     40#include <map>
     41
     42#include "orxonox/tools/Timer.h"
     43#include "ModifierType.h"
    4144#include "PassiveItem.h"
    42 #include "ModifierType.h"
    43 #include "orxonox/tools/Timer.h"
    4445
    4546namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/ModifierType.h

    r3073 r3196  
    3535#define _ModifierType_H__
    3636
     37#include "OrxonoxPrereqs.h"
     38
    3739namespace orxonox
    3840{
  • code/trunk/src/orxonox/objects/pickup/PassiveItem.cc

    r3073 r3196  
    2828
    2929#include "PassiveItem.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
     
    4140        RegisterObject(PassiveItem);
    4241    }
    43     //! Deconstructor.
    44     PassiveItem::~PassiveItem()
    45     {
    46     }
    4742}
  • code/trunk/src/orxonox/objects/pickup/PassiveItem.h

    r3073 r3196  
    3636
    3737#include "OrxonoxPrereqs.h"
    38 
    3938#include "BaseItem.h"
    4039
     
    4948    public:
    5049        PassiveItem(BaseObject* creator);
    51         virtual ~PassiveItem();
     50        virtual ~PassiveItem() {}
    5251    };
    5352}
  • code/trunk/src/orxonox/objects/pickup/PickupCollection.cc

    r3079 r3196  
    3434#include "PickupCollection.h"
    3535
    36 #include "BaseItem.h"
     36#include "core/CoreIncludes.h"
    3737#include "EquipmentItem.h"
    3838#include "PassiveItem.h"
    3939#include "UsableItem.h"
    40 
    41 #include "core/CoreIncludes.h"
    4240
    4341namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/PickupCollection.h

    r3079 r3196  
    3737#include "OrxonoxPrereqs.h"
    3838
     39#include <deque>
    3940#include <map>
    40 #include <deque>
    4141#include <string>
    4242
    4343#include "util/Math.h"
    44 
    4544#include "ModifierType.h"
    4645
  • code/trunk/src/orxonox/objects/pickup/PickupInventory.cc

    r3085 r3196  
    2828
    2929#include "PickupInventory.h"
    30 
    31 #include "EquipmentItem.h"
    32 #include "PassiveItem.h"
    33 #include "UsableItem.h"
    34 
    35 #include "core/ConsoleCommand.h"
    36 #include "core/input/InputManager.h"
    37 
    38 #include "gui/GUIManager.h"
    39 #include "objects/controllers/HumanController.h"
    40 #include "objects/worldentities/pawns/Pawn.h"
    4130
    4231#include <CEGUIImage.h>
     
    4736#include <elements/CEGUITabControl.h>
    4837
     38#include "core/ConsoleCommand.h"
     39#include "core/input/InputManager.h"
     40#include "gui/GUIManager.h"
     41#include "objects/controllers/HumanController.h"
     42#include "objects/worldentities/pawns/Pawn.h"
     43
     44#include "EquipmentItem.h"
     45#include "PassiveItem.h"
     46#include "UsableItem.h"
     47
     48
    4949namespace orxonox
    5050{
     
    8686    {
    8787        if(PickupInventory::getSingleton()->isVisible()) {
    88             GUIManager::getInstancePtr()->executeCode("hideGUI(\"PickupInventory\")");
    89             GUIManager::getInstancePtr()->executeCode("hideCursor()");
     88            GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
     89            GUIManager::getInstance().executeCode("hideCursor()");
    9090            InputManager::getInstance().requestLeaveState("guiMouseOnly");
    9191        }
    9292        else
    9393        {
    94             GUIManager::getInstancePtr()->showGUI("PickupInventory");
    95             GUIManager::getInstancePtr()->executeCode("showCursor()");
     94            GUIManager::getInstance().showGUI("PickupInventory");
     95            GUIManager::getInstance().executeCode("showCursor()");
    9696            InputManager::getInstance().requestEnterState("guiMouseOnly");
    9797        }
  • code/trunk/src/orxonox/objects/pickup/PickupInventory.h

    r3079 r3196  
    3737#include "OrxonoxPrereqs.h"
    3838
     39#include <CEGUIForwardRefs.h>
    3940#include "core/BaseObject.h"
    40 
    41 namespace CEGUI { class Window; class WindowManager; class Image; }
    4241
    4342// tolua_begin
  • code/trunk/src/orxonox/objects/pickup/PickupSpawner.cc

    r3079 r3196  
    3333
    3434#include "PickupSpawner.h"
     35
    3536#include "BaseItem.h"
    36 #include "PickupInventory.h"    // HACK; Only for hack, remove later
    37 #include "gui/GUIManager.h"     // HACK; see above
    3837
    3938#include "core/CoreIncludes.h"
     39#include "core/Template.h"
    4040#include "core/XMLPort.h"
    41 #include "core/Template.h"
     41#include "gui/GUIManager.h"     // HACK; see below
     42#include "objects/worldentities/pawns/Pawn.h"
     43#include "PickupInventory.h"    // HACK; Only for hack, remove later
    4244
    43 #include "objects/worldentities/pawns/Pawn.h"
    4445
    4546namespace orxonox
     
    9596        //  & load the GUI itself too, along with some empty windows
    9697        //   = even less delays
    97         GUIManager::getInstancePtr()->showGUI("PickupInventory");
    98         GUIManager::getInstancePtr()->executeCode("hideGUI(\"PickupInventory\")");
     98        GUIManager::getInstance().showGUI("PickupInventory");
     99        GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
    99100        PickupInventory::getSingleton();
    100101    }
  • code/trunk/src/orxonox/objects/pickup/PickupSpawner.h

    r3079 r3196  
    3737#include "OrxonoxPrereqs.h"
    3838
    39 #include "objects/Tickable.h"
     39#include <string>
     40#include "tools/Timer.h"
     41#include "interfaces/Tickable.h"
    4042#include "objects/worldentities/StaticEntity.h"
    41 #include "tools/Timer.h"
    4243
    4344namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/UsableItem.cc

    r3073 r3196  
    3333
    3434#include "UsableItem.h"
    35 
    3635#include "core/CoreIncludes.h"
    3736
     
    4645        RegisterObject(UsableItem);
    4746    }
    48     //! Deconstructor.
    49     UsableItem::~UsableItem()
    50     {
    51     }
    5247}
  • code/trunk/src/orxonox/objects/pickup/UsableItem.h

    r3073 r3196  
    3636
    3737#include "OrxonoxPrereqs.h"
    38 
    3938#include "BaseItem.h"
    4039
     
    4948    public:
    5049        UsableItem(BaseObject* creator);
    51         virtual ~UsableItem();
     50        virtual ~UsableItem() { }
    5251
    5352        /**
  • code/trunk/src/orxonox/objects/pickup/items/HealthImmediate.cc

    r3079 r3196  
    3434#include "HealthImmediate.h"
    3535
    36 #include "objects/worldentities/pawns/Pawn.h"
    37 
    3836#include "core/CoreIncludes.h"
    3937#include "core/XMLPort.h"
     38#include "objects/worldentities/pawns/Pawn.h"
    4039
    4140namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/items/HealthImmediate.h

    r3079 r3196  
    3636
    3737#include "OrxonoxPrereqs.h"
    38 
    3938#include "objects/pickup/PassiveItem.h"
    4039
  • code/trunk/src/orxonox/objects/pickup/items/HealthUsable.cc

    r3079 r3196  
    3333
    3434#include "HealthUsable.h"
    35 #include "objects/pickup/DroppedItem.h"
    3635
    37 #include "objects/worldentities/pawns/Pawn.h"
    38 
     36#include "util/Math.h"
    3937#include "core/CoreIncludes.h"
    4038#include "core/XMLPort.h"
     39#include "objects/pickup/DroppedItem.h"
     40#include "objects/worldentities/pawns/Pawn.h"
    4141
    4242namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/items/HealthUsable.h

    r3081 r3196  
    3535#define _HealthUsable_H__
    3636
    37 #include <climits>
    38 
    3937#include "OrxonoxPrereqs.h"
    4038
     39#include <climits>
    4140#include "objects/pickup/UsableItem.h"
    42 #include "util/Math.h"
    4341
    4442namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/items/Jump.cc

    r3079 r3196  
    3333
    3434#include "Jump.h"
    35 #include "objects/pickup/DroppedItem.h"
    36 
    37 #include "objects/worldentities/pawns/Pawn.h"
    3835
    3936#include "core/CoreIncludes.h"
    4037#include "core/XMLPort.h"
     38#include "objects/pickup/DroppedItem.h"
     39#include "objects/worldentities/pawns/Pawn.h"
    4140
    4241namespace orxonox
  • code/trunk/src/orxonox/objects/pickup/items/Jump.h

    r3079 r3196  
    3939#include "OrxonoxPrereqs.h"
    4040
     41#include <climits>
     42#include "util/Math.h"
    4143#include "objects/pickup/UsableItem.h"
    42 #include "util/Math.h"
    4344
    4445namespace orxonox
  • code/trunk/src/orxonox/objects/quest/AddQuest.cc

    r3110 r3196  
    2828
    2929/**
    30     @file AddQuest.cc
     30    @file
    3131    @brief Implementation of the AddQuest class.
    3232*/
     
    3434#include "AddQuest.h"
    3535
    36 #include <string>
    37 
     36#include "util/Exception.h"
    3837#include "core/CoreIncludes.h"
    39 #include "util/Exception.h"
    40 
    41 #include "orxonox/objects/infos/PlayerInfo.h"
    4238#include "QuestManager.h"
    43 #include "QuestDescription.h"
    4439#include "Quest.h"
    4540
  • code/trunk/src/orxonox/objects/quest/AddQuest.h

    r3068 r3196  
    2828
    2929/**
    30     @file AddQuest.h
     30    @file
    3131    @brief Definition of the AddQuest class.
    3232*/
     
    3636
    3737#include "OrxonoxPrereqs.h"
    38 
    39 #include <string>
    40 
    41 #include "core/XMLPort.h"
    4238#include "ChangeQuestStatus.h"
    4339
  • code/trunk/src/orxonox/objects/quest/AddQuestHint.cc

    r3110 r3196  
    2828
    2929/**
    30     @file AddQuestHint.cc
     30    @file
    3131    @brief Implementation of the AddQuestHint class.
    3232*/
     
    3434#include "AddQuestHint.h"
    3535
     36#include "util/Exception.h"
    3637#include "core/CoreIncludes.h"
    37 #include "util/Exception.h"
    38 
    39 #include "orxonox/objects/infos/PlayerInfo.h"
     38#include "core/XMLPort.h"
    4039#include "QuestManager.h"
    4140#include "QuestItem.h"
  • code/trunk/src/orxonox/objects/quest/AddQuestHint.h

    r3068 r3196  
    2828
    2929/**
    30     @file AddQuestHint.h
     30    @file
    3131    @brief Definition of the AddQuestHint class.
    3232*/
     
    3838
    3939#include <string>
    40 
    4140#include "QuestEffect.h"
    4241
  • code/trunk/src/orxonox/objects/quest/AddReward.cc

    r3110 r3196  
    2828
    2929/**
    30     @file AddReward.cc
     30    @file
    3131    @brief Implementation of the AddReward class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 
    38 #include "orxonox/objects/infos/PlayerInfo.h"
    39 #include "Rewardable.h"
     37#include "core/XMLPort.h"
     38#include "interfaces/Rewardable.h"
    4039
    4140namespace orxonox
  • code/trunk/src/orxonox/objects/quest/AddReward.h

    r3068 r3196  
    2828
    2929/**
    30     @file AddReward.h
     30    @file
    3131    @brief Definition of the AddReward class.
    3232*/
     
    3838
    3939#include <list>
    40 
    41 #include "core/XMLPort.h"
    4240#include "QuestEffect.h"
    4341
  • code/trunk/src/orxonox/objects/quest/CMakeLists.txt

    r2911 r3196  
    1717  QuestManager.cc
    1818  QuestNotification.cc
    19   Rewardable.cc
    2019)
  • code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.cc

    r3110 r3196  
    2828
    2929/**
    30     @file ChangeQuestStatus.cc
     30    @file
    3131    @brief Implementation of the ChangeQuestStatus class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 
     37#include "core/XMLPort.h"
    3838#include "QuestItem.h"
    3939
  • code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.h

    r3068 r3196  
    2828
    2929/**
    30     @file ChangeQuestStatus.h
     30    @file
    3131    @brief Definition of the ChangeQuestStatus class.
    3232*/
     
    3838
    3939#include <string>
    40 
    41 #include "core/XMLPort.h"
    4240#include "QuestEffect.h"
    4341
  • code/trunk/src/orxonox/objects/quest/CompleteQuest.cc

    r3110 r3196  
    2828 
    2929/**
    30     @file CompleteQuest.cc
     30    @file
    3131    @brief Implementation of the CompleteQuest class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "util/Exception.h"
    38 
    39 #include "orxonox/objects/infos/PlayerInfo.h"
     37#include "core/XMLPort.h"
    4038#include "QuestManager.h"
    4139#include "Quest.h"
  • code/trunk/src/orxonox/objects/quest/CompleteQuest.h

    r3068 r3196  
    2828
    2929/**
    30     @file CompleteQuest.h
     30    @file
    3131    @brief Definition of the CompleteQuest class.
    3232*/
     
    3636
    3737#include "OrxonoxPrereqs.h"
    38 
    39 #include <string>
    40 
    41 #include "core/XMLPort.h"
    4238#include "ChangeQuestStatus.h"
    4339
  • code/trunk/src/orxonox/objects/quest/FailQuest.cc

    r3110 r3196  
    2828 
    2929/**
    30     @file FailQuest.cc
     30    @file
    3131    @brief Implementation of the FailQuest class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "util/Exception.h"
    38 
    39 #include "orxonox/objects/infos/PlayerInfo.h"
     37#include "core/XMLPort.h"
    4038#include "QuestManager.h"
    4139#include "Quest.h"
  • code/trunk/src/orxonox/objects/quest/FailQuest.h

    r3068 r3196  
    2828
    2929/**
    30     @file FailQuest.h
     30    @file
    3131    @brief Definition of the FailQuest class.
    3232*/
     
    3636
    3737#include "OrxonoxPrereqs.h"
    38 
    39 #include <string>
    40 
    41 #include "core/XMLPort.h"
    4238#include "ChangeQuestStatus.h"
    4339
  • code/trunk/src/orxonox/objects/quest/GlobalQuest.cc

    r3110 r3196  
    2828 
    2929/**
    30     @file GlobalQuest.cc
     30    @file
    3131    @brief Implementation of the GlobalQuest class.
    3232*/
     
    3434#include "GlobalQuest.h"
    3535
    36 #include "orxonox/objects/infos/PlayerInfo.h"
    3736#include "core/CoreIncludes.h"
    38 #include "core/Super.h"
    39 #include "util/Exception.h"
    40 
     37#include "core/XMLPort.h"
    4138#include "QuestEffect.h"
    4239
  • code/trunk/src/orxonox/objects/quest/GlobalQuest.h

    r3068 r3196  
    2828 
    2929/**
    30     @file GlobalQuest.h
     30    @file
    3131    @brief Definition of the GlobalQuest class.
    3232*/
     
    3737#include "OrxonoxPrereqs.h"
    3838
     39#include <list>
    3940#include <set>
    40 #include <list>
    41 
    42 #include "core/XMLPort.h"
    4341#include "Quest.h"
    4442
  • code/trunk/src/orxonox/objects/quest/LocalQuest.cc

    r3110 r3196  
    2828
    2929/**
    30     @file LocalQuest.cc
     30    @file
    3131    @brief Implementation of the LocalQuest class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/Super.h"
    38 #include "util/Exception.h"
    39 
    40 #include "orxonox/objects/infos/PlayerInfo.h"
     37#include "core/XMLPort.h"
    4138#include "QuestEffect.h"
    4239
  • code/trunk/src/orxonox/objects/quest/LocalQuest.h

    r3068 r3196  
    2828 
    2929/**
    30     @file LocalQuest.h
     30    @file
    3131    @brief Definition of the LocalQuest class.
    3232*/
     
    3838
    3939#include <map>
    40 #include <string>
    41 
    42 #include "core/XMLPort.h"
    4340#include "Quest.h"
    4441
  • code/trunk/src/orxonox/objects/quest/Quest.cc

    r3110 r3196  
    2828 
    2929/**
    30     @file Quest.cc
     30    @file
    3131    @brief Implementation of the Quest class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 
    38 #include "orxonox/objects/infos/PlayerInfo.h"
     37#include "core/XMLPort.h"
    3938#include "QuestManager.h"
    4039#include "QuestDescription.h"
  • code/trunk/src/orxonox/objects/quest/Quest.h

    r3068 r3196  
    2828 
    2929/**
    30     @file Quest.h
     30    @file
    3131    @brief Definition of the Quest class.
    3232        The Quest is the parent class of LocalQuest and GlobalQuest.
     
    3939
    4040#include <list>
    41 #include <string>
    42 
    43 #include "core/XMLPort.h"
    44 
    4541#include "QuestItem.h"
    4642
  • code/trunk/src/orxonox/objects/quest/QuestDescription.cc

    r3110 r3196  
    2828
    2929/**
    30     @file QuestDescription.cc
     30    @file
    3131    @brief Implementation of the QuestDescription class.
    3232*/
     
    3636
    3737#include "core/CoreIncludes.h"
     38#include "core/XMLPort.h"
    3839#include "QuestNotification.h"
    3940
  • code/trunk/src/orxonox/objects/quest/QuestDescription.h

    r3068 r3196  
    2828
    2929/**
    30     @file QuestDescription.h
     30    @file
    3131    @brief Definition of the QuestDescription class.
    3232*/
     
    3838
    3939#include <string>
    40 
    4140#include "core/BaseObject.h"
    42 #include "core/XMLPort.h"
    4341
    4442// tolua_begin
  • code/trunk/src/orxonox/objects/quest/QuestEffect.cc

    r3110 r3196  
    2828
    2929/**
    30     @file QuestEffect.cc
     30    @file
    3131    @brief Implementation of the QuestEffect class.
    3232*/
    3333
    3434#include "QuestEffect.h"
    35 
    3635#include "core/CoreIncludes.h"
    37 
    38 #include "orxonox/objects/infos/PlayerInfo.h"
    3936
    4037namespace orxonox
  • code/trunk/src/orxonox/objects/quest/QuestEffect.h

    r3068 r3196  
    2828 
    2929/**
    30     @file QuestEffect.h
     30    @file
    3131    @brief Definition of the QuestEffect class.
    3232*/
     
    3838
    3939#include <list>
    40 
    4140#include "core/BaseObject.h"
    4241
  • code/trunk/src/orxonox/objects/quest/QuestEffectBeacon.cc

    r3110 r3196  
    2828
    2929/**
    30     @file QuestEffectBeacon.cc
     30    @file
    3131    @brief Implementation of the QuestEffectBeacon class.
    3232*/
     
    3636#include "core/CoreIncludes.h"
    3737#include "core/XMLPort.h"
    38 #include "core/Event.h"
    3938#include "core/EventIncludes.h"
    40 
    41 #include "orxonox/objects/infos/PlayerInfo.h"
    4239#include "orxonox/objects/worldentities/pawns/Pawn.h"
    4340#include "orxonox/objects/worldentities/triggers/PlayerTrigger.h"
     
    8986        SUPER(QuestEffectBeacon, processEvent, event);
    9087   
    91         SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
     88        ORXONOX_SET_SUBCLASS_EVENT(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
    9289    }
    9390   
  • code/trunk/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2911 r3196  
    2828
    2929/**
    30     @file QuestEffectBeacon.h
     30    @file
    3131    @brief Definition of the QuestEffectBeacon class.
    3232*/
     
    3737#include "OrxonoxPrereqs.h"
    3838
     39#include <list>
    3940#include "orxonox/objects/worldentities/StaticEntity.h"
    4041
  • code/trunk/src/orxonox/objects/quest/QuestHint.cc

    r3110 r3196  
    2828 
    2929/**
    30     @file QuestHint.cc
     30    @file
    3131    @brief Implementation of the QuestHint class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "util/Exception.h"
    38 
    39 #include "orxonox/objects/infos/PlayerInfo.h"
     37#include "core/XMLPort.h"
    4038#include "QuestManager.h"
    4139#include "QuestDescription.h"
  • code/trunk/src/orxonox/objects/quest/QuestHint.h

    r3068 r3196  
    2828 
    2929/**
    30     @file QuestHint.h
     30    @file
    3131    @brief Definition of the QuestHint class.
    3232*/
     
    3838
    3939#include <map>
    40 #include <string>
    41 
    42 #include "core/XMLPort.h"
    4340#include "QuestItem.h"
    4441
  • code/trunk/src/orxonox/objects/quest/QuestItem.cc

    r3110 r3196  
    2828 
    2929/**
    30     @file QuestItem.cc
     30    @file
    3131    @brief Implementation of the QuestItem class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 
     37#include "core/XMLPort.h"
    3838#include "QuestDescription.h"
    3939
  • code/trunk/src/orxonox/objects/quest/QuestItem.h

    r3068 r3196  
    2828 
    2929/**
    30     @file QuestItem.h
     30    @file
    3131    @brief Definition of the QuestItem class.
    3232        The QuestItem is the parent class of Quest and QuestHint.
     
    4040
    4141#include <string>
    42 
    4342#include "core/BaseObject.h"
    44 #include "core/XMLPort.h"
    4543
    4644namespace orxonox
  • code/trunk/src/orxonox/objects/quest/QuestListener.cc

    r3110 r3196  
    2828
    2929/**
    30     @file QuestListener.cc
     30    @file
    3131    @brief Implementation of the QuestListener class.
    3232*/
     
    3636#include "core/CoreIncludes.h"
    3737#include "core/XMLPort.h"
    38 #include "util/Exception.h"
    39 
    4038#include "Quest.h"
    4139#include "QuestManager.h"
     
    164162        Return the mode of the QuestListener. Can be eighter 'all', 'start', 'fail' or 'complete'.
    165163    */
    166     const std::string QuestListener::getMode(void)
     164    std::string QuestListener::getMode(void)
    167165    {
    168166        if(this->mode_ == questListenerMode::all)
     
    191189    /**
    192190    @brief
     191        Get the questId of the Quest the QuestListener reacts to.
     192    @return
     193        Returns the questId of the Quest the QuestListener reacts to.
     194    */
     195    const std::string & QuestListener::getQuestId(void)   
     196    {
     197        return this->quest_->getId();
     198    }
     199
     200    /**
     201    @brief
    193202        Executes the QuestListener, resp. fires an Event.
    194203    @return
  • code/trunk/src/orxonox/objects/quest/QuestListener.h

    r2911 r3196  
    2828
    2929/**
    30     @file QuestListener.h
     30    @file
    3131    @brief Definition of the QuestListener class.
    3232*/
     
    3939#include <string>
    4040#include <list>
    41 
    4241#include "core/BaseObject.h"
    43 
    44 #include "Quest.h"
    4542
    4643namespace orxonox
     
    9087        bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
    9188       
    92         const std::string getMode(void); //!< Get the mode of the QuestListener.
     89        std::string getMode(void); //!< Get the mode of the QuestListener.
    9390       
    94         /**
    95         @brief Get the questId of the Quest the QuestListener reacts to.
    96         @return Returns the questId of the Quest the QuestListener reacts to.
    97         */
    98         inline const std::string & getQuestId(void)
    99                 { return this->quest_->getId(); }
    100        
     91        const std::string & getQuestId(void);       
    10192        bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
    10293       
  • code/trunk/src/orxonox/objects/quest/QuestManager.cc

    r3110 r3196  
    2828
    2929/**
    30     @file QuestManager.cc
     30    @file
    3131    @brief Implementation of the QuestManager class.
    3232*/
     
    3434#include "QuestManager.h"
    3535
     36#include "util/Exception.h"
    3637#include "core/CoreIncludes.h"
    37 #include "core/ConsoleCommand.h"
    38 #include "core/input/InputManager.h"
    39 
    40 #include "util/Exception.h"
    4138#include "gui/GUIManager.h"
     39
    4240#include "objects/infos/PlayerInfo.h"
     41#include "objects/infos/PlayerInfo.h"
     42#include "overlays/GUIOverlay.h"
    4343#include "Quest.h"
    4444#include "QuestHint.h"
     45#include "QuestItem.h"
    4546
    4647namespace orxonox
  • code/trunk/src/orxonox/objects/quest/QuestManager.h

    r3068 r3196  
    2828
    2929/**
    30     @file QuestManager.h
     30    @file
    3131    @brief Definition of the QuestManager class.
    3232*/
     
    3737#include "OrxonoxPrereqs.h"
    3838
     39#include <list>
    3940#include <map>
    40 #include <list>
    4141#include <string>
    42 
    4342#include "core/OrxonoxClass.h"
    44 #include "orxonox/objects/infos/PlayerInfo.h"
    45 #include "overlays/GUIOverlay.h"
    4643
    4744// tolua_begin
  • code/trunk/src/orxonox/objects/quest/QuestNotification.cc

    r3110 r3196  
    2828
    2929#include "QuestNotification.h"
    30 
    3130#include "core/CoreIncludes.h"
    32 
    33 #include "orxonox/overlays/notifications/Notification.h"
    3431
    3532namespace orxonox {
  • code/trunk/src/orxonox/objects/quest/QuestNotification.h

    r3078 r3196  
    3333
    3434#include <string>
    35 
    36 #include "orxonox/overlays/notifications/Notification.h"
     35#include "overlays/notifications/Notification.h"
    3736
    3837namespace orxonox {
  • code/trunk/src/orxonox/objects/weaponsystem/DefaultWeaponmodeLink.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/XMLPort.h"
    33 
    3433#include "WeaponSystem.h"
    3534
  • code/trunk/src/orxonox/objects/weaponsystem/Munition.cc

    r3110 r3196  
    2929
    3030#include "Munition.h"
    31 
    3231#include "core/CoreIncludes.h"
    3332
  • code/trunk/src/orxonox/objects/weaponsystem/Munition.h

    r3053 r3196  
    3434
    3535#include <map>
    36 
    3736#include "core/BaseObject.h"
    3837#include "tools/Timer.h"
  • code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.cc

    r3110 r3196  
    3030#include "MuzzleFlash.h"
    3131
    32 #include "core/GameMode.h"
    3332#include "core/CoreIncludes.h"
    34 #include "core/XMLPort.h"
    35 #include "util/Math.h"
     33#include "core/Executor.h"
    3634
    3735namespace orxonox
     
    4240    {
    4341        RegisterObject(MuzzleFlash);
    44         this->setScale(0.1);
     42        this->setScale(0.1f);
    4543       
    4644        this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));
  • code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.h

    r3053 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include "tools/Timer.h"
    3335#include "objects/worldentities/Billboard.h"
    34 #include "tools/Timer.h"
    35 
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/Weapon.h

    r3053 r3196  
    3232
    3333#include "OrxonoxPrereqs.h"
     34
     35#include <map>
     36#include "tools/Timer.h"
    3437#include "objects/worldentities/StaticEntity.h"
    35 
    36 #include "tools/Timer.h"
    3738
    3839namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/WeaponMode.h

    r3053 r3196  
    3232
    3333#include "OrxonoxPrereqs.h"
     34
     35#include <string>
     36#include "util/Math.h"
    3437#include "core/BaseObject.h"
    35 
     38#include "core/Identifier.h"
    3639#include "tools/Timer.h"
    37 #include "core/Identifier.h"
    38 #include "util/Math.h"
    3940
    4041namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/XMLPort.h"
    33 #include "objects/worldentities/pawns/Pawn.h"
    3433
    3534#include "Weapon.h"
    36 #include "WeaponSlot.h"
    3735#include "WeaponSystem.h"
    3836#include "DefaultWeaponmodeLink.h"
  • code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.h

    r3053 r3196  
    3434
    3535#include <set>
    36 
    3736#include "core/BaseObject.h"
    3837
  • code/trunk/src/orxonox/objects/weaponsystem/WeaponSet.h

    r3053 r3196  
    3434
    3535#include <map>
    36 
    3736#include "core/BaseObject.h"
    3837
  • code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.h

    r3053 r3196  
    3333#include "OrxonoxPrereqs.h"
    3434
     35#include <map>
    3536#include <set>
    36 #include <map>
    3737#include <vector>
    38 
    3938#include "core/BaseObject.h"
    4039
  • code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.cc

    r3110 r3196  
    2828
    2929#include "FusionMunition.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
  • code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.cc

    r3110 r3196  
    2828
    2929#include "LaserMunition.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
  • code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.cc

    r3110 r3196  
    2828
    2929#include "ReplenishingMunition.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
  • code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.h

    r3053 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include "tools/Timer.h"
    3335#include "objects/weaponsystem/Munition.h"
    34 #include "tools/Timer.h"
    3536
    3637namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.cc

    r3110 r3196  
    2929#include "BillboardProjectile.h"
    3030
    31 #include <OgreBillboardSet.h>
    32 
     31#include "core/CoreIncludes.h"
    3332#include "core/GameMode.h"
    34 #include "core/CoreIncludes.h"
    3533#include "objects/Scene.h"
    3634
     
    4644        {
    4745            assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity
    48             this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5, 0.5, 0.7, 0.8), 1);
     46            this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5f, 0.5f, 0.7f, 0.8f), 1);
    4947            this->attachOgreObject(this->billboard_.getBillboardSet());
    5048        }
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.h

    r3053 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
     35#include "tools/BillboardSet.h"
    3436#include "Projectile.h"
    35 #include "tools/BillboardSet.h"
    36 #include "util/Math.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc

    r3110 r3196  
    2929#include "LightningGunProjectile.h"
    3030
    31 #include <OgreBillboardSet.h>
    32 
    33 #include "core/GameMode.h"
     31#include "util/Convert.h"
    3432#include "core/CoreIncludes.h"
    35 #include "objects/Scene.h"
    36 #include "util/Convert.h"
    3733
    3834namespace orxonox
     
    4642        this->textureIndex_ = 1;
    4743        this->maxTextureIndex_ = 8;
    48         this->textureTimer_.setTimer(0.01, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));
     44        this->textureTimer_.setTimer(0.01f, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));
    4945       
    5046        registerVariables();
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h

    r3088 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <string>
    3435#include "tools/Timer.h"
    35 
    3636#include "BillboardProjectile.h"
    3737
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc

    r3110 r3196  
    2929#include "ParticleProjectile.h"
    3030
    31 #include <OgreParticleSystem.h>
    3231#include <OgreParticleEmitter.h>
    33 
    34 #include "core/GameMode.h"
     32#include "tools/ParticleInterface.h"
    3533#include "core/CoreIncludes.h"
    36 #include "core/ConfigValueIncludes.h"
    3734#include "objects/Scene.h"
    3835
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.h

    r3053 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "BillboardProjectile.h"
    35 #include "tools/ParticleInterface.h"
    36 #include "util/Math.h"
    3734
    3835namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc

    r3110 r3196  
    2929#include "Projectile.h"
    3030
    31 #include <OgreBillboard.h>
    32 
    3331#include "core/CoreIncludes.h"
     32#include "core/ConfigValueIncludes.h"
    3433#include "core/Executor.h"
    35 #include "core/ConfigValueIncludes.h"
    36 #include "core/Iterator.h"
    37 #include "tools/ParticleInterface.h"
    38 
    39 #include "objects/worldentities/Model.h"
     34#include "core/GameMode.h"
     35#include "objects/collisionshapes/SphereCollisionShape.h"
     36#include "objects/worldentities/pawns/Pawn.h"
    4037#include "objects/worldentities/ParticleSpawner.h"
    41 #include "objects/collisionshapes/SphereCollisionShape.h"
    42 #include "core/GameMode.h"
    4338
    4439namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.h

    r3053 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
     35#include "interfaces/PawnListener.h"
    3436#include "objects/worldentities/MovableEntity.h"
    35 #include "objects/worldentities/pawns/Pawn.h"
    36 #include "tools/Timer.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
     32#include "core/Executor.h"
    3233#include "core/XMLPort.h"
    33 #include "objects/weaponsystem/projectiles/ParticleProjectile.h"
    3434#include "objects/worldentities/Model.h"
     35
     36#include "objects/weaponsystem/projectiles/Projectile.h"
    3537#include "objects/weaponsystem/MuzzleFlash.h"
    36 
    3738#include "objects/weaponsystem/Weapon.h"
    3839#include "objects/weaponsystem/WeaponPack.h"
     
    6970    {
    7071        this->material_ = material;
    71     }
    72 
    73     std::string& EnergyDrink::getMaterial()
    74     {
    75         return this->material_;
    7672    }
    7773
  • code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.h

    r3053 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <string>
     35#include "tools/Timer.h"
    3336#include "objects/weaponsystem/WeaponMode.h"
    34 #include "tools/Timer.h"
    3537
    3638namespace orxonox
     
    4749        private:
    4850            void setMaterial(const std::string& material);
    49             std::string& getMaterial();
     51            inline const std::string& getMaterial()
     52                { return this->material_; }
    5053            void setDelay(float d);
    5154            float getDelay() const;
  • code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.cc

    r3110 r3196  
    2929#include "FusionFire.h"
    3030
     31#include "util/Math.h"
    3132#include "core/CoreIncludes.h"
    3233#include "objects/weaponsystem/projectiles/BillboardProjectile.h"
  • code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
     32#include "core/Executor.h"
    3233#include "core/XMLPort.h"
    33 #include "objects/weaponsystem/projectiles/ParticleProjectile.h"
    3434#include "objects/worldentities/Model.h"
     35
     36#include "objects/weaponsystem/projectiles/Projectile.h"
    3537#include "objects/weaponsystem/MuzzleFlash.h"
    36 
    3738#include "objects/weaponsystem/Weapon.h"
    3839#include "objects/weaponsystem/WeaponPack.h"
  • code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.h

    r3053 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include "tools/Timer.h"
    3335#include "objects/weaponsystem/WeaponMode.h"
    34 #include "tools/Timer.h"
    3536
    3637namespace orxonox
  • code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "objects/weaponsystem/projectiles/ParticleProjectile.h"
    33 
    3433#include "objects/weaponsystem/Weapon.h"
    3534#include "objects/weaponsystem/WeaponPack.h"
  • code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
    32 
    33 #include "objects/worldentities/Billboard.h"
    34 
     32#include "objects/weaponsystem/projectiles/LightningGunProjectile.h"
    3533#include "objects/weaponsystem/Weapon.h"
    3634#include "objects/weaponsystem/WeaponPack.h"
    3735#include "objects/weaponsystem/WeaponSystem.h"
    38 
    39 #include "objects/weaponsystem/projectiles/LightningGunProjectile.h"
    40 
    41 #include "util/Math.h"
    4236
    4337namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Attacher.h

    r3078 r3196  
    3333
    3434#include <list>
    35 
     35#include <string>
     36#include "core/XMLNameListener.h"
    3637#include "objects/worldentities/StaticEntity.h"
    37 #include "core/XMLNameListener.h"
    3838
    3939namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Backlight.cc

    r3110 r3196  
    3131#include <OgreRibbonTrail.h>
    3232#include <OgreSceneManager.h>
    33 
     33#include <OgreSceneNode.h>
     34
     35#include "util/Exception.h"
     36#include "core/CoreIncludes.h"
    3437#include "core/GameMode.h"
    35 #include "core/CoreIncludes.h"
    36 #include "core/Executor.h"
    3738#include "core/XMLPort.h"
    3839#include "objects/Scene.h"
    39 #include "util/Exception.h"
    4040
    4141namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Backlight.h

    r3068 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <string>
     35#include "interfaces/TimeFactorListener.h"
    3336#include "FadingBillboard.h"
    34 #include "tools/TimeFactorListener.h"
    3537
    3638namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/BigExplosion.cc

    r3110 r3196  
    2828
    2929#include "BigExplosion.h"
    30 #include "MovableEntity.h"
     30
     31//#include <sstream>
     32
     33#include "util/Exception.h"
     34#include "core/CoreIncludes.h"
     35#include "core/CommandExecutor.h"
     36#include "core/Executor.h"
     37#include "core/GameMode.h"
     38#include "tools/ParticleInterface.h"
     39#include "objects/Scene.h"
     40#include "objects/worldentities/ParticleSpawner.h"
    3141#include "Model.h"
    32 
    33 #include <OgreParticleSystem.h>
    34 #include <OgreSceneNode.h>
    35 #include <sstream>
    36 
    37 #include "core/GameMode.h"
    38 #include "core/CoreIncludes.h"
    39 #include "core/Executor.h"
    40 #include "core/CommandExecutor.h"
    41 #include "objects/Scene.h"
    42 #include "tools/ParticleInterface.h"
    43 #include "objects/worldentities/ParticleSpawner.h"
    44 #include "util/Exception.h"
    4542
    4643namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/BigExplosion.h

    r3087 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
    3334#include <string>
    34 
    35 
     35#include "tools/Timer.h"
    3636#include "MovableEntity.h"
    37 #include "tools/Timer.h"
    3837
    3938namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Billboard.cc

    r3110 r3196  
    2929#include "Billboard.h"
    3030
    31 #include <OgreBillboardSet.h>
    32 
    3331#include "core/CoreIncludes.h"
     32#include "core/GameMode.h"
    3433#include "core/XMLPort.h"
    35 #include "core/GameMode.h"
    3634#include "objects/Scene.h"
    3735
  • code/trunk/src/orxonox/objects/worldentities/Billboard.h

    r3053 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include "StaticEntity.h"
     33
    3434#include "util/Math.h"
    3535#include "tools/BillboardSet.h"
    36 #include "objects/Teamcolourable.h"
     36#include "interfaces/TeamColourable.h"
     37#include "StaticEntity.h"
    3738
    3839namespace orxonox
    3940{
    40     class _OrxonoxExport Billboard : public StaticEntity, public Teamcolourable
     41    class _OrxonoxExport Billboard : public StaticEntity, public TeamColourable
    4142    {
    4243        public:
  • code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc

    r3110 r3196  
    2929#include "BlinkingBillboard.h"
    3030
     31#include "core/CoreIncludes.h"
    3132#include "core/GameMode.h"
    32 #include "core/CoreIncludes.h"
    3333#include "core/XMLPort.h"
    34 #include "util/Math.h"
    3534
    3635namespace orxonox
     
    8079            this->time_ += dt;
    8180            if (this->bQuadratic_)
    82                 this->setScale(this->amplitude_ * square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_)));
     81                this->setScale(this->amplitude_ * static_cast<float>(square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));
    8382            else
    84                 this->setScale(this->amplitude_ * sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_));
     83                this->setScale(this->amplitude_ * static_cast<float>(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_)));
    8584        }
    8685    }
  • code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.h

    r2087 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include "util/Math.h"
     35#include "interfaces/Tickable.h"
    3336#include "Billboard.h"
    34 #include "objects/Tickable.h"
    3537
    3638namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Camera.cc

    r3110 r3196  
    2929#include "Camera.h"
    3030
    31 #include <string>
    32 #include <cassert>
    33 
    3431#include <OgreCamera.h>
    3532#include <OgreSceneManager.h>
     
    3734
    3835#include "util/Exception.h"
     36#include "util/String.h"
    3937#include "core/CoreIncludes.h"
    4038#include "core/ConfigValueIncludes.h"
  • code/trunk/src/orxonox/objects/worldentities/Camera.h

    r3068 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <OgrePrerequisites.h>
     34#include "util/OgreForwardRefs.h"
     35#include "interfaces/Tickable.h"
    3536#include "objects/worldentities/StaticEntity.h"
    36 #include "objects/Tickable.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc

    r3110 r3196  
    2828
    2929#include "CameraPosition.h"
    30 
    31 #include <OgreCamera.h>
    3230
    3331#include "core/CoreIncludes.h"
  • code/trunk/src/orxonox/objects/worldentities/CameraPosition.h

    r3089 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "objects/worldentities/StaticEntity.h"
    3534
  • code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc

    r3110 r3196  
    3030
    3131#include <OgreSceneManager.h>
     32#include <OgreSceneNode.h>
    3233
    3334#include "core/CoreIncludes.h"
     
    3536#include "core/GameMode.h"
    3637#include "core/XMLPort.h"
    37 #include "core/Template.h"
    3838
    3939#include "objects/Scene.h"
  • code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h

    r3089 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <list>
     35#include <string>
     36#include "util/Math.h"
    3337#include "MobileEntity.h"
    3438
  • code/trunk/src/orxonox/objects/worldentities/ExplosionChunk.cc

    r3110 r3196  
    2929#include "ExplosionChunk.h"
    3030
    31 #include <OgreParticleSystem.h>
    32 
    33 #include "core/GameMode.h"
    3431#include "core/CoreIncludes.h"
    3532#include "core/Executor.h"
     33#include "core/GameMode.h"
     34#include "util/Exception.h"
    3635#include "objects/Scene.h"
    3736#include "tools/ParticleInterface.h"
    38 #include "util/Exception.h"
    3937
    4038namespace orxonox
     
    153151            Vector3 change(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));
    154152            change.normalise();
    155             change *= rnd(0.4, 0.8);
     153            change *= rnd(0.4f, 0.8f);
    156154            Vector3 velocity = this->getVelocity();
    157155            velocity.normalise();
    158156            velocity += change;
    159157            velocity.normalise();
    160             velocity *= length * rnd(0.8, 1.0);
     158            velocity *= length * rnd(0.8f, 1.0f);
    161159
    162160            this->setVelocity(velocity);
  • code/trunk/src/orxonox/objects/worldentities/ExplosionChunk.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
    3435#include "MovableEntity.h"
    35 #include "tools/Timer.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/FadingBillboard.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/Executor.h"
    3332#include "core/XMLPort.h"
    3433
  • code/trunk/src/orxonox/objects/worldentities/FadingBillboard.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include "util/Math.h"
     35#include "tools/Timer.h"
     36#include "interfaces/Tickable.h"
    3337#include "Billboard.h"
    34 #include "objects/Tickable.h"
    35 #include "tools/Timer.h"
    3638
    3739namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/ForceField.cc

    r3064 r3196  
    2828
    2929#include "ForceField.h"
    30 #include "core/XMLPort.h"
    3130
    3231#include "core/CoreIncludes.h"
     32#include "core/XMLPort.h"
    3333#include "objects/worldentities/MobileEntity.h"
    3434
  • code/trunk/src/orxonox/objects/worldentities/ForceField.h

    r3064 r3196  
    3131#define _ForceField_H__
    3232
     33#include "OrxonoxPrereqs.h"
     34
     35#include "interfaces/Tickable.h"
    3336#include "StaticEntity.h"
    34 #include "objects/Tickable.h"
    3537
    3638namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Light.cc

    r3110 r3196  
    2929#include "Light.h"
    3030
    31 #include <sstream>
    32 #include <cassert>
    33 
    3431#include <OgreSceneManager.h>
     32#include <OgreLight.h>
     33#include <boost/static_assert.hpp>
    3534
    3635#include "util/String.h"
    3736#include "util/Exception.h"
     37#include "core/CoreIncludes.h"
    3838#include "core/GameMode.h"
    39 #include "core/CoreIncludes.h"
    4039#include "core/XMLPort.h"
    4140#include "objects/Scene.h"
     
    4443{
    4544    CreateFactory(Light);
     45
     46    // Be sure we don't do bad conversions
     47    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT       == (int)Light::LT_POINT);
     48    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::LT_DIRECTIONAL);
     49    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::LT_SPOTLIGHT);
    4650
    4751    Light::Light(BaseObject* creator) : StaticEntity(creator)
     
    5256        this->diffuse_ = ColourValue::White;
    5357        this->specular_ = ColourValue::White;
    54         this->type_ = Ogre::Light::LT_POINT;
     58        this->type_ = Light::LT_POINT;
    5559        this->attenuation_ = Vector4(100000, 1, 0, 0);
    5660        this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f);
     
    136140    {
    137141        if (type == "point")
    138             this->setType(Ogre::Light::LT_POINT);
     142            this->setType(Light::LT_POINT);
    139143        else if (type == "directional")
    140             this->setType(Ogre::Light::LT_DIRECTIONAL);
     144            this->setType(Light::LT_DIRECTIONAL);
    141145        else if (type == "spotlight")
    142             this->setType(Ogre::Light::LT_SPOTLIGHT);
     146            this->setType(Light::LT_SPOTLIGHT);
    143147        else
    144             this->setType(Ogre::Light::LT_POINT);
     148            this->setType(Light::LT_POINT);
    145149    }
    146150
     
    149153        switch (this->type_)
    150154        {
    151             case Ogre::Light::LT_DIRECTIONAL:
     155            case Light::LT_DIRECTIONAL:
    152156                return "directional";
    153             case Ogre::Light::LT_SPOTLIGHT:
     157            case Light::LT_SPOTLIGHT:
    154158                return "spotlight";
    155             case Ogre::Light::LT_POINT:
     159            case Light::LT_POINT:
    156160            default:
    157161                return "point";
     
    163167        if (this->light_)
    164168        {
    165             this->light_->setType(this->type_);
     169            this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_));
    166170
    167171            if (this->type_ != Ogre::Light::LT_DIRECTIONAL)
  • code/trunk/src/orxonox/objects/worldentities/Light.h

    r2826 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include "StaticEntity.h"
    3433
    3534#include <string>
    36 #include <OgreLight.h>
    37 
    3835#include "util/Math.h"
    39 #include "objects/Teamcolourable.h"
     36#include "interfaces/TeamColourable.h"
     37#include "StaticEntity.h"
    4038
    4139namespace orxonox
    4240{
    43     class _OrxonoxExport Light : public StaticEntity, public Teamcolourable
     41    class _OrxonoxExport Light : public StaticEntity, public TeamColourable
    4442    {
     43        public:
     44            enum LightTypes // Copy from the Ogre enum
     45            {
     46                /// Point light sources give off light equally in all directions, so require only position not direction
     47                LT_POINT,
     48                /// Directional lights simulate parallel light beams from a distant source, hence have direction but no position
     49                LT_DIRECTIONAL,
     50                /// Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff
     51                LT_SPOTLIGHT
     52            };
     53
    4554        public:
    4655            Light(BaseObject* creator);
     
    5564                { return this->light_; }
    5665
    57             inline void setType(Ogre::Light::LightTypes type)
     66            inline void setType(Light::LightTypes type)
    5867                { this->type_ = type; this->updateType(); }
    59             inline Ogre::Light::LightTypes getType() const
     68            inline Light::LightTypes getType() const
    6069                { return this->type_; }
    6170
     
    133142
    134143            Ogre::Light* light_;
    135             Ogre::Light::LightTypes type_;
     144            LightTypes type_;
    136145            ColourValue diffuse_;
    137146            ColourValue specular_;
  • code/trunk/src/orxonox/objects/worldentities/MobileEntity.cc

    r3110 r3196  
    3030
    3131#include <OgreSceneNode.h>
    32 #include "BulletDynamics/Dynamics/btRigidBody.h"
    33 
    34 #include "util/Debug.h"
    35 #include "util/MathConvert.h"
    36 #include "util/Exception.h"
     32#include <BulletDynamics/Dynamics/btRigidBody.h>
     33
    3734#include "core/CoreIncludes.h"
    3835#include "core/XMLPort.h"
    39 
    4036#include "objects/Scene.h"
    4137
     
    9692                this->angularVelocity_.z += angularAcceleration_.z * dt;
    9793                // Calculate new orientation with quaternion derivative. This is about 30% faster than with angle/axis method.
    98                 float mult = dt * 0.5;
     94                float mult = dt * 0.5f;
    9995                // TODO: this could be optimized by writing it out. The calls currently create 4 new Quaternions!
    10096                Quaternion newOrientation(0.0f, this->angularVelocity_.x * mult, this->angularVelocity_.y * mult, this->angularVelocity_.z * mult);
  • code/trunk/src/orxonox/objects/worldentities/MobileEntity.h

    r3084 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
     35#include "interfaces/Tickable.h"
    3436#include "WorldEntity.h"
    35 #include "objects/Tickable.h"
    3637
    3738namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Model.cc

    r3110 r3196  
    2727 */
    2828
     29#include "Model.h"
    2930
    3031#include <OgreEntity.h>
    31 #include "Model.h"
     32
     33#include "core/CoreIncludes.h"
    3234#include "core/GameMode.h"
    33 #include "core/CoreIncludes.h"
    3435#include "core/XMLPort.h"
    3536#include "objects/Scene.h"
  • code/trunk/src/orxonox/objects/worldentities/Model.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <string>
     35#include "tools/Mesh.h"
    3336#include "StaticEntity.h"
    34 #include "tools/Mesh.h"
    3537
    3638namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc

    r3110 r3196  
    3131
    3232#include "core/CoreIncludes.h"
    33 #include "core/XMLPort.h"
    3433#include "core/Executor.h"
    3534#include "core/GameMode.h"
     35#include "core/XMLPort.h"
    3636#include "objects/worldentities/pawns/Pawn.h"
    3737
  • code/trunk/src/orxonox/objects/worldentities/MovableEntity.h

    r3033 r3196  
    3333#include "OrxonoxPrereqs.h"
    3434
    35 #include "MobileEntity.h"
     35#include "util/Math.h"
    3636#include "network/ClientConnectionListener.h"
    3737#include "tools/Timer.h"
     38#include "MobileEntity.h"
    3839
    3940namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc

    r3110 r3196  
    3434#include "ParticleEmitter.h"
    3535
    36 #include <OgreParticleSystem.h>
    37 
     36#include "util/Exception.h"
     37#include "core/CoreIncludes.h"
     38#include "core/GameMode.h"
     39#include "core/XMLPort.h"
    3840#include "tools/ParticleInterface.h"
    39 #include "util/Exception.h"
    40 #include "core/GameMode.h"
    41 #include "core/CoreIncludes.h"
    42 #include "core/XMLPort.h"
    4341#include "objects/Scene.h"
    4442
  • code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <string>
    3335#include "StaticEntity.h"
    3436
  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc

    r3110 r3196  
    7575        SUPER(ParticleSpawner, processEvent, event);
    7676
    77         SetEvent(ParticleSpawner, "spawn", spawn, event);
     77        ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);
    7878    }
    7979
  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.h

    r3068 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
    3435#include "ParticleEmitter.h"
    35 #include "tools/Timer.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/Planet.cc

    r3110 r3196  
    2929#include "Planet.h"
    3030
    31 #include <math.h>
    32 
    3331#include <OgreEntity.h>
    3432#include <OgreBillboardSet.h>
    35 #include <OgreHardwareVertexBuffer.h>
    36 #include <OgreMeshManager.h>
     33#include <OgreProgressiveMesh.h>
    3734
    3835#include "core/CoreIncludes.h"
     36#include "core/GameMode.h"
    3937#include "core/XMLPort.h"
    4038#include "objects/Scene.h"
     39#include "Camera.h"
    4140#include "CameraManager.h"
    42 #include "Camera.h"
    43 #include "GraphicsManager.h"
    4441
    4542namespace orxonox
     
    7067            return;
    7168
    72         Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
    73         if(activeCamera)
     69        if (GameMode::showsGraphics())
    7470        {
    75             float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
    76             //             COUT(2) << distance << std::endl;
    77             float planetRadius = this->getScale();
     71            Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
     72            if(activeCamera)
     73            {
     74                float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
     75                //             COUT(2) << distance << std::endl;
     76                float planetRadius = this->getScale();
    7877
    79             float newScale = 2 * distance / sqrt(distance*distance - planetRadius*planetRadius);
    80             float tempTest = newScale*(1+float(this->atmosphereSize)/float(this->imageSize));
    81             newScale = tempTest;
     78                float newScale = 2 * distance / sqrt(distance*distance - planetRadius*planetRadius);
     79                float tempTest = newScale*(1+float(this->atmosphereSize)/float(this->imageSize));
     80                newScale = tempTest;
    8281
    83             this->billboard_.getBillboardSet()->setDefaultDimensions(newScale, newScale);
     82                this->billboard_.getBillboardSet()->setDefaultDimensions(newScale, newScale);
     83            }
    8484        }
    8585
     
    9191        float scaleFactor = this->getScale();
    9292
    93         this->distList.push_back(10.0*scaleFactor);
    94         this->distList.push_back(19.0*scaleFactor);
    95         this->distList.push_back(27.0*scaleFactor);
    96         this->distList.push_back(34.0*scaleFactor);
    97         this->distList.push_back(40.0*scaleFactor);
    98         this->distList.push_back(45.0*scaleFactor);
    99         this->distList.push_back(49.0*scaleFactor);
    100         this->distList.push_back(52.0*scaleFactor);
    101         this->distList.push_back(54.0*scaleFactor);
    102         this->distList.push_back(55.0*scaleFactor);
     93        this->distList.push_back(10.0f*scaleFactor);
     94        this->distList.push_back(19.0f*scaleFactor);
     95        this->distList.push_back(27.0f*scaleFactor);
     96        this->distList.push_back(34.0f*scaleFactor);
     97        this->distList.push_back(40.0f*scaleFactor);
     98        this->distList.push_back(45.0f*scaleFactor);
     99        this->distList.push_back(49.0f*scaleFactor);
     100        this->distList.push_back(52.0f*scaleFactor);
     101        this->distList.push_back(54.0f*scaleFactor);
     102        this->distList.push_back(55.0f*scaleFactor);
    103103
    104         float reductionValue = 0.2;
     104        float reductionValue = 0.2f;
    105105
    106106        this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
     
    145145        SUPER(Planet, XMLPort, xmlelement, mode);
    146146
    147         XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
    148         XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);     
    149         XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);         
    150         XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    151         XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     147        if (GameMode::showsGraphics())
     148        {
     149            XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
     150            XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);     
     151            XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);         
     152            XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
     153            XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     154        }
    152155    }
    153156
  • code/trunk/src/orxonox/objects/worldentities/Planet.h

    r2710 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <OgreMesh.h>
    35 
     34#include <string>
    3635#include "tools/BillboardSet.h"
    3736#include "tools/Mesh.h"
    3837#include "MovableEntity.h"
    39 #include "objects/Tickable.h"
    4038
    4139namespace orxonox
     
    108106            float atmosphereSize;
    109107            float imageSize;
    110             Ogre::Mesh::LodDistanceList distList;
     108            std::vector<float> distList;
    111109            BillboardSet billboard_;
    112110            bool bCastShadows_;
  • code/trunk/src/orxonox/objects/worldentities/PongBall.cc

    r3110 r3196  
    3232#include "core/GameMode.h"
    3333#include "objects/gametypes/Gametype.h"
     34#include "objects/worldentities/PongBat.h"
    3435#include "sound/SoundBase.h"
    3536
     
    4950        this->batID_[0] = OBJECTID_UNKNOWN;
    5051        this->batID_[1] = OBJECTID_UNKNOWN;
    51         this->relMercyOffset_ = 0.05;
     52        this->relMercyOffset_ = 0.05f;
    5253
    5354        this->registerVariables();
     
    102103                    if (position.x > this->fieldWidth_ / 2 && this->bat_[1])
    103104                    {
    104                         distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
     105                        distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
    105106                        if (fabs(distance) <= 1)
    106107                        {
     
    122123                    if (position.x < -this->fieldWidth_ / 2 && this->bat_[0])
    123124                    {
    124                         distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
     125                        distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
    125126                        if (fabs(distance) <= 1)
    126127                        {
     
    172173              if (position.x > this->fieldWidth_ / 2 && this->bat_[1])
    173174              {
    174                 distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
     175                distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
    175176                if (fabs(distance) <= 1)
    176177                {
     
    183184              if (position.x < -this->fieldWidth_ / 2 && this->bat_[0])
    184185              {
    185                 distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
     186                distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
    186187                if (fabs(distance) <= 1)
    187188                {
     
    217218        }
    218219    }
     220
     221    void PongBall::setBats(PongBat** bats)
     222    {
     223        this->bat_ = bats;
     224        this->batID_[0] = this->bat_[0]->getObjectID();
     225        this->batID_[1] = this->bat_[1]->getObjectID();
     226    }
     227
     228    void PongBall::applyBats()
     229    {
     230        if (!this->bat_)
     231            this->bat_ = new PongBat*[2];
     232        if (this->batID_[0] != OBJECTID_UNKNOWN)
     233            this->bat_[0] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[0]));
     234        if (this->batID_[1] != OBJECTID_UNKNOWN)
     235            this->bat_[1] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[1]));
     236    }
    219237}
  • code/trunk/src/orxonox/objects/worldentities/PongBall.h

    r3108 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
    3435#include "objects/worldentities/MovableEntity.h"
    35 #include "objects/worldentities/PongBat.h"
    3636
    3737namespace orxonox
     
    6363                { return this->batlength_; }
    6464
    65             void setBats(PongBat** bats)
    66             { this->bat_ = bats; this->batID_[0] = this->bat_[0]->getObjectID(); this->batID_[1] = this->bat_[1]->getObjectID(); }
    67 
    68             void applyBats()
    69             { if(!this->bat_) this->bat_ = new PongBat*[2]; if(this->batID_[0] != OBJECTID_UNKNOWN) this->bat_[0] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[0])); if(this->batID_[1] != OBJECTID_UNKNOWN) this->bat_[1] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[1])); }
     65            void setBats(PongBat** bats);
     66            void applyBats();
    7067
    7168            static const float MAX_REL_Z_VELOCITY;
  • code/trunk/src/orxonox/objects/worldentities/PongBat.h

    r2839 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "objects/worldentities/ControllableEntity.h"
    3534
  • code/trunk/src/orxonox/objects/worldentities/PongCenterpoint.h

    r2826 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <string>
     35#include <util/Math.h>
    3436#include "objects/worldentities/StaticEntity.h"
    3537
  • code/trunk/src/orxonox/objects/worldentities/SpawnPoint.cc

    r3110 r3196  
    3030
    3131#include "core/CoreIncludes.h"
     32#include "core/Template.h"
    3233#include "core/XMLPort.h"
    3334#include "objects/gametypes/Gametype.h"
     35#include "objects/worldentities/pawns/Pawn.h"
    3436
    3537namespace orxonox
     
    7173    }
    7274
     75    void SpawnPoint::setTemplate(Template* temp)
     76    {
     77        this->template_ = temp;
     78        this->templatename_ = temp->getName();
     79    }
     80
    7381    Pawn* SpawnPoint::spawn()
    7482    {
  • code/trunk/src/orxonox/objects/worldentities/SpawnPoint.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <string>
    3435#include "core/Identifier.h"
    35 #include "core/Template.h"
    36 #include "objects/worldentities/pawns/Pawn.h"
    3736#include "objects/worldentities/StaticEntity.h"
    3837
     
    5251                { return this->spawnclass_; }
    5352
    54             inline void setTemplate(Template* temp)
    55                 { this->template_ = temp; this->templatename_ = temp->getName(); }
     53            void setTemplate(Template* temp);
    5654            inline Template* getTemplate() const
    5755                { return this->template_; }
  • code/trunk/src/orxonox/objects/worldentities/StaticEntity.cc

    r3110 r3196  
    3131
    3232#include <OgreSceneNode.h>
    33 #include "BulletDynamics/Dynamics/btRigidBody.h"
    34 
    35 #include "util/Exception.h"
     33#include <BulletDynamics/Dynamics/btRigidBody.h>
     34#include "util/OrxAssert.h"
    3635#include "core/CoreIncludes.h"
    3736
  • code/trunk/src/orxonox/objects/worldentities/TeamSpawnPoint.h

    r2826 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "objects/worldentities/pawns/Pawn.h"
    3435#include "SpawnPoint.h"
    3536
  • code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc

    r3110 r3196  
    3030#include "WorldEntity.h"
    3131
    32 #include <cassert>
     32#include <OgreBillboardSet.h>
     33#include <OgreCamera.h>
     34#include <OgreEntity.h>
     35#include <OgreParticleSystem.h>
     36#include <OgreSceneManager.h>
    3337#include <OgreSceneNode.h>
    34 #include <OgreSceneManager.h>
    35 #include "BulletDynamics/Dynamics/btRigidBody.h"
    36 
     38#include <BulletDynamics/Dynamics/btRigidBody.h>
     39#include <boost/static_assert.hpp>
     40
     41#include "util/OrxAssert.h"
     42#include "util/Convert.h"
    3743#include "util/Exception.h"
    38 #include "util/Convert.h"
    3944#include "core/CoreIncludes.h"
    4045#include "core/XMLPort.h"
    41 
    4246#include "objects/Scene.h"
    4347#include "objects/collisionshapes/WorldEntityCollisionShape.h"
     
    5155    const Vector3 WorldEntity::DOWN  = Vector3::NEGATIVE_UNIT_Y;
    5256    const Vector3 WorldEntity::UP    = Vector3::UNIT_Y;
     57
     58    // Be sure we don't do bad conversions
     59    BOOST_STATIC_ASSERT((int)Ogre::Node::TS_LOCAL  == (int)WorldEntity::Local);
     60    BOOST_STATIC_ASSERT((int)Ogre::Node::TS_PARENT == (int)WorldEntity::Parent);
     61    BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::World);
    5362
    5463    /**
     
    463472    //! Attaches an Ogre::MovableObject to this WorldEntity.
    464473    void WorldEntity::attachOgreObject(Ogre::MovableObject* object)
    465     {
    466         this->node_->attachObject(object);
    467     }
     474        { this->node_->attachObject(object); }
     475    void WorldEntity::attachOgreObject(Ogre::BillboardSet* object)
     476        { this->node_->attachObject(object); }
     477    void WorldEntity::attachOgreObject(Ogre::Camera* object)
     478        { this->node_->attachObject(object); }
     479    void WorldEntity::attachOgreObject(Ogre::Entity* object)
     480        { this->node_->attachObject(object); }
     481    void WorldEntity::attachOgreObject(Ogre::ParticleSystem* object)
     482        { this->node_->attachObject(object); }
    468483
    469484    //! Detaches an Ogre::MovableObject from this WorldEntity.
    470485    void WorldEntity::detachOgreObject(Ogre::MovableObject* object)
    471     {
    472         this->node_->detachObject(object);
    473     }
     486        { this->node_->detachObject(object); }
     487    void WorldEntity::detachOgreObject(Ogre::BillboardSet* object)
     488        { this->node_->detachObject(object); }
     489    void WorldEntity::detachOgreObject(Ogre::Camera* object)
     490        { this->node_->detachObject(object); }
     491    void WorldEntity::detachOgreObject(Ogre::Entity* object)
     492        { this->node_->detachObject(object); }
     493    void WorldEntity::detachOgreObject(Ogre::ParticleSystem* object)
     494        { this->node_->detachObject(object); }
    474495
    475496    //! Detaches an Ogre::MovableObject (by string) from this WorldEntity.
     
    501522
    502523    // Note: These functions are placed in WorldEntity.h as inline functions for the release build.
    503 #ifndef NDEBUG
     524#ifndef ORXONOX_RELEASE
    504525    const Vector3& WorldEntity::getPosition() const
    505526    {
     
    574595        Translates this WorldEntity by a vector.
    575596    @param relativeTo
    576         @see TransformSpace::Enum
    577     */
    578     void WorldEntity::translate(const Vector3& distance, TransformSpace::Enum relativeTo)
     597        @see WorldEntity::TransformSpace
     598    */
     599    void WorldEntity::translate(const Vector3& distance, TransformSpace relativeTo)
    579600    {
    580601        switch (relativeTo)
    581602        {
    582         case TransformSpace::Local:
     603        case WorldEntity::Local:
    583604            // position is relative to parent so transform downwards
    584605            this->setPosition(this->getPosition() + this->getOrientation() * distance);
    585606            break;
    586         case TransformSpace::Parent:
     607        case WorldEntity::Parent:
    587608            this->setPosition(this->getPosition() + distance);
    588609            break;
    589         case TransformSpace::World:
     610        case WorldEntity::World:
    590611            // position is relative to parent so transform upwards
    591612            if (this->node_->getParent())
     
    602623        Rotates this WorldEntity by a quaternion.
    603624    @param relativeTo
    604         @see TransformSpace::Enum
    605     */
    606     void WorldEntity::rotate(const Quaternion& rotation, TransformSpace::Enum relativeTo)
     625        @see WorldEntity::TransformSpace
     626    */
     627    void WorldEntity::rotate(const Quaternion& rotation, TransformSpace relativeTo)
    607628    {
    608629        switch(relativeTo)
    609630        {
    610         case TransformSpace::Local:
     631        case WorldEntity::Local:
    611632            this->setOrientation(this->getOrientation() * rotation);
    612633            break;
    613         case TransformSpace::Parent:
     634        case WorldEntity::Parent:
    614635            // Rotations are normally relative to local axes, transform up
    615636            this->setOrientation(rotation * this->getOrientation());
    616637            break;
    617         case TransformSpace::World:
     638        case WorldEntity::World:
    618639            // Rotations are normally relative to local axes, transform up
    619640            this->setOrientation(this->getOrientation() * this->getWorldOrientation().Inverse()
     
    627648        Makes this WorldEntity look a specific target location.
    628649    @param relativeTo
    629         @see TransformSpace::Enum
     650        @see WorldEntity::TransformSpace
    630651    @param localDirectionVector
    631652        The vector which normally describes the natural direction of the object, usually -Z.
    632653    */
    633     void WorldEntity::lookAt(const Vector3& target, TransformSpace::Enum relativeTo, const Vector3& localDirectionVector)
    634     {
    635         Vector3 origin;
     654    void WorldEntity::lookAt(const Vector3& target, TransformSpace relativeTo, const Vector3& localDirectionVector)
     655    {
     656        Vector3 origin(0, 0, 0);
    636657        switch (relativeTo)
    637658        {
    638         case TransformSpace::Local:
     659        case WorldEntity::Local:
    639660            origin = Vector3::ZERO;
    640661            break;
    641         case TransformSpace::Parent:
     662        case WorldEntity::Parent:
    642663            origin = this->getPosition();
    643664            break;
    644         case TransformSpace::World:
     665        case WorldEntity::World:
    645666            origin = this->getWorldPosition();
    646667            break;
     
    653674        Makes this WorldEntity look in specific direction.
    654675    @param relativeTo
    655         @see TransformSpace::Enum
     676        @see WorldEntity::TransformSpace
    656677    @param localDirectionVector
    657678        The vector which normally describes the natural direction of the object, usually -Z.
    658679    */
    659     void WorldEntity::setDirection(const Vector3& direction, TransformSpace::Enum relativeTo, const Vector3& localDirectionVector)
     680    void WorldEntity::setDirection(const Vector3& direction, TransformSpace relativeTo, const Vector3& localDirectionVector)
    660681    {
    661682        Quaternion savedOrientation(this->getOrientation());
    662         Ogre::Node::TransformSpace ogreRelativeTo;
    663         switch (relativeTo)
    664         {
    665         case TransformSpace::Local:
    666             ogreRelativeTo = Ogre::Node::TS_LOCAL; break;
    667         case TransformSpace::Parent:
    668             ogreRelativeTo = Ogre::Node::TS_PARENT; break;
    669         case TransformSpace::World:
    670             ogreRelativeTo = Ogre::Node::TS_WORLD; break;
    671         default: OrxAssert(false, "Faulty TransformSpace::Enum assigned.");
    672         }
    673         this->node_->setDirection(direction, ogreRelativeTo, localDirectionVector);
     683        this->node_->setDirection(direction, static_cast<Ogre::Node::TransformSpace>(relativeTo), localDirectionVector);
    674684        Quaternion newOrientation(this->node_->getOrientation());
    675685        this->node_->setOrientation(savedOrientation);
     
    772782            break;
    773783        case Kinematic:
    774             this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_STATIC_OBJECT | btCollisionObject::CF_KINEMATIC_OBJECT);
     784            this->physicalBody_->setCollisionFlags((this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_STATIC_OBJECT) | btCollisionObject::CF_KINEMATIC_OBJECT);
    775785            break;
    776786        case Static:
    777             this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_KINEMATIC_OBJECT | btCollisionObject::CF_STATIC_OBJECT);
     787            this->physicalBody_->setCollisionFlags((this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_KINEMATIC_OBJECT) | btCollisionObject::CF_STATIC_OBJECT);
    778788            break;
    779789        case None:
  • code/trunk/src/orxonox/objects/worldentities/WorldEntity.h

    r3077 r3196  
    3333#include "OrxonoxPrereqs.h"
    3434
    35 #ifdef NDEBUG
    36 #include <OgreSceneNode.h>
    37 #else
    38 #include <OgrePrerequisites.h>
     35#ifdef ORXONOX_RELEASE
     36#  include <OgreSceneNode.h>
    3937#endif
    40 #include "LinearMath/btMotionState.h"
     38#include <LinearMath/btMotionState.h>
    4139
    4240#include "util/Math.h"
     41#include "util/OgreForwardRefs.h"
    4342#include "core/BaseObject.h"
    4443#include "network/synchronisable/Synchronisable.h"
     
    7574
    7675        public:
     76            // Define our own transform space enum to avoid Ogre includes here
     77            /**
     78            @brief
     79                Enumeration denoting the spaces which a transform can be relative to.
     80            */
     81            enum TransformSpace
     82            {
     83                //! Transform is relative to the local space
     84                Local,
     85                //! Transform is relative to the space of the parent node
     86                Parent,
     87                //! Transform is relative to world space
     88                World
     89            };
     90
     91        public:
    7792            WorldEntity(BaseObject* creator);
    7893            virtual ~WorldEntity();
     
    97112            const Vector3& getWorldPosition() const;
    98113
    99             void translate(const Vector3& distance, TransformSpace::Enum relativeTo = TransformSpace::Parent);
    100             inline void translate(float x, float y, float z, TransformSpace::Enum relativeTo = TransformSpace::Parent)
     114            void translate(const Vector3& distance, TransformSpace relativeTo = WorldEntity::Parent);
     115            inline void translate(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Parent)
    101116                { this->translate(Vector3(x, y, z), relativeTo); }
    102117
     
    114129            const Quaternion& getWorldOrientation() const;
    115130
    116             void rotate(const Quaternion& rotation, TransformSpace::Enum relativeTo = TransformSpace::Local);
    117             inline void rotate(const Vector3& axis, const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     131            void rotate(const Quaternion& rotation, TransformSpace relativeTo = WorldEntity::Local);
     132            inline void rotate(const Vector3& axis, const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    118133                { this->rotate(Quaternion(angle, axis), relativeTo); }
    119134
    120             inline void yaw(const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     135            inline void yaw(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    121136                { this->rotate(Quaternion(angle, Vector3::UNIT_Y), relativeTo); }
    122             inline void pitch(const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     137            inline void pitch(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    123138                { this->rotate(Quaternion(angle, Vector3::UNIT_X), relativeTo); }
    124             inline void roll(const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     139            inline void roll(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    125140                { this->rotate(Quaternion(angle, Vector3::UNIT_Z), relativeTo); }
    126141
    127             void lookAt(const Vector3& target, TransformSpace::Enum relativeTo = TransformSpace::Parent, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    128             void setDirection(const Vector3& direction, TransformSpace::Enum relativeTo = TransformSpace::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    129             inline void setDirection(float x, float y, float z, TransformSpace::Enum relativeTo = TransformSpace::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
     142            void lookAt(const Vector3& target, TransformSpace relativeTo = WorldEntity::Parent, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
     143            void setDirection(const Vector3& direction, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
     144            inline void setDirection(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
    130145                { this->setDirection(Vector3(x, y, z), relativeTo, localDirectionVector); }
    131146
     
    157172                { return this->children_; }
    158173
    159             void attachOgreObject(Ogre::MovableObject* object);
    160             void detachOgreObject(Ogre::MovableObject* object);
     174            void attachOgreObject(Ogre::MovableObject*  object);
     175            void attachOgreObject(Ogre::BillboardSet*   object);
     176            void attachOgreObject(Ogre::Camera*         object);
     177            void attachOgreObject(Ogre::Entity*         object);
     178            void attachOgreObject(Ogre::ParticleSystem* object);
     179
     180            void detachOgreObject(Ogre::MovableObject*  object);
     181            void detachOgreObject(Ogre::BillboardSet*   object);
     182            void detachOgreObject(Ogre::Camera*         object);
     183            void detachOgreObject(Ogre::Entity*         object);
     184            void detachOgreObject(Ogre::ParticleSystem* object);
     185
    161186            Ogre::MovableObject* detachOgreObject(const Ogre::String& name);
    162187
     
    427452
    428453    // Inline heavily used functions for release builds. In debug, we better avoid including OgreSceneNode here.
    429 #ifdef NDEBUG
     454#ifdef ORXONOX_RELEASE
    430455    inline const Vector3& WorldEntity::getPosition() const
    431456        { return this->node_->getPosition(); }
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r3110 r3196  
    2929#include "Pawn.h"
    3030
     31#include "core/CoreIncludes.h"
    3132#include "core/GameMode.h"
    32 #include "core/CoreIncludes.h"
    3333#include "core/XMLPort.h"
    34 #include "util/Math.h"
     34#include "network/NetworkFunction.h"
     35
     36#include "interfaces/PawnListener.h"
    3537#include "PawnManager.h"
    3638#include "objects/infos/PlayerInfo.h"
     
    3941#include "objects/worldentities/ExplosionChunk.h"
    4042#include "objects/worldentities/BigExplosion.h"
    41 
    4243#include "objects/weaponsystem/WeaponSystem.h"
    4344#include "objects/weaponsystem/WeaponSlot.h"
     
    4546#include "objects/weaponsystem/WeaponSet.h"
    4647
    47 #include "network/NetworkFunction.h"
    4848
    4949namespace orxonox
     
    373373        this->isHumanShip_ = true;
    374374    }
    375 
    376 
    377     ///////////////////
    378     // Pawn Listener //
    379     ///////////////////
    380     PawnListener::PawnListener()
    381     {
    382         RegisterRootObject(PawnListener);
    383     }
    384375}
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h

    r3089 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
     33
     34#include <string>
     35#include "interfaces/RadarViewable.h"
    3336#include "objects/worldentities/ControllableEntity.h"
    34 #include "objects/RadarViewable.h"
    3537#include "objects/pickup/PickupCollection.h"
    3638
     
    147149                { this->weaponSystem_ = weaponsystem; }
    148150    };
    149 
    150     class _OrxonoxExport PawnListener : virtual public OrxonoxClass
    151     {
    152         public:
    153             PawnListener();
    154             virtual ~PawnListener() {}
    155 
    156             virtual void destroyedPawn(Pawn* pawn) = 0;
    157     };
    158151}
    159152
  • code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc

    r3110 r3196  
    2929#include "SpaceShip.h"
    3030
    31 #include "BulletDynamics/Dynamics/btRigidBody.h"
    32 
    33 #include "util/Math.h"
    34 #include "util/Exception.h"
     31#include <BulletDynamics/Dynamics/btRigidBody.h>
     32
    3533#include "core/CoreIncludes.h"
    3634#include "core/ConfigValueIncludes.h"
  • code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include "LinearMath/btVector3.h"
    35 
     34#include <string>
     35#include <LinearMath/btVector3.h>
     36#include "util/Math.h"
    3637#include "Pawn.h"
    3738
  • code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc

    r3110 r3196  
    2929#include "Spectator.h"
    3030
    31 #include <OgreBillboardSet.h>
    32 
    3331#include "core/CoreIncludes.h"
    3432#include "core/ConfigValueIncludes.h"
    3533#include "core/GameMode.h"
    36 #include "objects/worldentities/Model.h"
     34
     35#include "tools/BillboardSet.h"
    3736#include "objects/Scene.h"
    3837#include "objects/infos/PlayerInfo.h"
    39 #include "objects/gametypes/Gametype.h"
    40 #include "tools/BillboardSet.h"
    41 #include "overlays/OverlayText.h"
    42 #include "overlays/OverlayGroup.h"
    43 #include "util/Convert.h"
    4438
    4539namespace orxonox
     
    6559        {
    6660            this->greetingFlare_ = new BillboardSet();
    67             this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);
     61            this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0f, 1.0f, 0.8f), Vector3(0, 20, 0), 1);
    6862            if (this->greetingFlare_->getBillboardSet())
    6963                this->attachOgreObject(this->greetingFlare_->getBillboardSet());
  • code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h

    r3053 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
    3435#include "objects/worldentities/ControllableEntity.h"
    3536
  • code/trunk/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.cc

    r3086 r3196  
    2929
    3030#include "TeamBaseMatchBase.h"
     31
    3132#include "core/CoreIncludes.h"
     33#include "interfaces/PawnListener.h"
     34#include "interfaces/TeamColourable.h"
    3235#include "objects/gametypes/TeamBaseMatch.h"
    33 #include "objects/Teamcolourable.h"
    3436
    3537namespace orxonox
     
    8082        for (std::set<WorldEntity*>::iterator it = attachments.begin(); it != attachments.end(); ++it)
    8183        {
    82             if ((*it)->isA(Class(Teamcolourable)))
     84            if ((*it)->isA(Class(TeamColourable)))
    8385            {
    84                 Teamcolourable* tc = dynamic_cast<Teamcolourable*>(*it);
     86                TeamColourable* tc = dynamic_cast<TeamColourable*>(*it);
    8587                tc->setTeamColour(colour);
    8688            }
  • code/trunk/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h

    r3033 r3196  
    3030#define _TeamBaseMatchBase_H__
    3131
     32#include "OrxonoxPrereqs.h"
     33
    3234#include "Pawn.h"
    3335
    3436namespace orxonox
    3537{
    36 
    37 
    3838    namespace BaseState
    3939    {
  • code/trunk/src/orxonox/objects/worldentities/triggers/CheckPoint.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/XMLPort.h"
    33 
    3433#include "objects/gametypes/Asteroids.h"
    35 #include "orxonox/objects/worldentities/pawns/Pawn.h"
     34#include "objects/worldentities/pawns/Pawn.h"
    3635
    3736namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/triggers/CheckPoint.h

    r3064 r3196  
    3535#define _CheckPoint_H__
    3636
     37#include "OrxonoxPrereqs.h"
     38
     39#include "interfaces/RadarViewable.h"
    3740#include "DistanceTrigger.h"
    38 #include "objects/RadarViewable.h"
    3941
    4042namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

    r3110 r3196  
    2929#include "DistanceTrigger.h"
    3030
    31 #include <OgreNode.h>
    32 
    3331#include "core/CoreIncludes.h"
    3432#include "core/XMLPort.h"
    35 
    3633#include "orxonox/objects/worldentities/pawns/Pawn.h"
    3734
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h

    r3068 r3196  
    3030#define _DistanceTrigger_H__
    3131
    32 #include "PlayerTrigger.h"
     32#include "OrxonoxPrereqs.h"
    3333
    3434#include <set>
    35 
    3635#include "core/ClassTreeMask.h"
    37 #include "core/BaseObject.h"
    38 
    39 #include "orxonox/objects/worldentities/ControllableEntity.h"
     36#include "PlayerTrigger.h"
    4037
    4138namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.cc

    r3110 r3196  
    5151        SUPER(EventTrigger, processEvent, event);
    5252
    53         SetEvent(EventTrigger, "trigger", trigger, event);
     53        ORXONOX_SET_EVENT(EventTrigger, "trigger", trigger, event);
    5454    }
    5555
  • code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.h

    r2087 r3196  
    3030#define _EventTrigger_H__
    3131
     32#include "OrxonoxPrereqs.h"
    3233#include "Trigger.h"
    33 
    34 #include "core/ClassTreeMask.h"
    35 #include "core/BaseObject.h"
    3634
    3735namespace orxonox
  • code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc

    r3110 r3196  
    3434
    3535#include "PlayerTrigger.h"
    36 
    3736#include "core/CoreIncludes.h"
    3837
  • code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h

    r3033 r3196  
    3737
    3838#include "OrxonoxPrereqs.h"
    39 
    4039#include "Trigger.h"
    4140
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc

    r3110 r3196  
    2929#include "Trigger.h"
    3030
    31 #include <OgreBillboard.h>
    32 #include <OgreBillboardSet.h>
    33 #include "util/Debug.h"
    3431#include "core/CoreIncludes.h"
    3532#include "core/ConsoleCommand.h"
     33#include "core/GameMode.h"
    3634#include "core/XMLPort.h"
    37 #include "core/GameMode.h"
    3835#include "objects/Scene.h"
    3936
     
    237234  {
    238235    if (( (this->latestState_ & 2) && this->bStayActive_ && (this->remainingActivations_ <= 0))
    239      || (!(this->latestState_ & 2))                      && (this->remainingActivations_ == 0))
     236     || (!(this->latestState_ & 2)                       && (this->remainingActivations_ == 0)))
    240237      return false;
    241238    else
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h

    r3068 r3196  
    3030#define _Trigger_H__
    3131
     32#include "OrxonoxPrereqs.h"
     33
    3234#include <set>
    3335#include <queue>
    3436
    35 #include "OrxonoxPrereqs.h"
    36 
    37 #include "objects/Tickable.h"
     37#include "tools/BillboardSet.h"
     38#include "interfaces/Tickable.h"
    3839#include "objects/worldentities/StaticEntity.h"
    39 #include "tools/BillboardSet.h"
    4040
    4141namespace orxonox
  • code/trunk/src/orxonox/overlays/FadeoutText.cc

    r3110 r3196  
    3030
    3131#include <OgreTextAreaOverlayElement.h>
    32 
     32#include "util/Math.h"
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
  • code/trunk/src/orxonox/overlays/FadeoutText.h

    r3099 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
     35#include "interfaces/Tickable.h"
    3436#include "overlays/OverlayText.h"
    35 #include "objects/Tickable.h"
    36 #include "tools/Timer.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/overlays/GUIOverlay.cc

    r3110 r3196  
    2828
    2929#include "GUIOverlay.h"
     30
    3031#include <string>
    3132#include <sstream>
     33
    3234#include "core/input/InputManager.h"
    33 
    34 #include "../gui/GUIManager.h"
     35#include "core/CoreIncludes.h"
     36#include "core/XMLPort.h"
     37#include "gui/GUIManager.h"
    3538
    3639namespace orxonox
     
    5356        XMLPortParam(GUIOverlay, "guiname", setGUIName, getGUIName, xmlElement, mode);
    5457       
    55         GUIManager::getInstancePtr()->registerOverlay(this->guiName_, this);
     58        GUIManager::getInstance().registerOverlay(this->guiName_, this);
    5659    }
    5760
     
    6669            out << (long)this;
    6770            str = out.str();
    68             GUIManager::getInstancePtr()->executeCode("showCursor()");
     71            GUIManager::getInstance().executeCode("showCursor()");
    6972            InputManager::getInstance().requestEnterState("guiMouseOnly");
    70             GUIManager::getInstancePtr()->executeCode("showGUI(\"" + this->guiName_ + "\", " + str + ")");
     73            GUIManager::getInstance().executeCode("showGUI(\"" + this->guiName_ + "\", " + str + ")");
    7174        }
    7275        else
    7376        {
    74             GUIManager::getInstancePtr()->executeCode("hideGUI(\"" + this->guiName_ + "\")");
    75             GUIManager::getInstancePtr()->executeCode("hideCursor()");
     77            GUIManager::getInstance().executeCode("hideGUI(\"" + this->guiName_ + "\")");
     78            GUIManager::getInstance().executeCode("hideCursor()");
    7679            InputManager::getInstance().requestLeaveState("guiMouseOnly");
    7780        }
  • code/trunk/src/orxonox/overlays/GUIOverlay.h

    r3078 r3196  
    3030#define _GUIOverlay_H__
    3131
    32 
    33 #include "OrxonoxOverlay.h"
    3432#include "OrxonoxPrereqs.h"
    3533
    36 #include <OgrePrerequisites.h>
    37 
    38 #include "core/XMLPort.h"
     34#include <string>
     35#include "OrxonoxOverlay.h"
    3936
    4037namespace orxonox
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r3110 r3196  
    215215            if (angle < 0.0)
    216216                angle = -angle;
    217             angle -= 180.0 * (int)(angle / 180.0);
     217            angle -= 180.0f * (int)(angle / 180.0);
    218218
    219219            // take the reverse if angle is about 90 degrees
    220220            float tempAspect;
    221             if (angle > 89.0 && angle < 91.0)
     221            if (angle > 89.0f && angle < 91.0f)
    222222            {
    223223                tempAspect = 1.0 / this->windowAspectRatio_;
     
    231231            else
    232232            {
    233                 tempAspect = 1.0;
     233                tempAspect = 1.0f;
    234234                rotState_ = Inbetween;
    235235            }
     
    238238            // magnitude of the width is about the magnitude of the height.
    239239            // Correctly we would have to take the square root of width*height
    240             this->sizeCorrection_.x = 2.0 / (tempAspect + 1.0);
     240            this->sizeCorrection_.x = 2.0f / (tempAspect + 1.0f);
    241241            this->sizeCorrection_.y = tempAspect * this->sizeCorrection_.x;
    242242        }
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.h

    r2993 r3196  
    3737#include "OrxonoxPrereqs.h"
    3838
    39 #include <OgrePrerequisites.h>
    40 #include "tools/WindowEventListener.h"
     39#include <string>
     40
    4141#include "util/Math.h"
     42#include "util/OgreForwardRefs.h"
    4243#include "core/BaseObject.h"
     44#include "interfaces/WindowEventListener.h"
    4345
    4446namespace orxonox
     
    134136
    135137        //! Gets the current size that was set (uncorrected)
    136         const Vector2& getSize() const                   { return this->size_; }
     138        const Vector2& getSize() const            { return this->size_; }
    137139
    138140        //! Gets the actual size of the overlay on the screen (corrected)
    139         Vector2 getActualSize() const      { return this->size_ * this->sizeCorrection_; }
     141        Vector2 getActualSize() const             { return this->size_ * this->sizeCorrection_; }
    140142
    141143        //! Gets the current size correction (default: 1.0, 1.0)
     
    198200        Vector2 pickPoint_;                        //!< Point on the overlay to pick when translating
    199201        Degree angle_;                             //!< Rotation angle of the overlay
    200         RotationState rotState_;             //!< horizontal, vertical or inbetween
     202        RotationState rotState_;                   //!< horizontal, vertical or inbetween
    201203
    202204    private:
  • code/trunk/src/orxonox/overlays/OverlayGroup.cc

    r3110 r3196  
    3434#include "OverlayGroup.h"
    3535
    36 #include "util/Debug.h"
    3736#include "core/ConsoleCommand.h"
    3837#include "core/CoreIncludes.h"
    39 #include "core/Iterator.h"
    4038#include "core/XMLPort.h"
    4139#include "OrxonoxOverlay.h"
  • code/trunk/src/orxonox/overlays/OverlayGroup.h

    r2911 r3196  
    3838
    3939#include <set>
    40 #include <OgrePrerequisites.h>
     40#include "util/Math.h"
     41#include "util/OgreForwardRefs.h"
    4142#include "core/BaseObject.h"
    42 #include "util/Math.h"
    4343
    4444namespace orxonox
  • code/trunk/src/orxonox/overlays/OverlayText.cc

    r3110 r3196  
    3131#include <OgreOverlayManager.h>
    3232#include <OgrePanelOverlayElement.h>
     33#include <OgreTextAreaOverlayElement.h>
     34#include <boost/static_assert.hpp>
    3335
    3436#include "util/String.h"
     
    3638#include "core/XMLPort.h"
    3739
     40
    3841namespace orxonox
    3942{
    4043    CreateFactory(OverlayText);
     44
     45    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Left);
     46    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center);
     47    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Right);
    4148
    4249    OverlayText::OverlayText(BaseObject* creator)
     
    7683    }
    7784
    78     void OverlayText::setFont(const std::string& font)
    79     {
    80         if (font != "")
    81             this->text_->setFontName(font);
    82     }
    83 
    8485    void OverlayText::setAlignmentString(const std::string& alignment)
    8586    {
    8687        if (alignment == "right")
    87             this->setAlignment(Ogre::TextAreaOverlayElement::Right);
     88            this->setAlignment(OverlayText::Right);
    8889        else if (alignment == "center")
    89             this->setAlignment(Ogre::TextAreaOverlayElement::Center);
     90            this->setAlignment(OverlayText::Center);
    9091        else // "left" and default
    91             this->setAlignment(Ogre::TextAreaOverlayElement::Left);
     92            this->setAlignment(OverlayText::Left);
    9293    }
    9394
     
    120121        positionChanged();
    121122    }
     123
     124    void OverlayText::setCaption(const std::string& caption)
     125    {
     126        this->text_->setCaption(caption);
     127        this->changedCaption();
     128    }
     129    std::string OverlayText::getCaption() const
     130    {
     131        return this->text_->getCaption();
     132    }
     133
     134    void OverlayText::setFont(const std::string& font)
     135    {
     136        if (font != "")
     137            this->text_->setFontName(font);
     138    }
     139    const std::string& OverlayText::getFont() const
     140    {
     141        return this->text_->getFontName();
     142    }
     143
     144    void OverlayText::setSpaceWidth(float width)
     145    {
     146        this->text_->setSpaceWidth(width);
     147    }
     148    float OverlayText::getSpaceWidth() const
     149    {
     150        return this->text_->getSpaceWidth();
     151    }
     152
     153    void OverlayText::setColour(const ColourValue& colour)
     154    {
     155        this->text_->setColour(colour); this->changedColour();
     156    }
     157    const ColourValue& OverlayText::getColour() const
     158    {
     159        return this->text_->getColour();
     160    }
     161
     162    void OverlayText::setAlignment(OverlayText::Alignment alignment)
     163    {
     164        this->text_->setAlignment(static_cast<Ogre::TextAreaOverlayElement::Alignment>(alignment));
     165    }
     166    OverlayText::Alignment OverlayText::getAlignment() const
     167    {
     168        return static_cast<OverlayText::Alignment>(this->text_->getAlignment());
     169    }
    122170}
  • code/trunk/src/orxonox/overlays/OverlayText.h

    r3099 r3196  
    3333
    3434#include <string>
    35 #include <OgrePrerequisites.h>
    36 #include <OgreTextAreaOverlayElement.h>
     35#include "util/Math.h"
     36#include "util/OgreForwardRefs.h"
    3737#include "OrxonoxOverlay.h"
    3838
     
    4242    {
    4343    public:
     44        enum Alignment
     45        {
     46            Left,
     47            Right,
     48            Center
     49        };
     50
    4451        OverlayText(BaseObject* creator);
    4552        virtual ~OverlayText();
     
    4754        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    4855
    49         inline void setCaption(const std::string& caption) { this->text_->setCaption(caption); this->changedCaption(); }
    50         inline std::string getCaption() const              { return this->text_->getCaption(); }
     56        void setCaption(const std::string& caption);
     57        std::string getCaption() const;
    5158
    5259        void setFont(const std::string& font);
    53         inline const std::string& getFont() const { return this->text_->getFontName(); }
     60        const std::string& getFont() const;
    5461
    55         inline void setSpaceWidth(float width) { this->text_->setSpaceWidth(width); }
    56         inline float getSpaceWidth() const     { return this->text_->getSpaceWidth(); }
     62        void setSpaceWidth(float width);
     63        float getSpaceWidth() const;
    5764
    58         inline void setColour(const ColourValue& colour) { this->text_->setColour(colour); this->changedColour(); }
    59         inline const ColourValue& getColour() const      { return this->text_->getColour(); }
     65        void setColour(const ColourValue& colour);
     66        const ColourValue& getColour() const;
    6067
    61         inline void setAlignment(Ogre::TextAreaOverlayElement::Alignment alignment) { this->text_->setAlignment(alignment); }
    62         inline Ogre::TextAreaOverlayElement::Alignment getAlignment() const         { return this->text_->getAlignment(); }
     68        void setAlignment(OverlayText::Alignment alignment);
     69        OverlayText::Alignment getAlignment() const;
    6370
    6471        void setAlignmentString(const std::string& alignment);
  • code/trunk/src/orxonox/overlays/console/InGameConsole.cc

    r3110 r3196  
    3535#include <OgreOverlayManager.h>
    3636#include <OgreOverlayContainer.h>
     37#include <OgreBorderPanelOverlayElement.h>
     38#include <OgreTextAreaOverlayElement.h>
    3739#include <OgreFontManager.h>
    3840#include <OgreFont.h>
     
    4042#include "util/Math.h"
    4143#include "util/Convert.h"
    42 #include "util/Debug.h"
     44#include "util/UTFStringConversions.h"
    4345#include "core/Clock.h"
    4446#include "core/CoreIncludes.h"
     
    466468                {
    467469                    ++linesUsed;
    468                     this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output.substr(0, this->maxCharsPerLine_)));
     470                    this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_)));
    469471                    output.erase(0, this->maxCharsPerLine_);
    470472                    output.insert(0, 1, ' ');
     
    473475                    this->colourLine(level, index);
    474476                }
    475                 this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
     477                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
    476478                this->displayedText_ = output;
    477479                this->numLinesShifted_ = linesUsed;
     
    491493                  this->inputWindowStart_ = 0;
    492494                this->displayedText_ = output;
    493                 this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
     495                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
    494496            }
    495497        }
     
    606608        InGameConsole::getInstance().deactivate();
    607609    }
    608 
    609     /**
    610         @brief Converts a string into an Ogre::UTFString.
    611         @param s The string to convert
    612         @return The converted string
    613     */
    614     /*static*/ Ogre::UTFString InGameConsole::convert2UTF(const std::string& text)
    615     {
    616         Ogre::UTFString utf;
    617         Ogre::UTFString::code_point cp;
    618         for (unsigned int i = 0; i < text.size(); ++i)
    619         {
    620           cp = text[i];
    621           cp &= 0xFF;
    622           utf.append(1, cp);
    623         }
    624         return utf;
    625     }
    626610}
  • code/trunk/src/orxonox/overlays/console/InGameConsole.h

    r2896 r3196  
    3232
    3333#include "OrxonoxPrereqs.h"
    34 #include <OgrePrerequisites.h>
    35 #include <OgreBorderPanelOverlayElement.h>
    36 #include <OgreTextAreaOverlayElement.h>
    3734
     35#include <string>
     36#include "util/OgreForwardRefs.h"
    3837#include "core/Shell.h"
    39 #include "core/OrxonoxClass.h"
    40 #include "tools/WindowEventListener.h"
    41 
     38#include "interfaces/WindowEventListener.h"
    4239
    4340namespace orxonox
    4441{
    45     class _OrxonoxExport InGameConsole : virtual public OrxonoxClass, public ShellListener, public WindowEventListener
     42    class _OrxonoxExport InGameConsole : public ShellListener, public WindowEventListener
    4643    {
    4744    public: // functions
     
    6057        static void openConsole();
    6158        static void closeConsole();
    62 
    63         static Ogre::UTFString convert2UTF(const std::string& text);
    6459
    6560    private: // functions
  • code/trunk/src/orxonox/overlays/debug/DebugFPSText.cc

    r3110 r3196  
    2828
    2929#include "DebugFPSText.h"
    30 #include <OgreTextAreaOverlayElement.h>
     30
    3131#include "util/Convert.h"
    3232#include "core/CoreIncludes.h"
     
    5151
    5252        float fps = Game::getInstance().getAvgFPS();
    53         this->setCaption(convertToString(fps));
     53        this->setCaption(multi_cast<std::string>(fps));
    5454    }
    5555}
  • code/trunk/src/orxonox/overlays/debug/DebugFPSText.h

    r2087 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/Tickable.h"
    3435#include "overlays/OverlayText.h"
    35 #include "objects/Tickable.h"
    3636
    3737namespace orxonox
     
    4141    public:
    4242        DebugFPSText(BaseObject* creator);
    43         ~DebugFPSText();
     43        virtual ~DebugFPSText();
    4444
    4545        virtual void tick(float dt);
  • code/trunk/src/orxonox/overlays/debug/DebugRTRText.cc

    r3110 r3196  
    2828
    2929#include "DebugRTRText.h"
    30 #include <OgreTextAreaOverlayElement.h>
     30
     31#include "util/Convert.h"
    3132#include "core/CoreIncludes.h"
    32 #include "util/Convert.h"
    3333#include "core/Game.h"
    3434
     
    5151
    5252        float rtr = Game::getInstance().getAvgTickTime();
    53         this->setCaption(convertToString(rtr));
     53        this->setCaption(multi_cast<std::string>(rtr));
    5454    }
    5555}
  • code/trunk/src/orxonox/overlays/debug/DebugRTRText.h

    r2087 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/Tickable.h"
    3435#include "overlays/OverlayText.h"
    35 #include "objects/Tickable.h"
    3636
    3737namespace orxonox
     
    4141    public:
    4242        DebugRTRText(BaseObject* creator);
    43         ~DebugRTRText();
     43        virtual ~DebugRTRText();
    4444
    4545        virtual void tick(float dt);
  • code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h

    r3099 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/GametypeMessageListener.h"
    3435#include "overlays/FadeoutText.h"
    35 #include "objects/GametypeMessageListener.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/overlays/hud/ChatOverlay.cc

    r3110 r3196  
    2929#include "ChatOverlay.h"
    3030
     31#include <string>
    3132#include <OgreTextAreaOverlayElement.h>
    3233
     34#include "util/Convert.h"
     35#include "util/UTFStringConversions.h"
    3336#include "core/CoreIncludes.h"
    3437#include "core/ConfigValueIncludes.h"
    3538#include "core/Executor.h"
    3639
    37 #include "network/ClientInformation.h"
    38 
     40#include "tools/Timer.h"
     41#include "objects/infos/PlayerInfo.h"
    3942#include "PlayerManager.h"
    40 #include "objects/infos/PlayerInfo.h"
    41 #include "overlays/console/InGameConsole.h"
    42 #include "tools/Timer.h"
    43 
    44 #include "util/Convert.h"
    4543
    4644namespace orxonox
     
    8684        }
    8785
    88         this->messages_.push_back(InGameConsole::convert2UTF(text));
     86        this->messages_.push_back(multi_cast<Ogre::UTFString>(text));
    8987        COUT(0) << "Chat: " << text << std::endl;
    9088
  • code/trunk/src/orxonox/overlays/hud/ChatOverlay.h

    r2171 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <OgreTextAreaOverlayElement.h>
     34#include <list>
     35#include <OgreUTFString.h>
    3536
    3637#include "network/ChatListener.h"
     
    4344        public:
    4445            ChatOverlay(BaseObject* creator);
    45             ~ChatOverlay();
     46            virtual ~ChatOverlay();
    4647
    4748            void setConfigValues();
  • code/trunk/src/orxonox/overlays/hud/DeathMessage.h

    r3099 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/GametypeMessageListener.h"
    3435#include "overlays/FadeoutText.h"
    35 #include "objects/GametypeMessageListener.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/overlays/hud/GametypeStatus.cc

    r3110 r3196  
    2929#include "GametypeStatus.h"
    3030
    31 #include <OgreTextAreaOverlayElement.h>
    32 
     31#include "util/Convert.h"
    3332#include "core/CoreIncludes.h"
    34 #include "util/Convert.h"
    3533#include "objects/infos/GametypeInfo.h"
    3634#include "objects/infos/PlayerInfo.h"
  • code/trunk/src/orxonox/overlays/hud/GametypeStatus.h

    r2973 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/Tickable.h"
    3435#include "overlays/OverlayText.h"
    35 #include "objects/Tickable.h"
    3636
    3737namespace orxonox
     
    4141        public:
    4242            GametypeStatus(BaseObject* creator);
    43             ~GametypeStatus();
     43            virtual ~GametypeStatus();
    4444
    4545            virtual void tick(float dt);
  • code/trunk/src/orxonox/overlays/hud/HUDBar.cc

    r3110 r3196  
    3434#include <OgreMaterialManager.h>
    3535#include <OgreTechnique.h>
     36#include <OgrePass.h>
    3637#include <OgrePanelOverlayElement.h>
    3738
     
    7778        this->textureUnitState_->setTextureName("bar2.tga");
    7879        // use the default colour
    79         this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, ColourValue(0.2, 0.7, 0.2));
     80        this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, ColourValue(0.2f, 0.7f, 0.2f));
    8081
    8182        this->bar_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
  • code/trunk/src/orxonox/overlays/hud/HUDBar.h

    r2662 r3196  
    3535
    3636#include <map>
    37 #include <OgrePrerequisites.h>
     37#include <vector>
     38
    3839#include "util/Math.h"
     40#include "util/OgreForwardRefs.h"
     41#include "core/BaseObject.h"
    3942#include "overlays/OrxonoxOverlay.h"
    4043
     
    4548    public:
    4649        BarColour(BaseObject* creator);
    47         ~BarColour() { }
     50        virtual ~BarColour() { }
    4851
    4952        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
  • code/trunk/src/orxonox/overlays/hud/HUDHealthBar.cc

    r3110 r3196  
    2929#include "HUDHealthBar.h"
    3030
    31 #include <OgreOverlayManager.h>
    32 #include <OgrePanelOverlayElement.h>
    33 
     31#include "util/Convert.h"
    3432#include "core/CoreIncludes.h"
    3533#include "core/XMLPort.h"
    3634#include "objects/worldentities/pawns/Pawn.h"
    37 #include "objects/items/Engine.h"
    3835#include "overlays/OverlayGroup.h"
    39 #include "util/Convert.h"
    4036
    4137namespace orxonox
  • code/trunk/src/orxonox/overlays/hud/HUDHealthBar.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
     35#include "interfaces/Tickable.h"
     36#include "overlays/OverlayText.h"
    3437#include "HUDBar.h"
    35 #include "objects/Tickable.h"
    36 #include "overlays/OverlayText.h"
    3738
    3839namespace orxonox
     
    4243        public:
    4344            HUDHealthBar(BaseObject* creator);
    44             ~HUDHealthBar();
     45            virtual ~HUDHealthBar();
    4546
    4647            virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     
    6465                { return this->bUseBarColour_; }
    6566
    66             inline void setTextAlignment(Ogre::TextAreaOverlayElement::Alignment alignment)
     67            inline void setTextAlignment(OverlayText::Alignment alignment)
    6768                { this->textoverlay_->setAlignment(alignment); }
    68             inline Ogre::TextAreaOverlayElement::Alignment getTextAlignment() const
     69            inline OverlayText::Alignment getTextAlignment() const
    6970                { return this->textoverlay_->getAlignment(); }
    7071
  • code/trunk/src/orxonox/overlays/hud/HUDNavigation.cc

    r3110 r3196  
    2929#include "HUDNavigation.h"
    3030
     31#include <string>
    3132#include <OgreOverlayManager.h>
    3233#include <OgreTextAreaOverlayElement.h>
     
    3637#include "util/String.h"
    3738#include "util/Convert.h"
    38 #include "core/ConsoleCommand.h"
    3939#include "core/CoreIncludes.h"
    4040#include "core/XMLPort.h"
  • code/trunk/src/orxonox/overlays/hud/HUDNavigation.h

    r2087 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <OgrePrerequisites.h>
     34#include "util/OgreForwardRefs.h"
     35#include "interfaces/Tickable.h"
    3536#include "overlays/OrxonoxOverlay.h"
    36 #include "objects/Tickable.h"
    3737
    3838namespace orxonox
     
    4242    public:
    4343        HUDNavigation(BaseObject* creator);
    44         ~HUDNavigation();
     44        virtual ~HUDNavigation();
    4545
    4646        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
  • code/trunk/src/orxonox/overlays/hud/HUDRadar.cc

    r3110 r3196  
    3535#include "util/Math.h"
    3636#include "util/String.h"
    37 #include "core/ConsoleCommand.h"
    3837#include "core/CoreIncludes.h"
    3938#include "core/XMLPort.h"
    40 #include "objects/Radar.h"
     39#include "tools/TextureGenerator.h"
    4140#include "objects/worldentities/WorldEntity.h"
    4241#include "objects/worldentities/pawns/Pawn.h"
    43 #include "tools/TextureGenerator.h"
    4442
    4543namespace orxonox
  • code/trunk/src/orxonox/overlays/hud/HUDRadar.h

    r2662 r3196  
    3333#include "OrxonoxPrereqs.h"
    3434
     35#include <map>
    3536#include <vector>
    36 #include <map>
    37 #include <OgrePrerequisites.h>
     37
     38#include "util/OgreForwardRefs.h"
     39#include "interfaces/RadarListener.h"
     40#include "interfaces/RadarViewable.h"
    3841#include "overlays/OrxonoxOverlay.h"
    39 #include "objects/RadarListener.h"
    40 #include "objects/RadarViewable.h"
    4142
    4243namespace orxonox
     
    4647    public:
    4748        HUDRadar(BaseObject* creator);
    48         ~HUDRadar();
     49        virtual ~HUDRadar();
    4950
    5051        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
  • code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.cc

    r3110 r3196  
    2929
    3030#include "HUDSpeedBar.h"
     31
    3132#include "core/CoreIncludes.h"
    3233#include "objects/worldentities/pawns/SpaceShip.h"
  • code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h

    r2662 r3196  
    3333#include "OrxonoxPrereqs.h"
    3434
     35#include "interfaces/Tickable.h"
    3536#include "HUDBar.h"
    36 #include "objects/Tickable.h"
    3737
    3838namespace orxonox
     
    4242    public:
    4343        HUDSpeedBar(BaseObject* creator);
    44         ~HUDSpeedBar();
     44        virtual ~HUDSpeedBar();
    4545
    4646        virtual void tick(float dt);
  • code/trunk/src/orxonox/overlays/hud/HUDTimer.cc

    r3110 r3196  
    2929#include "HUDTimer.h"
    3030
     31#include "util/Convert.h"
    3132#include "core/CoreIncludes.h"
    32 #include "util/Convert.h"
    3333#include "objects/worldentities/ControllableEntity.h"
    3434#include "objects/gametypes/Gametype.h"
     
    3636namespace orxonox
    3737{
    38   CreateFactory(HUDTimer);
     38    CreateFactory(HUDTimer);
    3939
    40   HUDTimer::HUDTimer(BaseObject* creator) : OverlayText(creator)
    41   {
    42     RegisterObject(HUDTimer);
     40    HUDTimer::HUDTimer(BaseObject* creator) : OverlayText(creator)
     41    {
     42        RegisterObject(HUDTimer);
    4343
    44     this->owner_ = 0;
    45   }
     44        this->owner_ = 0;
     45    }
    4646
    47   HUDTimer::~HUDTimer()
    48   {
    49   }
     47    HUDTimer::~HUDTimer()
     48    {
     49    }
    5050
    51   void HUDTimer::tick(float dt)
    52   {
    53     SUPER(HUDTimer, tick, dt);
     51    void HUDTimer::tick(float dt)
     52    {
     53        SUPER(HUDTimer, tick, dt);
    5454
    55     Gametype* gametype = this->getGametype();
    56    
    57     if(gametype)
     55        Gametype* gametype = this->getGametype();
     56
     57        if (gametype)
     58        {
     59            if (gametype->getTimerIsActive())
     60            {
     61                this->setCaption(convertToString((int)gametype->getTime() + 1));
     62            }
     63        }
     64    }
     65
     66    void HUDTimer::changedOwner()
    5867    {
    59       if (gametype->getTimerIsActive())
    60       {
    61         this->setCaption(convertToString((int)gametype->getTime() + 1));
    62       }
     68        SUPER(HUDTimer, changedOwner);
     69
     70        this->owner_ = dynamic_cast<ControllableEntity*>(this->getOwner());
    6371    }
    64   }
    65 
    66   void HUDTimer::changedOwner()
    67   {
    68     SUPER(HUDTimer, changedOwner);
    69 
    70     this->owner_ = dynamic_cast<ControllableEntity*>(this->getOwner());
    71   }
    7272}
  • code/trunk/src/orxonox/overlays/hud/HUDTimer.h

    r3033 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/Tickable.h"
    3435#include "overlays/OverlayText.h"
    35 #include "objects/Tickable.h"
    3636
    3737namespace orxonox
    3838{
    39   class _OrxonoxExport HUDTimer : public OverlayText, public Tickable
    40   {
     39    class _OrxonoxExport HUDTimer : public OverlayText, public Tickable
     40    {
    4141    public:
    42       HUDTimer(BaseObject* creator);
    43       ~HUDTimer();
     42        HUDTimer(BaseObject* creator);
     43        virtual ~HUDTimer();
    4444
    45       virtual void tick(float dt);
     45        virtual void tick(float dt);
    4646
    47       virtual void changedOwner();
     47        virtual void changedOwner();
    4848
    49       private:
     49    private:
    5050        ControllableEntity* owner_;
    51   };
     51    };
    5252}
    5353#endif /* _HUDTimer_H__ */
  • code/trunk/src/orxonox/overlays/hud/KillMessage.h

    r3099 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/GametypeMessageListener.h"
    3435#include "overlays/FadeoutText.h"
    35 #include "objects/GametypeMessageListener.h"
    3636
    3737namespace orxonox
  • code/trunk/src/orxonox/overlays/hud/PongScore.cc

    r3110 r3196  
    2929#include "PongScore.h"
    3030
    31 #include <OgreTextAreaOverlayElement.h>
    32 
     31#include "util/Convert.h"
    3332#include "core/CoreIncludes.h"
    3433#include "core/XMLPort.h"
    35 #include "util/Convert.h"
    3634#include "objects/gametypes/Pong.h"
    3735#include "objects/infos/PlayerInfo.h"
  • code/trunk/src/orxonox/overlays/hud/PongScore.h

    r3078 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/Tickable.h"
    3435#include "overlays/OverlayText.h"
    35 #include "objects/Tickable.h"
    3636
    3737namespace orxonox
     
    4141        public:
    4242            PongScore(BaseObject* creator);
    43             ~PongScore();
     43            virtual ~PongScore();
    4444
    4545            virtual void tick(float dt);
  • code/trunk/src/orxonox/overlays/hud/TeamBaseMatchScore.cc

    r3110 r3196  
    2828
    2929#include "TeamBaseMatchScore.h"
    30 
    31 #include <OgreTextAreaOverlayElement.h>
    3230
    3331#include "core/CoreIncludes.h"
  • code/trunk/src/orxonox/overlays/hud/TeamBaseMatchScore.h

    r3104 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "interfaces/Tickable.h"
    3435#include "overlays/OverlayText.h"
    35 #include "objects/Tickable.h"
    3636
    3737namespace orxonox
     
    4141        public:
    4242            TeamBaseMatchScore(BaseObject* creator);
    43             ~TeamBaseMatchScore();
     43            virtual ~TeamBaseMatchScore();
    4444
    4545            virtual void tick(float dt);
  • code/trunk/src/orxonox/overlays/hud/UnderAttackHealthBar.cc

    r3110 r3196  
    4747        this->text_ = new OverlayText(this);
    4848        this->text_->setFont("Monofur");
    49         this->text_->setTextSize(0.04);
     49        this->text_->setTextSize(0.04f);
    5050        this->text_->setAlignmentString("center");
    5151        this->text_->setColour(ColourValue::White);
  • code/trunk/src/orxonox/overlays/hud/UnderAttackHealthBar.h

    r3104 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
     35#include "tools/Timer.h"
    3436#include "HUDHealthBar.h"
    35 #include "tools/Timer.h"
    3637
    3738namespace orxonox
  • code/trunk/src/orxonox/overlays/map/Map.cc

    r3110 r3196  
    2424 *
    2525 */
     26
    2627#include "Map.h"
    2728
    2829#include <string>
    29 #include "util/String.h"
     30
     31#include <OgreBorderPanelOverlayElement.h>
     32#include <OgreCamera.h>
     33#include <OgreEntity.h>
     34#include <OgreHardwarePixelBuffer.h>
     35#include <OgreMaterialManager.h>
     36#include <OgreMovablePlane.h>
     37#include <OgreOverlay.h>
     38#include <OgreOverlayContainer.h>
     39#include <OgreOverlayManager.h>
     40#include <OgrePass.h>
     41#include <OgreRenderTexture.h>
     42#include <OgreResourceGroupManager.h>
     43#include <OgreRoot.h>
    3044#include <OgreSceneManager.h>
    3145#include <OgreSceneNode.h>
    32 #include <OgreEntity.h>
    33 #include <OgreNode.h>
    34 
    35 
    36 #include <OgreRenderWindow.h>
    37 #include <OgreRenderTexture.h>
     46#include <OgreTechnique.h>
    3847#include <OgreTexture.h>
     48#include <OgreTextureManager.h>
    3949#include <OgreViewport.h>
    4050
    41 #include <OgreMaterialManager.h>
    42 #include <OgreRoot.h>
    43 #include <OgreHardwarePixelBuffer.h>
     51#include "core/ConsoleCommand.h"
     52#include "core/CoreIncludes.h"
     53#include "core/XMLPort.h"
     54#include "interfaces/RadarViewable.h"
     55#include "objects/Scene.h"
     56#include "objects/controllers/HumanController.h"
     57#include "objects/worldentities/CameraPosition.h"
    4458#include "objects/worldentities/ControllableEntity.h"
    45 #include "objects/worldentities/CameraPosition.h"
    46 
    47 #include <OgreOverlay.h>
    48 #include <OgreMovablePlane.h>
    49 #include <OgreOverlayElement.h>
    50 #include <OgreOverlayManager.h>
    51 #include <OgreOverlayContainer.h>
    52 #include "core/CoreIncludes.h"
    53 #include "core/ConfigValueIncludes.h"
    54 #include "core/ConsoleCommand.h"
    55 #include "objects/Scene.h"
    56 #include "objects/RadarViewable.h"
    57 #include "objects/controllers/HumanController.h"
    5859
    5960 namespace orxonox
     
    264265    }
    265266
    266     Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, std::string matName)
     267    Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, const std::string& matName)
    267268    {
    268269        Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual(matName+"_tex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
     
    400401    }
    401402
     403    // HACK!
     404    void Map::hackDestroyMap()
     405    {
     406        Map::OverlayMaterial_.setNull();
     407    }
     408
    402409    void Map::tick(float dt)
    403410    {
  • code/trunk/src/orxonox/overlays/map/Map.h

    r3101 r3196  
    2525 */
    2626
    27 #ifndef _MAP_H__
    28 #define _MAP_H__
     27#ifndef _Map_H__
     28#define _Map_H__
    2929
    30 #include <string>
    3130#include "OrxonoxPrereqs.h"
    32 #include <OgrePrerequisites.h>
    33 #include <OgreSceneManager.h>
    34 #include <OgreSceneNode.h>
    35 #include <OgreEntity.h>
    36 #include <OgreOverlay.h>
    37 #include <OgreOverlayElement.h>
    38 #include <OgreOverlayManager.h>
    39 #include <OgreOverlayContainer.h>
    40 #include <OgreMovablePlane.h>
    4131
    42 #include <OgreBorderPanelOverlayElement.h>
    43 #include <OgreTextAreaOverlayElement.h>
     32#include <OgreMaterial.h>
    4433
     34#include "util/UtilPrereqs.h"
     35#include "interfaces/Tickable.h"
    4536#include "overlays/OrxonoxOverlay.h"
    46 #include "objects/Tickable.h"
    47 
    48 
    4937
    5038namespace orxonox
     
    5543    public: // functions
    5644        Map(BaseObject* creator);
    57         ~Map();
     45        virtual ~Map();
    5846
    5947        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     
    6149        virtual void changedOwner();
    6250
    63         static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, std::string matName);
     51        static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, const std::string& matName);
    6452
    6553        static void openMap();
     54        // HACK!
     55        static void hackDestroyMap();
    6656
    6757//Not yet implemented
     
    126116}
    127117
    128 #endif /* _MAP_H__ */
     118#endif /* _Map_H__ */
  • code/trunk/src/orxonox/overlays/notifications/Notification.cc

    r3110 r3196  
    2828
    2929/**
    30     @file Notification.cc
     30    @file
    3131    @brief Implementation of the Notification class.
    3232*/
     
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "util/Exception.h"
    38 
    3937#include "NotificationManager.h"
    4038
     
    4846    Notification::Notification(BaseObject* creator) : BaseObject(creator)
    4947    {
     48        RegisterObject(Notification);
    5049        this->initialize();
    5150    }
     
    7675    void Notification::initialize(void)
    7776    {
    78         RegisterObject(Notification);
    79        
    8077        this->message_ = "";
    8178        this->sender_ = NotificationManager::NONE;
  • code/trunk/src/orxonox/overlays/notifications/Notification.h

    r3034 r3196  
    2828
    2929/**
    30     @file Notification.h
     30    @file
    3131    @brief Definition of the Notification class.
    3232*/
     
    3838
    3939#include <string>
    40 
    4140#include "core/BaseObject.h"
    4241
  • code/trunk/src/orxonox/overlays/notifications/NotificationManager.cc

    r3110 r3196  
    2828
    2929/**
    30     @file NotificationManager.cc
     30    @file
    3131    @brief Implementation of the NotificationManager class.
    3232*/
     
    3434#include "NotificationManager.h"
    3535
     36#include <set>
     37
    3638#include "core/CoreIncludes.h"
    37 
    38 #include <set>
    39 
    4039#include "Notification.h"
    4140#include "NotificationQueue.h"
  • code/trunk/src/orxonox/overlays/notifications/NotificationManager.h

    r3034 r3196  
    2828
    2929/**
    30     @file NotificationManager.h
     30    @file
    3131    @brief Definition of the NotificationManager class.
    3232*/
     
    3737#include "OrxonoxPrereqs.h"
    3838
    39 #include "core/OrxonoxClass.h"
    40 
     39#include <ctime>
    4140#include <map>
    4241#include <string>
    43 #include <ctime>
    44 
    45 #include "NotificationOverlay.h"
     42#include "core/OrxonoxClass.h"
    4643
    4744namespace orxonox
  • code/trunk/src/orxonox/overlays/notifications/NotificationOverlay.cc

    r3110 r3196  
    2828
    2929/**
    30     @file NotificationOverlay.cc
     30    @file
    3131    @brief Implementation of the NotificationOverlay class.
    3232*/
     
    3434#include "NotificationOverlay.h"
    3535
    36 #include <OgreOverlayManager.h>
    37 #include <OgreTextAreaOverlayElement.h>
    38 #include <OgrePanelOverlayElement.h>
    39 
     36#include "util/Exception.h"
    4037#include "core/CoreIncludes.h"
    41 #include "util/Exception.h"
    42 
    4338#include "Notification.h"
    4439#include "NotificationQueue.h"
     
    5348    NotificationOverlay::NotificationOverlay(BaseObject* creator) : OverlayText(creator)
    5449    {
     50        RegisterObject(NotificationOverlay);
    5551        this->initialize();
    5652    }
     
    8783    void NotificationOverlay::initialize(void)
    8884    {
    89         RegisterObject(NotificationOverlay);
    90        
    9185        this->queue_ = NULL;
    9286    }
     
    133127        Clips the input message so that it meets the requirements for the maximal length of Notifications given by the NotificationQueue.
    134128    */
    135     const std::string NotificationOverlay::clipMessage(const std::string & message)
     129    std::string NotificationOverlay::clipMessage(const std::string & message)
    136130    {
    137131        if(message.length() <= (unsigned int)this->queue_->getNotificationLength()) //!< If the message is not too long.
  • code/trunk/src/orxonox/overlays/notifications/NotificationOverlay.h

    r3078 r3196  
    2828
    2929/**
    30     @file NotificationOverlay.h
     30    @file
    3131    @brief Definition of the NotificationOverlay class.
    3232*/
     
    3838#include "OrxonoxPrereqs.h"
    3939
     40#include <string>
    4041#include "orxonox/overlays/OverlayText.h"
    41 
    42 #include <string>
    43 #include <set>
    44 #include <OgrePrerequisites.h>
    45 #include <OgreTextAreaOverlayElement.h>
    4642
    4743namespace orxonox
     
    7268       
    7369        protected:
    74             const std::string clipMessage(const std::string & message); //!< Clips the input message if too long.
     70            std::string clipMessage(const std::string & message); //!< Clips the input message if too long.
    7571
    7672        private:
  • code/trunk/src/orxonox/overlays/notifications/NotificationQueue.cc

    r3110 r3196  
    2828
    2929/**
    30     @file NotificationQueue.cc
     30    @file
    3131    @brief Implementation of the NotificationQueue class.
    3232*/
     
    3434#include "NotificationQueue.h"
    3535
    36 #include <OgreOverlayManager.h>
    37 #include <OgreTextAreaOverlayElement.h>
    38 #include <list>
    39 #include <iostream>
    4036#include <sstream>
    4137
    4238#include "core/CoreIncludes.h"
    4339#include "core/XMLPort.h"
    44 
    45 #include "Notification.h"
    4640#include "NotificationOverlay.h"
     41#include "NotificationManager.h"
    4742
    4843namespace orxonox
     
    5348    const std::string NotificationQueue::DEFAULT_FONT = "VeraMono";
    5449    const Vector2 NotificationQueue::DEFAULT_POSITION = Vector2(0.0,0.0);
    55     const float NotificationQueue::DEFAULT_FONT_SIZE  = 0.025;
     50    const float NotificationQueue::DEFAULT_FONT_SIZE  = 0.025f;
    5651
    5752    /**
     
    6156    NotificationQueue::NotificationQueue(BaseObject* creator) : OverlayGroup(creator)
    6257    {
     58        RegisterObject(NotificationQueue);
    6359        this->initialize();
    6460    }
     
    8177    void NotificationQueue::initialize(void)
    8278    {
    83         RegisterObject(NotificationQueue);
    84 
    8579        this->size_ = 0;
    8680        this->tickTime_ = 0.0;
  • code/trunk/src/orxonox/overlays/notifications/NotificationQueue.h

    r2926 r3196  
    2828
    2929/**
    30     @file NotificationQueue.h
     30    @file
    3131    @brief Definition of the NotificationQueue class.
    3232*/
     
    3737#include "OrxonoxPrereqs.h"
    3838
     39#include <ctime>
     40#include <map>
     41#include <set>
    3942#include <string>
    40 #include <set>
    41 #include <OgreOverlayManager.h>
    42 #include <OgreTextAreaOverlayElement.h>
    43 #include <OgrePanelOverlayElement.h>
    44 #include <map>
    45 #include <ctime>
    46 
    47 #include "orxonox/overlays/OverlayGroup.h"
    48 #include "orxonox/objects/Tickable.h"
    49 
    50 #include "NotificationManager.h"
     43
     44#include "util/Math.h"
     45#include "interfaces/Tickable.h"
     46#include "overlays/OverlayGroup.h"
    5147
    5248namespace orxonox
  • code/trunk/src/orxonox/overlays/stats/CMakeLists.txt

    r2710 r3196  
    33  Scoreboard.cc
    44  Stats.cc
    5   StatsTest.cc
    65)
  • code/trunk/src/orxonox/overlays/stats/CreateLines.cc

    r3110 r3196  
    2626
    2727#include "CreateLines.h"
    28 
    29 #include <string>
    30 #include <OgreOverlay.h>
    31 #include <OgreOverlayElement.h>
    32 #include <OgreOverlayManager.h>
    33 #include <OgreOverlayContainer.h>
    34 
    35 #include "util/Convert.h"
    36 #include "util/Debug.h"
    37 #include "core/CoreIncludes.h"
    38 #include "core/ConfigValueIncludes.h"
    3928
    4029#include "overlays/OverlayText.h"
  • code/trunk/src/orxonox/overlays/stats/CreateLines.h

    r2662 r3196  
    2828#define _CreateLines_H__
    2929
    30 
    3130#include "OrxonoxPrereqs.h"
    32 #include <OgrePrerequisites.h>
    33 #include <OgreBorderPanelOverlayElement.h>
    34 #include <OgreTextAreaOverlayElement.h>
    35 
    36 #include "overlays/OrxonoxOverlay.h"
    37 #include "objects/Tickable.h"
    38 
    3931
    4032namespace orxonox
  • code/trunk/src/orxonox/overlays/stats/Scoreboard.cc

    r3110 r3196  
    2727#include "Scoreboard.h"
    2828
    29 #include <string>
    30 #include <OgreOverlay.h>
    31 #include <OgreOverlayElement.h>
    32 #include <OgreOverlayManager.h>
    33 #include <OgreOverlayContainer.h>
    34 
    3529#include "util/Convert.h"
    36 #include "util/Debug.h"
    3730#include "core/CoreIncludes.h"
    38 #include "core/ConfigValueIncludes.h"
    3931#include "objects/gametypes/Gametype.h"
    4032#include "objects/infos/PlayerInfo.h"
     
    10193        for (std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it)
    10294        {
    103             this->lines_[index]->setPlayerName(omni_cast<std::string>(it->first->getName()));
    104             this->lines_[index]->setScore(omni_cast<std::string>(it->second.frags_));
    105             this->lines_[index]->setDeaths(omni_cast<std::string>(it->second.killed_));
     95            this->lines_[index]->setPlayerName(multi_cast<std::string>(it->first->getName()));
     96            this->lines_[index]->setScore(multi_cast<std::string>(it->second.frags_));
     97            this->lines_[index]->setDeaths(multi_cast<std::string>(it->second.killed_));
    10698            index++;
    10799        }
  • code/trunk/src/orxonox/overlays/stats/Scoreboard.h

    r2662 r3196  
    3030
    3131#include "OrxonoxPrereqs.h"
    32 #include <OgrePrerequisites.h>
    33 #include <OgreBorderPanelOverlayElement.h>
    34 #include <OgreTextAreaOverlayElement.h>
    3532
     33#include <string>
     34#include <vector>
     35#include "interfaces/Tickable.h"
    3636#include "overlays/OrxonoxOverlay.h"
    37 #include "objects/Tickable.h"
    38 
    3937
    4038namespace orxonox
     
    4240    class _OrxonoxExport Scoreboard : public OrxonoxOverlay, public Tickable
    4341    {
    44 
    4542    public: // functions
    4643        Scoreboard(BaseObject* creator);
  • code/trunk/src/orxonox/overlays/stats/Stats.cc

    r3110 r3196  
    3030
    3131#include <string>
    32 #include <OgreOverlay.h>
    33 #include <OgreOverlayElement.h>
    3432#include <OgreOverlayManager.h>
    35 #include <OgreOverlayContainer.h>
     33#include <OgreBorderPanelOverlayElement.h>
    3634
    37 #include "util/Convert.h"
    38 #include "util/Debug.h"
     35#include "util/String.h"
    3936#include "core/CoreIncludes.h"
    4037#include "core/ConfigValueIncludes.h"
  • code/trunk/src/orxonox/overlays/stats/Stats.h

    r2662 r3196  
    3030#define _Stats_H__
    3131
     32#include "OrxonoxPrereqs.h"
    3233
    33 #include "OrxonoxPrereqs.h"
    34 #include <OgrePrerequisites.h>
    35 #include <OgreBorderPanelOverlayElement.h>
    36 #include <OgreTextAreaOverlayElement.h>
    37 
     34#include "util/OgreForwardRefs.h"
     35#include "interfaces/Tickable.h"
    3836#include "overlays/OrxonoxOverlay.h"
    39 #include "objects/Tickable.h"
    40 
    4137
    4238namespace orxonox
  • code/trunk/src/orxonox/sound/CMakeLists.txt

    r3078 r3196  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
    2     SoundManager.h
    3     SoundBase.h
    4     SoundMainMenu.h
    5 
    62    SoundManager.cc
    73    SoundBase.cc
  • code/trunk/src/orxonox/sound/SoundBase.cc

    r3108 r3196  
    2626 *
    2727 */
     28
     29#include "SoundBase.h"
     30
     31#include <string>
    2832#include <vector>
    2933#include <AL/alut.h>
    3034#include <vorbis/vorbisfile.h>
    3135
     36#include "util/Math.h"
     37#include "core/Core.h"
    3238#include "orxonox/objects/worldentities/WorldEntity.h"
    33 #include "util/Math.h"
    34 #include "SoundBase.h"
    3539#include "SoundManager.h"
    36 #include "core/Core.h"
    3740
    3841namespace orxonox
    3942{
    40     SoundManager* SoundBase::soundmanager_s = NULL;
    41 
    4243    SoundBase::SoundBase(WorldEntity* entity)
    4344    {
    44         if(SoundBase::soundmanager_s == NULL)
    45         {
    46             SoundBase::soundmanager_s = new SoundManager();
    47         }
    48 
    4945        this->source_ = 0;
    5046        this->buffer_ = 0;
    5147        this->entity_ = entity;
    5248
    53         SoundBase::soundmanager_s->addSound(this);
     49        SoundManager::getInstance().addSound(this);
    5450    }
    5551
     
    141137        filename = Core::getMediaPathString() + "/audio/" + filename;
    142138
    143         if(!SoundBase::soundmanager_s->isSoundAvailable())
     139        if(!SoundManager::getInstance().isSoundAvailable())
    144140        {
    145141            COUT(3) << "Sound: not available, skipping " << filename << std::endl;
     
    179175    }
    180176
    181     ALuint SoundBase::loadOggFile(std::string filename)
     177    ALuint SoundBase::loadOggFile(const std::string& filename)
    182178    {
    183179        char inbuffer[4096];
  • code/trunk/src/orxonox/sound/SoundBase.h

    r3078 r3196  
    2626 *
    2727 */
    28 #ifndef _SOUNDBASE_H__
    29 #define _SOUNDBASE_H__
    30 
    31 #include <AL/al.h>
    32 #include <string>
     28#ifndef _SoundBase_H__
     29#define _SoundBase_H__
    3330
    3431#include "OrxonoxPrereqs.h"
     32#include <cstring> // define NULL
    3533
    3634namespace orxonox
     
    6058
    6159    private:
    62         ALuint loadOggFile(std::string filename);
     60        ALuint loadOggFile(const std::string& filename);
    6361        ALuint source_;
    6462        ALuint buffer_;
     
    6664
    6765        ALint getSourceState();
    68 
    69         static SoundManager* soundmanager_s;
    7066    }; // class SoundBase
    7167} // namepsace orxonox
    7268
    73 #endif // _SOUNDBASE_H__
     69#endif /* _SoundBase_H__ */
  • code/trunk/src/orxonox/sound/SoundMainMenu.cc

    r3078 r3196  
    2828
    2929#include "SoundMainMenu.h"
     30
    3031#include "core/CoreIncludes.h"
    3132#include "core/ConfigValueIncludes.h"
  • code/trunk/src/orxonox/sound/SoundMainMenu.h

    r3078 r3196  
    2727 */
    2828
    29 #ifndef _SOUNDMAINMENU_H__
    30 #define _SOUNDMAINMENU_H__
     29#ifndef _SoundMainMenu_H__
     30#define _SoundMainMenu_H__
     31
     32#include "OrxonoxPrereqs.h"
    3133
    3234#include <string>
    33 
    3435#include "core/OrxonoxClass.h"
    35 #include "OrxonoxPrereqs.h"
    3636#include "SoundBase.h"
    3737
     
    4848    };
    4949}
    50 #endif
     50
     51#endif /* _SoundMainMenu_H__ */
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r3108 r3196  
    2727 */
    2828
     29#include "SoundManager.h"
     30
    2931#include <AL/alut.h>
    3032
     33#include "util/Math.h"
    3134#include "orxonox/CameraManager.h"
    3235#include "orxonox/objects/worldentities/Camera.h"
    33 #include "util/Math.h"
    3436#include "SoundBase.h"
    35 #include "SoundManager.h"
    3637
    3738namespace orxonox
    3839{
     40    SoundManager* SoundManager::singletonRef_s = NULL;
    3941    ALCdevice* SoundManager::device_s = NULL;
    4042
     
    4446    SoundManager::SoundManager()
    4547    {
     48        assert(singletonRef_s == NULL);
     49        singletonRef_s = this;
     50
    4651        this->soundavailable_ = true;
    4752        if(!alutInitWithoutContext(NULL,NULL))
     
    9095    SoundManager::~SoundManager()
    9196    {
     97        assert(singletonRef_s != NULL);
     98        singletonRef_s = NULL;
     99
    92100        alcDestroyContext(this->context_);
    93101        alcCloseDevice(SoundManager::device_s);
  • code/trunk/src/orxonox/sound/SoundManager.h

    r3078 r3196  
    2525 *      ...
    2626 */
    27 #ifndef _SOUNDMANGER_H__
    28 #define _SOUNDMANGER_H__
    29 
    30 #include <AL/al.h>
    31 #include <AL/alc.h>
     27#ifndef _SoundManager_H__
     28#define _SoundManager_H__
    3229
    3330#include "OrxonoxPrereqs.h"
    34 #include "orxonox/objects/Tickable.h"
     31
     32#include <cassert>
     33#include <list>
     34#include "interfaces/Tickable.h"
    3535
    3636namespace orxonox
     
    4949        void addSound(SoundBase* sound);
    5050        void removeSound(SoundBase* sound);
    51         virtual void tick(float dt);
     51        void tick(float dt);
    5252        bool isSoundAvailable();
     53
     54        static SoundManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
    5355
    5456    private:
     
    5860        bool soundavailable_;
    5961
     62        static SoundManager* singletonRef_s;
    6063    }; // class SoundManager
    6164} // namespace orxonox
    6265
    63 #endif // _SOUNDMANAGER_H__
     66#endif /* _SoundManager_H__ */
  • code/trunk/src/orxonox/tools/BillboardSet.cc

    r3110 r3196  
    2929#include "BillboardSet.h"
    3030
     31#include <cassert>
     32#include <string>
    3133#include <sstream>
    32 #include <cassert>
    33 
    3434#include <OgreSceneManager.h>
    3535#include <OgreBillboardSet.h>
    3636#include <OgreBillboard.h>
    3737
     38#include "util/Convert.h"
     39#include "util/Math.h"
     40#include "util/String.h"
    3841#include "core/GameMode.h"
    39 #include "util/Convert.h"
    40 #include "util/String.h"
    4142
    4243namespace orxonox
  • code/trunk/src/orxonox/tools/BillboardSet.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    34 #include <string>
    35 #include <OgrePrerequisites.h>
    36 
    37 #include "util/Math.h"
     33#include "util/OgreForwardRefs.h"
    3834
    3935namespace orxonox
     
    5248            inline Ogre::BillboardSet* getBillboardSet()
    5349                { return this->billboardSet_; }
    54             inline Ogre::SceneManager* getSceneManager()
     50            inline Ogre::SceneManager* getSceneManager() const
    5551                { return this->scenemanager_; }
    5652
     
    6965            void destroyBillboardSet();
    7066
    71             static unsigned int billboardSetCounter_s;
    7267            Ogre::BillboardSet* billboardSet_;
    7368            Ogre::SceneManager* scenemanager_;
     69
     70            static unsigned int billboardSetCounter_s;
    7471    };
    7572}
  • code/trunk/src/orxonox/tools/BulletConversions.h

    r2662 r3196  
    3434#include "util/Convert.h"
    3535#include "util/Math.h"
    36 #include "LinearMath/btQuaternion.h"
    37 #include "LinearMath/btVector3.h"
     36#include <LinearMath/btQuaternion.h>
     37#include <LinearMath/btVector3.h>
    3838
    3939namespace orxonox
     
    4343    struct ConverterExplicit<orxonox::Vector3, btVector3>
    4444    {
    45         static bool convert(btVector3* output, const orxonox::Vector3& input)
     45        FORCEINLINE static bool convert(btVector3* output, const orxonox::Vector3& input)
    4646        {
    4747            output->setX(input.x);
     
    5656    struct ConverterExplicit<btVector3, orxonox::Vector3>
    5757    {
    58         static bool convert(orxonox::Vector3* output, const btVector3& input)
     58        FORCEINLINE static bool convert(orxonox::Vector3* output, const btVector3& input)
    5959        {
    6060            output->x = input.x();
     
    6969    struct ConverterExplicit<orxonox::Quaternion, btQuaternion>
    7070    {
    71         static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
     71        FORCEINLINE static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
    7272        {
    7373            output->setW(input.w);
     
    8383    struct ConverterExplicit<btQuaternion, orxonox::Quaternion>
    8484    {
    85         static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
     85        FORCEINLINE static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
    8686        {
    8787            output->w = input.w();
  • code/trunk/src/orxonox/tools/CMakeLists.txt

    r3089 r3196  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
    22  BillboardSet.cc
     3  DynamicLines.cc
     4  DynamicRenderable.cc
    35  Mesh.cc
    46  ParticleInterface.cc
    57  Shader.cc
    68  TextureGenerator.cc
    7   TimeFactorListener.cc
    89  Timer.cc
    9   WindowEventListener.cc
    10   DynamicLines.cpp
    11   DynamicRenderable.cpp
    1210)
  • code/trunk/src/orxonox/tools/DynamicLines.h

    r3089 r3196  
    1 #ifndef _DYNAMIC_LINES_H_
    2 #define _DYNAMIC_LINES_H_
     1/*
     2 *   ORXONOX - the hottest 3D action shooter ever to exist
     3 *                    > www.orxonox.net <
     4 *
     5 *
     6 *   License notice:
     7 *
     8 *   This program is free software; you can redistribute it and/or
     9 *   modify it under the terms of the GNU General Public License
     10 *   as published by the Free Software Foundation; either version 2
     11 *   of the License, or (at your option) any later version.
     12 *
     13 *   This program is distributed in the hope that it will be useful,
     14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 *   GNU General Public License for more details.
     17 *
     18 *   You should have received a copy of the GNU General Public License
     19 *   along with this program; if not, write to the Free Software
     20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     21 *
     22 *   Author:
     23 *      Baxissimo, Emmeran, DWORD, EtherDrive (OGRE Wiki)
     24 *   Co-authors:
     25 *      ...
     26 *
     27 */
    328
     29#ifndef _DynamicLines_H__
     30#define _DynamicLines_H__
     31
     32#include "OrxonoxPrereqs.h"
     33
     34#include <vector>
    435#include "DynamicRenderable.h"
    5 #include <vector>
    636
    7 namespace orxonox
     37namespace Ogre
    838{
    9 class DynamicLines : public DynamicRenderable
    10 {
    11   typedef Ogre::Vector3 Vector3;
    12   typedef Ogre::Quaternion Quaternion;
    13   typedef Ogre::Camera Camera;
    14   typedef Ogre::Real Real;
    15   typedef Ogre::RenderOperation::OperationType OperationType;
     39    class DynamicLines : public DynamicRenderable
     40    {
     41        typedef RenderOperation::OperationType OperationType;
    1642
    17 public:
    18   /// Constructor - see setOperationType() for description of argument.
    19   DynamicLines(OperationType opType=Ogre::RenderOperation::OT_LINE_STRIP);
    20   virtual ~DynamicLines();
     43    public:
     44        /// Constructor - see setOperationType() for description of argument.
     45        DynamicLines(OperationType opType = RenderOperation::OT_LINE_STRIP);
     46        virtual ~DynamicLines();
    2147
    22   /// Add a point to the point list
    23   void addPoint(const Ogre::Vector3 &p);
    24   /// Add a point to the point list
    25   void addPoint(Real x, Real y, Real z);
     48        /// Add a point to the point list
     49        void addPoint(const Vector3 &p);
     50        /// Add a point to the point list
     51        void addPoint(Real x, Real y, Real z);
    2652
    27   /// Change the location of an existing point in the point list
    28   void setPoint(unsigned short index, const Vector3 &value);
     53        /// Change the location of an existing point in the point list
     54        void setPoint(unsigned short index, const Vector3 &value);
    2955
    30   /// Return the location of an existing point in the point list
    31   const Vector3& getPoint(unsigned short index) const;
     56        /// Return the location of an existing point in the point list
     57        const Vector3& getPoint(unsigned short index) const;
    3258
    33   /// Return the total number of points in the point list
    34   unsigned short getNumPoints(void) const;
     59        /// Return the total number of points in the point list
     60        unsigned short getNumPoints(void) const;
    3561
    36   /// Remove all points from the point list
    37   void clear();
     62        /// Remove all points from the point list
     63        void clear();
    3864
    39   /// Call this to update the hardware buffer after making changes.
    40   void update();
     65        /// Call this to update the hardware buffer after making changes.
     66        void update();
    4167
    42   /** Set the type of operation to draw with.
    43    * @param opType Can be one of
    44    *    - RenderOperation::OT_LINE_STRIP
    45    *    - RenderOperation::OT_LINE_LIST
    46    *    - RenderOperation::OT_POINT_LIST
    47    *    - RenderOperation::OT_TRIANGLE_LIST
    48    *    - RenderOperation::OT_TRIANGLE_STRIP
    49    *    - RenderOperation::OT_TRIANGLE_FAN
    50    *    The default is OT_LINE_STRIP.
    51    */
    52   void setOperationType(OperationType opType);
    53   OperationType getOperationType() const;
     68        /**
     69        @brief
     70            Set the type of operation to draw with.
     71        @param opType
     72            Can be one of
     73                - RenderOperation::OT_LINE_STRIP
     74                - RenderOperation::OT_LINE_LIST
     75                - RenderOperation::OT_POINT_LIST
     76                - RenderOperation::OT_TRIANGLE_LIST
     77                - RenderOperation::OT_TRIANGLE_STRIP
     78                - RenderOperation::OT_TRIANGLE_FAN
     79            The default is OT_LINE_STRIP.
     80        */
     81        void setOperationType(OperationType opType);
     82        OperationType getOperationType() const;
    5483
    55 protected:
    56   /// Implementation DynamicRenderable, creates a simple vertex-only decl
    57   virtual void createVertexDeclaration();
    58   /// Implementation DynamicRenderable, pushes point list out to hardware memory
    59   virtual void fillHardwareBuffers();
     84    protected:
     85        /// Implementation DynamicRenderable, creates a simple vertex-only decl
     86        virtual void createVertexDeclaration();
     87        /// Implementation DynamicRenderable, pushes point list out to hardware memory
     88        virtual void fillHardwareBuffers();
    6089
    61 private:
    62   std::vector<Vector3> mPoints;
    63   bool mDirty;
    64 };
     90    private:
     91        std::vector<Vector3> mPoints;
     92        bool mDirty;
     93    };
    6594}
    6695
    67 #endif
     96#endif /* _DynamicLines_H__ */
  • code/trunk/src/orxonox/tools/DynamicRenderable.h

    r3089 r3196  
    1 #ifndef DYNAMIC_RENDERABLE_H
    2 #define DYNAMIC_RENDERABLE_H
     1/*
     2 *   ORXONOX - the hottest 3D action shooter ever to exist
     3 *                    > www.orxonox.net <
     4 *
     5 *
     6 *   License notice:
     7 *
     8 *   This program is free software; you can redistribute it and/or
     9 *   modify it under the terms of the GNU General Public License
     10 *   as published by the Free Software Foundation; either version 2
     11 *   of the License, or (at your option) any later version.
     12 *
     13 *   This program is distributed in the hope that it will be useful,
     14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 *   GNU General Public License for more details.
     17 *
     18 *   You should have received a copy of the GNU General Public License
     19 *   along with this program; if not, write to the Free Software
     20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     21 *
     22 *   Author:
     23 *      Sinbad, Baxissimo, DWORD, TheBren (OGRE Wiki)
     24 *   Co-authors:
     25 *      ...
     26 *
     27 */
     28
     29#ifndef _DynamicRenderable_H__
     30#define _DynamicRenderable_H__
     31
     32#include "OrxonoxPrereqs.h"
    333
    434#include <OgreSimpleRenderable.h>
    535
    6 namespace orxonox
     36namespace Ogre
    737{
    8 /// Abstract base class providing mechanisms for dynamically growing hardware buffers.
    9 class DynamicRenderable : public Ogre::SimpleRenderable
    10 {
    11 public:
    12   /// Constructor
    13   DynamicRenderable();
    14   /// Virtual destructor
    15   virtual ~DynamicRenderable();
     38    /// Abstract base class providing mechanisms for dynamically growing hardware buffers.
     39    class DynamicRenderable : public SimpleRenderable
     40    {
     41    public:
     42        /// Constructor
     43        DynamicRenderable();
     44        /// Virtual destructor
     45        virtual ~DynamicRenderable();
    1646
    17   /** Initializes the dynamic renderable.
    18    @remarks
    19       This function should only be called once. It initializes the
    20       render operation, and calls the abstract function
    21       createVertexDeclaration().
    22    @param operationType The type of render operation to perform.
    23    @param useIndices Specifies whether to use indices to determine the
    24           vertices to use as input. */
    25   void initialize(Ogre::RenderOperation::OperationType operationType,
    26                   bool useIndices);
     47        /**
     48        @brief
     49            Initializes the dynamic renderable.
     50        @remarks
     51            This function should only be called once. It initializes the
     52            render operation, and calls the abstract function
     53            createVertexDeclaration().
     54        @param operationType
     55            The type of render operation to perform.
     56        @param useIndices
     57            Specifies whether to use indices to determine the vertices to use as input.
     58        */
     59        void initialize(RenderOperation::OperationType operationType,
     60        bool useIndices);
    2761
    28   /// Implementation of Ogre::SimpleRenderable
    29   virtual Ogre::Real getBoundingRadius(void) const;
    30   /// Implementation of Ogre::SimpleRenderable
    31   virtual Ogre::Real getSquaredViewDepth(const Ogre::Camera* cam) const;
     62        /// Implementation of SimpleRenderable
     63        virtual Real getBoundingRadius(void) const;
     64        /// Implementation of SimpleRenderable
     65        virtual Real getSquaredViewDepth(const Camera* cam) const;
    3266
    33 protected:
    34   /// Maximum capacity of the currently allocated vertex buffer.
    35   size_t mVertexBufferCapacity;
    36   /// Maximum capacity of the currently allocated index buffer.
    37   size_t mIndexBufferCapacity;
     67    protected:
     68        /// Maximum capacity of the currently allocated vertex buffer.
     69        size_t mVertexBufferCapacity;
     70        /// Maximum capacity of the currently allocated index buffer.
     71        size_t mIndexBufferCapacity;
    3872
    39   /** Creates the vertex declaration.
    40    @remarks
    41       Override and set mRenderOp.vertexData->vertexDeclaration here.
    42       mRenderOp.vertexData will be created for you before this method
    43       is called. */
    44   virtual void createVertexDeclaration() = 0;
     73        /**
     74        @brief
     75            Creates the vertex declaration.
     76        @remarks
     77            Override and set mRenderOp.vertexData->vertexDeclaration here.
     78            mRenderOp.vertexData will be created for you before this method
     79            is called.
     80        */
     81        virtual void createVertexDeclaration() = 0;
    4582
    46   /** Prepares the hardware buffers for the requested vertex and index counts.
    47    @remarks
    48       This function must be called before locking the buffers in
    49       fillHardwareBuffers(). It guarantees that the hardware buffers
    50       are large enough to hold at least the requested number of
    51       vertices and indices (if using indices). The buffers are
    52       possibly reallocated to achieve this.
    53    @par
    54       The vertex and index count in the render operation are set to
    55       the values of vertexCount and indexCount respectively.
    56    @param vertexCount The number of vertices the buffer must hold.
     83        /**
     84        @brief
     85            Prepares the hardware buffers for the requested vertex and index counts.
     86        @remarks
     87            This function must be called before locking the buffers in
     88            fillHardwareBuffers(). It guarantees that the hardware buffers
     89            are large enough to hold at least the requested number of
     90            vertices and indices (if using indices). The buffers are
     91            possibly reallocated to achieve this.
     92        @par
     93            The vertex and index count in the render operation are set to
     94            the values of vertexCount and indexCount respectively.
     95        @param vertexCount
     96            The number of vertices the buffer must hold.
     97        @param indexCount
     98            The number of indices the buffer must hold. This
     99            parameter is ignored if not using indices.
     100        */
     101        void prepareHardwareBuffers(size_t vertexCount, size_t indexCount);
    57102
    58    @param indexCount The number of indices the buffer must hold. This
    59           parameter is ignored if not using indices. */
    60   void prepareHardwareBuffers(size_t vertexCount, size_t indexCount);
    61 
    62   /** Fills the hardware vertex and index buffers with data.
    63    @remarks
    64       This function must call prepareHardwareBuffers() before locking
    65       the buffers to ensure the they are large enough for the data to
    66       be written. Afterwards the vertex and index buffers (if using
    67       indices) can be locked, and data can be written to them. */
    68   virtual void fillHardwareBuffers() = 0;
    69 };
     103        /**
     104        @brief
     105            Fills the hardware vertex and index buffers with data.
     106        @remarks
     107            This function must call prepareHardwareBuffers() before locking
     108            the buffers to ensure the they are large enough for the data to
     109            be written. Afterwards the vertex and index buffers (if using
     110            indices) can be locked, and data can be written to them.
     111        */
     112        virtual void fillHardwareBuffers() = 0;
     113    };
    70114}
    71115
    72 #endif // DYNAMIC_RENDERABLE_H
     116#endif /* _DynamicRenderable_H__ */
  • code/trunk/src/orxonox/tools/Mesh.cc

    r3110 r3196  
    2929#include "Mesh.h"
    3030
     31#include <cassert>
    3132#include <sstream>
     33#include <string>
    3234#include <OgreEntity.h>
    3335#include <OgreSceneManager.h>
    34 #include <cassert>
    3536
    36 #include "core/GameMode.h"
    3737#include "util/Convert.h"
    3838#include "util/String.h"
     39#include "core/GameMode.h"
    3940
    4041namespace orxonox
  • code/trunk/src/orxonox/tools/Mesh.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    34 #include <string>
    35 #include <OgrePrerequisites.h>
     33#include "util/OgreForwardRefs.h"
    3634
    3735namespace orxonox
     
    5856
    5957        private:
    60             static unsigned int meshCounter_s;
    6158            Ogre::Entity* entity_;
    6259            bool bCastShadows_;
    6360            Ogre::SceneManager* scenemanager_;
     61
     62            static unsigned int meshCounter_s;
    6463    };
    6564}
  • code/trunk/src/orxonox/tools/ParticleInterface.cc

    r3110 r3196  
    3434#include "ParticleInterface.h"
    3535
     36#include <cassert>
     37#include <string>
    3638#include <OgreParticleSystem.h>
    3739#include <OgreParticleEmitter.h>
    3840#include <OgreSceneManager.h>
    39 #include <cassert>
    40 
     41
     42#include "util/Convert.h"
     43#include "util/Math.h"
     44#include "core/CoreIncludes.h"
     45#include "core/GameMode.h"
    4146#include "GraphicsManager.h"
    42 #include "core/GameMode.h"
    43 #include "core/CoreIncludes.h"
    44 #include "util/Convert.h"
    4547
    4648namespace orxonox
     
    132134            return 0;
    133135    }
    134     Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr) const
     136    Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr)
    135137    {
    136138        if (this->particleSystem_ && (affectorNr < this->particleSystem_->getNumAffectors()))
  • code/trunk/src/orxonox/tools/ParticleInterface.h

    r2896 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <string>
    35 #include <OgrePrerequisites.h>
    36 
    37 #include "core/OrxonoxClass.h"
    38 #include "util/Math.h"
    39 #include "tools/TimeFactorListener.h"
     34#include "util/OgreForwardRefs.h"
     35#include "interfaces/TimeFactorListener.h"
    4036
    4137#define getAllEmitters() \
     
    5248            virtual ~ParticleInterface();
    5349
    54             inline Ogre::ParticleSystem* getParticleSystem() const
     50            inline Ogre::ParticleSystem* getParticleSystem()
    5551                { return this->particleSystem_; }
    5652
     
    6258
    6359            Ogre::ParticleAffector* addAffector(const std::string& name);
    64             Ogre::ParticleAffector* getAffector(unsigned int affectorNr) const;
     60            Ogre::ParticleAffector* getAffector(unsigned int affectorNr);
    6561            void removeAffector(unsigned int affectorNr);
    6662            void removeAllAffectors();
     
    9591            void updateVisibility();
    9692
    97             static ParticleInterface* currentParticleInterface_s;
    98             static unsigned int       counter_s;
    99 
    10093            Ogre::ParticleSystem*     particleSystem_;
     94            Ogre::SceneManager*       scenemanager_;
    10195            bool                      bVisible_;
    10296            bool                      bEnabled_;
     
    10498            unsigned int              detaillevel_;     //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
    10599            float                     speedFactor_;
    106             Ogre::SceneManager*       scenemanager_;
     100
     101            static ParticleInterface* currentParticleInterface_s;
     102            static unsigned int       counter_s;
    107103    };
    108104}
  • code/trunk/src/orxonox/tools/Shader.cc

    r3110 r3196  
    3434#include <OgreRoot.h>
    3535#include <OgrePlugin.h>
    36 
    37 #include "core/GameMode.h"
    38 #include "core/CoreIncludes.h"
    39 #include "core/Executor.h"
    40 #include "GraphicsManager.h"
    41 #include "util/Exception.h"
    42 
    4336#include <OgreMaterial.h>
    4437#include <OgreTechnique.h>
    4538#include <OgrePass.h>
    4639#include <OgreMaterialManager.h>
     40
     41#include "core/CoreIncludes.h"
     42#include "core/GameMode.h"
     43#include "GraphicsManager.h"
    4744
    4845namespace orxonox
     
    219216                return (*((float*)pointer->second));
    220217            else
    221                 return (*((int*)pointer->second));
     218                return static_cast<float>(*((int*)pointer->second));
    222219        }
    223220        else
  • code/trunk/src/orxonox/tools/Shader.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include <OgrePrerequisites.h>
     33
     34#include <map>
     35#include <string>
    3436#include <vector>
    35 #include <map>
    3637
    37 #include "objects/Tickable.h"
     38#include "util/OgreForwardRefs.h"
     39#include "interfaces/Tickable.h"
    3840
    3941namespace orxonox
  • code/trunk/src/orxonox/tools/TextureGenerator.cc

    r3110 r3196  
    3333
    3434#include "TextureGenerator.h"
     35
    3536#include <OgreMaterialManager.h>
    3637#include <OgreTechnique.h>
    3738#include "util/Convert.h"
     39#include "util/Math.h"
    3840
    3941namespace std
    4042{
    4143    template <>
    42     bool less<orxonox::ColourValue>::operator()(const orxonox::ColourValue& __x, const orxonox::ColourValue& __y) const
     44    inline bool less<orxonox::ColourValue>::operator()(const orxonox::ColourValue& __x, const orxonox::ColourValue& __y) const
    4345    {
    4446        if (__x.r == __y.r)
     
    6365    unsigned int TextureGenerator::materialCount_s = 0;
    6466
    65     /*static*/ const std::string& TextureGenerator::getMaterialName(std::string textureName, const ColourValue& colour)
     67    /*static*/ const std::string& TextureGenerator::getMaterialName(const std::string& textureName, const ColourValue& colour)
    6668    {
    6769        std::map<ColourValue, std::string>& colourMap = materials_s[textureName];
  • code/trunk/src/orxonox/tools/TextureGenerator.h

    r1625 r3196  
    3636
    3737#include "OrxonoxPrereqs.h"
     38
     39#include <map>
    3840#include <string>
    39 #include <map>
    40 #include "util/Math.h"
     41#include "util/UtilPrereqs.h"
    4142
    4243namespace orxonox
     
    4546    {
    4647    public:
    47         static const std::string& getMaterialName(std::string textureName, const ColourValue& colour);
     48        static const std::string& getMaterialName(const std::string& textureName, const ColourValue& colour);
    4849
    4950    private:
  • code/trunk/src/orxonox/tools/Timer.cc

    r3110 r3196  
    2727 */
    2828
     29#include "Timer.h"
     30
    2931#include <set>
    3032
    31 #include "Timer.h"
    32 
    33 #include "core/Executor.h"
    3433#include "core/CoreIncludes.h"
    3534#include "core/ConsoleCommand.h"
    3635#include "core/CommandExecutor.h"
    3736#include "core/Clock.h"
     37#include "core/Functor.h"
    3838
    3939namespace orxonox
  • code/trunk/src/orxonox/tools/Timer.h

    r2896 r3196  
    6262
    6363#include "OrxonoxPrereqs.h"
     64
    6465#include "core/Executor.h"
    6566#include "core/OrxonoxClass.h"
    66 #include "tools/TimeFactorListener.h"
     67#include "interfaces/TimeFactorListener.h"
    6768
    6869namespace orxonox
  • code/trunk/src/tinyxml/CMakeLists.txt

    r2710 r3196  
    3030  tinyxmlparser.cpp
    3131)
    32 GENERATE_SOURCE_GROUPS(${TINYXML++_FILES})
    3332
    3433# No warnings needed from third party libraries
     
    3635ADD_COMPILER_FLAGS("-w")
    3736
    38 IF(MSVC)
    39   ADD_LIBRARY(tinyxml++_orxonox STATIC ${TINYXML++_FILES})
    40 ELSE()
    41   ADD_LIBRARY(tinyxml++_orxonox SHARED ${TINYXML++_FILES})
    42   ORXONOX_INSTALL(tinyxml++_orxonox)
    43 ENDIF()
    44 
    45 SET_TARGET_PROPERTIES(tinyxml++_orxonox PROPERTIES VERSION 2.5.3)
     37ORXONOX_ADD_LIBRARY(tinyxml++_orxonox
     38  ORXONOX_EXTERNAL
     39  NO_DLL_INTERFACE
     40  VERSION
     41    2.5.3
     42  SOURCE_FILES
     43    ${TINYXML++_FILES}
     44)
  • code/trunk/src/tolua/CMakeLists.txt

    r2710 r3196  
    3636ADD_COMPILER_FLAGS("-w")
    3737
    38 ADD_LIBRARY(tolua++_orxonox SHARED ${TOLUA++_FILES})
    39 SET_TARGET_PROPERTIES(tolua++_orxonox PROPERTIES DEFINE_SYMBOL "TOLUA_SHARED_BUILD")
    40 TARGET_LINK_LIBRARIES(tolua++_orxonox ${LUA_LIBRARIES})
    41 
    42 SET_TARGET_PROPERTIES(tolua++_orxonox PROPERTIES VERSION 1.0.92)
    43 
    44 ORXONOX_INSTALL(tolua++_orxonox)
     38ORXONOX_ADD_LIBRARY(tolua++_orxonox
     39  ORXONOX_EXTERNAL
     40  DEFINE_SYMBOL
     41    "TOLUA_SHARED_BUILD"
     42  VERSION
     43    1.0.92
     44  LINK_LIBRARIES
     45    ${LUA_LIBRARIES}
     46  SOURCE_FILES
     47    ${TOLUA++_FILES}
     48)
    4549
    4650
    4751################## Tolua++ generator ##################
    4852
    49 ADD_EXECUTABLE(tolua++app_orxonox tolua.c)
    50 TARGET_LINK_LIBRARIES(tolua++app_orxonox tolua++_orxonox ${LUA_LIBRARIES})
    51 
    52 OPTION(TOLUA_PARSER_RELEASE "Disable all debug messages from tolua bind files for Release and MinSizeRel build types." FALSE)
     53ORXONOX_ADD_EXECUTABLE(tolua++app_orxonox
     54  ORXONOX_EXTERNAL
     55  VERSION
     56    1.0.92
     57  LINK_LIBRARIES
     58    ${LUA_LIBRARIES}
     59  SOURCE_FILES
     60    tolua.c
     61)
    5362
    5463# Set some variables to the cache in order to use them in the TOLUA macro
  • code/trunk/src/util/CMakeLists.txt

    r3089 r3196  
    1818 #
    1919
    20 SET_SOURCE_FILES(UTIL_FILES
    21   CRC32.h
    22   Clipboard.h
    23   Convert.h
    24   Debug.h
    25   Exception.h
    26   ExprParser.h
    27   Math.h
    28   MathConvert.h
    29   MultiType.h
    30   MultiTypeValue.h
    31   OrxEnum.h
    32   OutputBuffer.h
    33   OutputHandler.h
    34   SignalHandler.h
    35   Sleep.h
    36   String.h
    37   SubString.h
    38   UtilPrereqs.h
    39   mbool.h
    40  
     20SET_SOURCE_FILES(UTIL_SRC_FILES
    4121  Clipboard.cc
    4222  CRC32.cc
     
    5232  SubString.cc
    5333)
    54 #GET_ALL_HEADER_FILES(UTIL_HDR_FILES)
    55 #SET(UTIL_FILES ${UTIL_SRC_FILES} ${UTIL_HDR_FILES})
    56 GENERATE_SOURCE_GROUPS(${UTIL_FILES})
    57 # Also add OrxonoxConfig to have it least somewhere in the IDE
    58 LIST(APPEND UTIL_FILES
    59   ${CMAKE_BINARY_DIR}/src/OrxonoxConfig.h
    60   ${CMAKE_SOURCE_DIR}/src/OrxonoxConfig.h.in
    61   ${CMAKE_BINARY_DIR}/src/SpecialConfig.h
    62   ${CMAKE_SOURCE_DIR}/src/SpecialConfig.h.in
    63 )
    64 SOURCE_GROUP("" FILES
    65   ${CMAKE_BINARY_DIR}/src/OrxonoxConfig.h
    66   ${CMAKE_SOURCE_DIR}/src/OrxonoxConfig.h.in
    67   ${CMAKE_BINARY_DIR}/src/SpecialConfig.h
    68   ${CMAKE_SOURCE_DIR}/src/SpecialConfig.h.in
    69 )
    7034
    7135IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
     
    7438ENDIF()
    7539
    76 ADD_LIBRARY(util SHARED ${UTIL_FILES})
    77 SET_TARGET_PROPERTIES(util PROPERTIES DEFINE_SYMBOL "UTIL_SHARED_BUILD")
    78 TARGET_LINK_LIBRARIES(util ${OGRE_LIBRARY})
    79 
    80 ORXONOX_INSTALL(util)
     40ORXONOX_ADD_LIBRARY(util
     41  FIND_HEADER_FILES
     42  DEFINE_SYMBOL
     43    "UTIL_SHARED_BUILD"
     44  LINK_LIBRARIES
     45    ${OGRE_LIBRARY}
     46  SOURCE_FILES
     47    ${UTIL_SRC_FILES}
     48)
  • code/trunk/src/util/CRC32.h

    r2710 r3196  
    3131
    3232#include "UtilPrereqs.h"
    33 #include <iostream>
    3433
    3534namespace orxonox
  • code/trunk/src/util/Clipboard.cc

    r2710 r3196  
    112112namespace orxonox
    113113{
    114     std::string clipboard = ""; //!< Keeps the text of our internal clipboard
     114    static std::string clipboard = ""; //!< Keeps the text of our internal clipboard
    115115
    116116    /**
  • code/trunk/src/util/Clipboard.h

    r2171 r3196  
    4343
    4444#include "UtilPrereqs.h"
    45 
    4645#include <string>
    4746
  • code/trunk/src/util/Convert.h

    r2710 r3196  
    4040#include <string>
    4141#include <sstream>
    42 #include <istream>
    43 #include <ostream>
    4442#include <typeinfo>
    4543
     
    123121namespace orxonox
    124122{
    125     namespace
     123    namespace detail
    126124    {
    127125        //! Little template that maps integers to entire types (Alexandrescu 2001)
     
    139137    struct ConverterFallback
    140138    {
    141         static bool convert(ToType* output, const FromType& input)
     139        FORCEINLINE static bool convert(ToType* output, const FromType& input)
    142140        {
    143141            COUT(2) << "Could not convert value of type " << typeid(FromType).name()
     
    151149    struct ConverterFallback<FromType*, ToType*>
    152150    {
    153         static bool convert(ToType** output, FromType* const input)
     151        FORCEINLINE static bool convert(ToType** output, FromType* const input)
    154152        {
    155153            ToType* temp = dynamic_cast<ToType*>(input);
     
    174172struct ConverterStringStream
    175173{
    176     static bool convert(ToType* output, const FromType& input)
     174    FORCEINLINE static bool convert(ToType* output, const FromType& input)
    177175    {
    178176        return orxonox::ConverterFallback<FromType, ToType>::convert(output, input);
     
    188186{
    189187    template <class FromType>
    190     inline bool operator <<(std::ostream& outstream,  const FromType& input)
     188    FORCEINLINE bool operator <<(std::ostream& outstream,  const FromType& input)
    191189    {
    192190        std::string temp;
     
    205203struct ConverterStringStream<FromType, std::string>
    206204{
    207     static bool convert(std::string* output, const FromType& input)
     205    FORCEINLINE static bool convert(std::string* output, const FromType& input)
    208206    {
    209207        using namespace fallbackTemplates;
     
    228226{
    229227    template <class ToType>
    230     inline bool operator >>(std::istream& instream, ToType& output)
     228    FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
    231229    {
    232230        return orxonox::ConverterFallback<std::string, ToType>
     
    239237struct ConverterStringStream<std::string, ToType>
    240238{
    241     static bool convert(ToType* output, const std::string& input)
     239    FORCEINLINE static bool convert(ToType* output, const std::string& input)
    242240    {
    243241        using namespace fallbackTemplates;
     
    262260    // implicit cast not possible, try stringstream conversion next
    263261    template <class FromType, class ToType>
    264     inline bool convertImplicitely(ToType* output, const FromType& input, orxonox::Int2Type<false>)
     262    FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, detail::Int2Type<false>)
    265263    {
    266264        return ConverterStringStream<FromType, ToType>::convert(output, input);
     
    269267    // We can cast implicitely
    270268    template <class FromType, class ToType>
    271     inline bool convertImplicitely(ToType* output, const FromType& input, orxonox::Int2Type<true>)
     269    FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, detail::Int2Type<true>)
    272270    {
    273271        (*output) = static_cast<ToType>(input);
     
    284282    struct ConverterExplicit
    285283    {
    286         static bool convert(ToType* output, const FromType& input)
     284        FORCEINLINE static bool convert(ToType* output, const FromType& input)
    287285        {
    288286            // Try implict cast and probe first. If a simple cast is not possible, it will not compile
    289287            // We therefore have to out source it into another template function
    290288            const bool probe = ImplicitConversion<FromType, ToType>::exists;
    291             return convertImplicitely(output, input, orxonox::Int2Type<probe>());
     289            return convertImplicitely(output, input, detail::Int2Type<probe>());
    292290        }
    293291    };
     
    306304    */
    307305    template <class FromType, class ToType>
    308     inline bool convertValue(ToType* output, const FromType& input)
     306    FORCEINLINE bool convertValue(ToType* output, const FromType& input)
    309307    {
    310308        return ConverterExplicit<FromType, ToType>::convert(output, input);
    311     }
    312 
    313     // For compatibility reasons. The same, but with capital ConvertValue
    314     template<class FromType, class ToType>
    315     inline bool ConvertValue(ToType* output, const FromType& input)
    316     {
    317         return convertValue(output, input);
    318309    }
    319310
     
    331322    */
    332323    template<class FromType, class ToType>
    333     inline bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
     324    FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
    334325    {
    335326        if (convertValue(output, input))
     
    342333    }
    343334
    344     // for compatibility reason. (capital 'c' in ConvertValue)
    345     template<class FromType, class ToType>
    346     inline bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback)
    347     {
    348         return convertValue(output, input, fallback);
    349     }
    350 
    351335    // Directly returns the converted value, even if the conversion was not successful.
    352336    template<class FromType, class ToType>
    353     inline ToType getConvertedValue(const FromType& input)
     337    FORCEINLINE ToType getConvertedValue(const FromType& input)
    354338    {
    355339        ToType output;
     
    360344    // Directly returns the converted value, but uses the fallback on failure.
    361345    template<class FromType, class ToType>
    362     inline ToType getConvertedValue(const FromType& input, const ToType& fallback)
     346    FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
    363347    {
    364348        ToType output;
     
    370354    // That means you can call it exactly like static_cast<ToType>(fromTypeValue).
    371355    template<class ToType, class FromType>
    372     inline ToType omni_cast(const FromType& input)
     356    FORCEINLINE ToType multi_cast(const FromType& input)
    373357    {
    374358        ToType output;
     
    379363    // convert to string Shortcut
    380364    template <class FromType>
    381     inline std::string convertToString(FromType value)
    382     {
    383       return getConvertedValue<FromType, std::string>(value);
     365    FORCEINLINE std::string convertToString(FromType value)
     366    {
     367        return getConvertedValue<FromType, std::string>(value);
    384368    }
    385369
    386370    // convert from string Shortcut
    387371    template <class ToType>
    388     inline ToType convertFromString(std::string str)
    389     {
    390       return getConvertedValue<std::string, ToType>(str);
     372    FORCEINLINE ToType convertFromString(std::string str)
     373    {
     374        return getConvertedValue<std::string, ToType>(str);
    391375    }
    392376
     
    399383    struct ConverterExplicit<const char*, ToType>
    400384    {
    401         static bool convert(ToType* output, const char* input)
     385        FORCEINLINE static bool convert(ToType* output, const char* input)
    402386        {
    403387            return convertValue<std::string, ToType>(output, input);
     
    409393    struct ConverterExplicit<char, std::string>
    410394    {
    411         static bool convert(std::string* output, const char input)
     395        FORCEINLINE static bool convert(std::string* output, const char input)
    412396        {
    413397            *output = std::string(1, input);
     
    418402    struct ConverterExplicit<unsigned char, std::string>
    419403    {
    420         static bool convert(std::string* output, const unsigned char input)
     404        FORCEINLINE static bool convert(std::string* output, const unsigned char input)
    421405        {
    422406            *output = std::string(1, input);
     
    427411    struct ConverterExplicit<std::string, char>
    428412    {
    429         static bool convert(char* output, const std::string input)
     413        FORCEINLINE static bool convert(char* output, const std::string input)
    430414        {
    431415            if (input != "")
     
    439423    struct ConverterExplicit<std::string, unsigned char>
    440424    {
    441         static bool convert(unsigned char* output, const std::string input)
     425        FORCEINLINE static bool convert(unsigned char* output, const std::string input)
    442426        {
    443427            if (input != "")
     
    454438    struct ConverterExplicit<bool, std::string>
    455439    {
    456         static bool convert(std::string* output, const bool& input)
     440        FORCEINLINE static bool convert(std::string* output, const bool& input)
    457441        {
    458442            if (input)
  • code/trunk/src/util/Debug.h

    r2171 r3196  
    6363#include "UtilPrereqs.h"
    6464
    65 #include <stdio.h>
    66 
    6765#include "OutputHandler.h"
    6866
     
    7371        @return The soft debug level
    7472    */
    75     static inline int getSoftDebugLevel()
     73    inline int getSoftDebugLevel()
    7674    {
    7775        return OutputHandler::getSoftDebugLevel();
  • code/trunk/src/util/Exception.cc

    r3068 r3196  
    3737namespace orxonox
    3838{
    39     Exception::Exception(const std::string& description, int lineNumber,
     39    Exception::Exception(const std::string& description, unsigned int lineNumber,
    4040                         const char* filename, const char* functionName)
    4141        : description_(description)
     
    5252    { }
    5353
     54    /**
     55    @remarks
     56        The composed full description gets stored to fullDescription_. But for compliance
     57        with std::exception, this method has to be const. Hence fullDescription_ is declared
     58        as mutable.
     59    */
    5460    const std::string& Exception::getFullDescription() const
    5561    {
  • code/trunk/src/util/Exception.h

    r3068 r3196  
    3030@file
    3131@brief
    32     Declaration of the Exception class.
     32    Declaration of facilities to handle exceptions.
    3333*/
    3434
     
    3838#include "UtilPrereqs.h"
    3939
     40#include <exception>
     41#include <sstream>
    4042#include <string>
    41 #include <exception>
    42 #include <cassert>
    4343#include "Debug.h"
    4444
    4545namespace orxonox
    4646{
     47    /**
     48    @brief
     49        Base class for all exceptions (derived from std::exception).
     50    @details
     51        This class provides support for information about the file, the line
     52        and the function the error occured.
     53    */
    4754    class _UtilExport Exception : public std::exception
    4855    {
    4956    public:
    50 
    51         Exception(const std::string& description, int lineNumber,
     57        /**
     58        @brief
     59            Creates the exception but doesn't yet compose the full descrption (because of the virtual functions)
     60        @param description
     61            Exception description as string. This message is supposed to help developers!
     62        */
     63        Exception(const std::string& description, unsigned int lineNumber,
    5264                  const char* filename, const char* functionName);
     65        //! Simplified constructor with just a description. If you need more, use the other one.
    5366        Exception(const std::string& description);
    5467
    55         /// Needed for  compatibility with std::exception (from Ogre::Exception)
     68        //! Needed for compatibility with std::exception
    5669        virtual ~Exception() throw() { }
    5770
     71        //! Returns a full description with type, line, file and function
    5872        virtual const std::string& getFullDescription() const;
     73        //! Returns the string name of the exception type
    5974        virtual std::string        getTypeName()        const = 0;
     75        //! Returns the short developer written exception
    6076        virtual const std::string& getDescription()     const { return this->description_; }
    61         virtual const int          getLineNumber()      const { return this->lineNumber_; }
     77        //! Returns the line number on which the exception occurred.
     78        virtual const unsigned int getLineNumber()      const { return this->lineNumber_; }
     79        //! Returns the function in which the exception occurred.
    6280        virtual const std::string& getFunctionName()    const { return this->functionName_; }
     81        //! Returns the filename in which the exception occurred.
     82        virtual const std::string& getFilename()        const { return this->filename_; }
    6383
    64         /// Override std::exception::what (from Ogre::Exception)
     84        //! Returns a full description of the error.
    6585        const char* what() const throw() { return getFullDescription().c_str(); }
    6686
    6787    protected:
    68         std::string description_;
    69         int lineNumber_;
    70         std::string functionName_;
    71         std::string filename_;
     88        std::string description_;             //!< User typed text about why the exception occurred
     89        unsigned int lineNumber_;             //!< Line on which the exception occurred
     90        std::string functionName_;            //!< Function (including namespace and class) where the exception occurred
     91        std::string filename_;                //!< File where the exception occurred
    7292        // mutable because "what()" is a const method
    73         mutable std::string fullDescription_;
     93        mutable std::string fullDescription_; //!< Full description with line, file and function
    7494    };
    7595
    76 
     96//! Creates a new type of exception that inherits from tracker::Exception
    7797#define CREATE_ORXONOX_EXCEPTION(ExceptionName)                                     \
    7898    class ExceptionName##Exception : public Exception                               \
    7999    {                                                                               \
    80100    public:                                                                         \
    81         ExceptionName##Exception(const std::string& description, int lineNumber,    \
    82                   const char* filename, const char* functionName)                   \
    83                   : Exception(description, lineNumber, filename, functionName)      \
     101        ExceptionName##Exception(const std::string& description,                    \
     102                unsigned int lineNumber, const char* filename,                      \
     103                const char* functionName)                                           \
     104            : Exception(description, lineNumber, filename, functionName)            \
    84105        { }                                                                         \
    85106                                                                                    \
    86107        ExceptionName##Exception(const std::string& description)                    \
    87                   : Exception(description)                                          \
     108            : Exception(description)                                                \
    88109        { }                                                                         \
    89110                                                                                    \
     
    91112                                                                                    \
    92113        std::string getTypeName() const { return #ExceptionName; }                  \
    93     };
     114    }
    94115
    95116    // Creates all possible exception types.
    96117    // If you want to add a new type, simply copy and adjust a new line here.
     118#ifndef DOXYGEN_SHOULD_SKIP_THIS
    97119    CREATE_ORXONOX_EXCEPTION(General);
    98120    CREATE_ORXONOX_EXCEPTION(FileNotFound);
     
    106128    CREATE_ORXONOX_EXCEPTION(NoGraphics);
    107129    CREATE_ORXONOX_EXCEPTION(AbortLoading);
    108 }
     130#endif
    109131
    110132    /**
    111133    @brief
    112         Helper function that creates an exception, displays the message, but doesn't throw it.
     134        Helper function that forwards an exception and displays the message.
     135    @details
     136        This is necessary because only when using 'throw' the objects storage is managed.
    113137    */
    114138    template <class T>
    115     inline const T& InternalHandleException(const T& exception)
     139    inline const T& exceptionThrowerHelper(const T& exception)
    116140    {
    117141        // let the catcher decide whether to display the message below level 4
     
    120144    }
    121145
    122 #define ThrowException(type, description) \
    123     throw InternalHandleException(type##Exception(description, __LINE__, __FILE__, __FUNCTIONNAME__))
     146/**
     147@brief
     148    Throws an exception and logs a message beforehand.
     149@param type
     150    Type of the exception as literal (General, Initialisation, etc.)
     151@param description
     152    Exception description as string
     153*/
     154#define ThrowException(type, description, ...) \
     155    throw orxonox::exceptionThrowerHelper(type##Exception(static_cast<std::ostringstream&>(std::ostringstream().flush() << description).str(), __LINE__, __FILE__, __FUNCTIONNAME__))
    124156
    125     // define an assert macro that can display a message
    126 #ifndef NDEBUG
    127 #define OrxAssert(Assertion, ErrorMessage) \
    128     Assertion ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << ErrorMessage << std::endl); \
    129     assert(Assertion)
    130 #else
    131 #define OrxAssert(condition, errorMessage)  ((void)0)
    132 #endif
     157} /* namespace orxonox */
    133158
    134159#endif /* _Exception_H__ */
  • code/trunk/src/util/ExprParser.cc

    r2171 r3196  
    3535#include <cmath>
    3636#include <cstring>
    37 #include <stdlib.h>
     37#include <cstdlib>
    3838
    3939// macros for easier if, else statements
     
    247247            return 0;
    248248        }
    249         else if (*reading_stream > 47 && *reading_stream < 59 || *reading_stream == 46)
     249        else if ((*reading_stream > 47 && *reading_stream < 59) || *reading_stream == 46)
    250250        {  // number
    251251            value = strtod(reading_stream, const_cast<char**>(&reading_stream));
    252252        }
    253         else if (*reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
     253        else if ((*reading_stream > 64 && *reading_stream < 91) || (*reading_stream > 96 && *reading_stream < 123) || *reading_stream == 46)
    254254        {  // variable or function
    255255            char* word = new char[256];
     
    384384        char* word = str;
    385385        int counter = 0;
    386         while (*reading_stream > 47 && *reading_stream < 58 || *reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
     386        while ((*reading_stream > 47 && *reading_stream < 58) || (*reading_stream > 64 && *reading_stream < 91) || (*reading_stream > 96 && *reading_stream < 123) || *reading_stream == 46)
    387387        {
    388388            *word++ = *reading_stream++;
  • code/trunk/src/util/ExprParser.h

    r2171 r3196  
    7272
    7373        ExprParser(const std::string& str);
    74         std::string& getRemains() { return  this->remains_; }
    75         double       getResult()  { return  this->result_; }
    76         bool         getSuccess() { return !this->failed_; }
     74        const std::string& getRemains() { return  this->remains_; }
     75        double             getResult()  { return  this->result_; }
     76        bool               getSuccess() { return !this->failed_; }
    7777
    7878    private:
  • code/trunk/src/util/Math.cc

    r3049 r3196  
    3535
    3636#include <OgrePlane.h>
     37
    3738#include "MathConvert.h"
    3839#include "SubString.h"
    39 
    40 // Do not remove this include to avoid linker errors.
     40// Do not remove this include, it avoids linker errors.
    4141#include "mbool.h"
    4242
     
    238238        if (tokens.size() >= 2)
    239239        {
    240             if (!ConvertValue(&(output->x), tokens[0]))
    241                 return false;
    242             if (!ConvertValue(&(output->y), tokens[1]))
     240            if (!convertValue(&(output->x), tokens[0]))
     241                return false;
     242            if (!convertValue(&(output->y), tokens[1]))
    243243                return false;
    244244
     
    261261        if (tokens.size() >= 3)
    262262        {
    263             if (!ConvertValue(&(output->x), tokens[0]))
    264                 return false;
    265             if (!ConvertValue(&(output->y), tokens[1]))
    266                 return false;
    267             if (!ConvertValue(&(output->z), tokens[2]))
     263            if (!convertValue(&(output->x), tokens[0]))
     264                return false;
     265            if (!convertValue(&(output->y), tokens[1]))
     266                return false;
     267            if (!convertValue(&(output->z), tokens[2]))
    268268                return false;
    269269
     
    286286        if (tokens.size() >= 4)
    287287        {
    288             if (!ConvertValue(&(output->x), tokens[0]))
    289                 return false;
    290             if (!ConvertValue(&(output->y), tokens[1]))
    291                 return false;
    292             if (!ConvertValue(&(output->z), tokens[2]))
    293                 return false;
    294             if (!ConvertValue(&(output->w), tokens[3]))
     288            if (!convertValue(&(output->x), tokens[0]))
     289                return false;
     290            if (!convertValue(&(output->y), tokens[1]))
     291                return false;
     292            if (!convertValue(&(output->z), tokens[2]))
     293                return false;
     294            if (!convertValue(&(output->w), tokens[3]))
    295295                return false;
    296296
     
    309309        if (tokens.size() >= 4)
    310310        {
    311             if (!ConvertValue(&(output->w), tokens[0]))
    312                 return false;
    313             if (!ConvertValue(&(output->x), tokens[1]))
    314                 return false;
    315             if (!ConvertValue(&(output->y), tokens[2]))
    316                 return false;
    317             if (!ConvertValue(&(output->z), tokens[3]))
     311            if (!convertValue(&(output->w), tokens[0]))
     312                return false;
     313            if (!convertValue(&(output->x), tokens[1]))
     314                return false;
     315            if (!convertValue(&(output->y), tokens[2]))
     316                return false;
     317            if (!convertValue(&(output->z), tokens[3]))
    318318                return false;
    319319
     
    332332        if (tokens.size() >= 3)
    333333        {
    334             if (!ConvertValue(&(output->r), tokens[0]))
    335                 return false;
    336             if (!ConvertValue(&(output->g), tokens[1]))
    337                 return false;
    338             if (!ConvertValue(&(output->b), tokens[2]))
     334            if (!convertValue(&(output->r), tokens[0]))
     335                return false;
     336            if (!convertValue(&(output->g), tokens[1]))
     337                return false;
     338            if (!convertValue(&(output->b), tokens[2]))
    339339                return false;
    340340            if (tokens.size() >= 4)
    341341            {
    342                 if (!ConvertValue(&(output->a), tokens[3]))
     342                if (!convertValue(&(output->a), tokens[3]))
    343343                    return false;
    344344            }
  • code/trunk/src/util/Math.h

    r2872 r3196  
    3737#include "UtilPrereqs.h"
    3838
    39 #include <ostream>
    4039#include <string>
    4140#include <cmath>
    42 #include <boost/static_assert.hpp>
    4341
    4442#include <OgreMath.h>
     
    4644#include <OgreVector3.h>
    4745#include <OgreVector4.h>
    48 #include <OgreMatrix3.h>
    49 #include <OgreMatrix4.h>
    5046#include <OgreQuaternion.h>
    5147#include <OgreColourValue.h>
     
    5854namespace orxonox
    5955{
    60     using Ogre::Radian;
    61     using Ogre::Degree;
    62     using Ogre::Vector2;
    63     using Ogre::Vector3;
    64     using Ogre::Vector4;
    65     using Ogre::Matrix3;
    66     using Ogre::Matrix4;
    67     using Ogre::Quaternion;
    68     using Ogre::ColourValue;
    69 
    70     // Also define our own transform space enum
    71     namespace TransformSpace
    72     {
    73         /**
    74         @brief
    75             Enumeration denoting the spaces which a transform can be relative to.
    76         */
    77         enum Enum
    78         {
    79             //! Transform is relative to the local space
    80             Local,
    81             //! Transform is relative to the space of the parent node
    82             Parent,
    83             //! Transform is relative to world space
    84             World
    85         };
    86     }
    87 
    8856    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);
    8957    _UtilExport std::istream& operator>>(std::istream& in, orxonox::Radian& radian);
     
    217185    template <> inline orxonox::Quaternion  zeroise<orxonox::Quaternion>()  { return orxonox::Quaternion (0, 0, 0, 0); }
    218186
     187    //! Provides zero value symbols that can be returned as reference
     188    template <typename T>
     189    struct NilValue
     190    {
     191        inline operator const T&() const
     192        {
     193            return value;
     194        }
     195        static T value;
     196    };
     197    template <typename T>
     198    T NilValue<T>::value = zeroise<T>();
     199
    219200    /**
    220201        @brief Interpolates between two values for a time between 0 and 1.
     
    225206    */
    226207    template <typename T>
    227     T interpolate(float time, const T& start, const T& end)
     208    inline T interpolate(float time, const T& start, const T& end)
    228209    {
    229210        return time * (end - start) + start;
     
    238219    */
    239220    template <typename T>
    240     T interpolateSmooth(float time, const T& start, const T& end)
     221    inline T interpolateSmooth(float time, const T& start, const T& end)
    241222    {
    242223        return (-2 * (end - start) * cube(time)) + (3 * (end - start) * square(time)) + start;
     
    248229    inline float rnd()
    249230    {
    250         return rand() / (RAND_MAX + 1.0);
     231        return rand() / (RAND_MAX + 1.0f);
    251232    }
    252233
     
    275256    inline float rndsgn()
    276257    {
    277         return ((rand() & 0x2) - 1); // rand() & 0x2 is either 2 or 0
     258        return static_cast<float>((rand() & 0x2) - 1); // rand() & 0x2 is either 2 or 0
    278259    }
    279260
     
    283264    {
    284265    public:
    285       IntVector2() : x(0), y(0) { }
    286       IntVector2(int _x, int _y) : x(_x), y(_y) { }
    287       int x;
    288       int y;
     266        IntVector2() : x(0), y(0) { }
     267        IntVector2(int _x, int _y) : x(_x), y(_y) { }
     268        int x;
     269        int y;
    289270    };
    290271
     
    292273    {
    293274    public:
    294       IntVector3() : x(0), y(0), z(0) { }
    295       IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
    296       int x;
    297       int y;
    298       int z;
     275        IntVector3() : x(0), y(0), z(0) { }
     276        IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
     277        int x;
     278        int y;
     279        int z;
    299280    };
    300281}
  • code/trunk/src/util/MathConvert.h

    r2171 r3196  
    5050    struct ConverterExplicit<orxonox::Vector2, std::string>
    5151    {
    52         static bool convert(std::string* output, const orxonox::Vector2& input)
     52        FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
    5353        {
    5454            std::ostringstream ostream;
     
    6666    struct ConverterExplicit<orxonox::Vector3, std::string>
    6767    {
    68         static bool convert(std::string* output, const orxonox::Vector3& input)
     68        FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
    6969        {
    7070            std::ostringstream ostream;
     
    8282    struct ConverterExplicit<orxonox::Vector4, std::string>
    8383    {
    84         static bool convert(std::string* output, const orxonox::Vector4& input)
     84        FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
    8585        {
    8686            std::ostringstream ostream;
     
    9898    struct ConverterExplicit<orxonox::Quaternion, std::string>
    9999    {
    100         static bool convert(std::string* output, const orxonox::Quaternion& input)
     100        FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
    101101        {
    102102            std::ostringstream ostream;
     
    114114    struct ConverterExplicit<orxonox::ColourValue, std::string>
    115115    {
    116         static bool convert(std::string* output, const orxonox::ColourValue& input)
     116        FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
    117117        {
    118118            std::ostringstream ostream;
     
    156156    struct ConverterFallback<orxonox::Radian, ToType>
    157157    {
    158         static bool convert(ToType* output, const orxonox::Radian& input)
     158        FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
    159159        {
    160160            return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
     
    166166    struct ConverterFallback<orxonox::Degree, ToType>
    167167    {
    168         static bool convert(ToType* output, const orxonox::Degree& input)
     168        FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
    169169        {
    170170            return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
     
    176176    struct ConverterFallback<FromType, orxonox::Radian>
    177177    {
    178         static bool convert(orxonox::Radian* output, const FromType& input)
     178        FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
    179179        {
    180180            float temp;
     
    193193    struct ConverterFallback<FromType, orxonox::Degree>
    194194    {
    195         static bool convert(orxonox::Degree* output, const FromType& input)
     195        FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
    196196        {
    197197            float temp;
  • code/trunk/src/util/MultiType.cc

    r2662 r3196  
    159159    }
    160160
    161     MultiType::operator char()                 const { return (this->value_) ? ((this->value_->type_ == MT_char       ) ? ((MT_Value<char>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    162     MultiType::operator unsigned char()        const { return (this->value_) ? ((this->value_->type_ == MT_uchar      ) ? ((MT_Value<unsigned char>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    163     MultiType::operator short()                const { return (this->value_) ? ((this->value_->type_ == MT_short      ) ? ((MT_Value<short>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    164     MultiType::operator unsigned short()       const { return (this->value_) ? ((this->value_->type_ == MT_ushort     ) ? ((MT_Value<unsigned short>      *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    165     MultiType::operator int()                  const { return (this->value_) ? ((this->value_->type_ == MT_int        ) ? ((MT_Value<int>                 *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    166     MultiType::operator unsigned int()         const { return (this->value_) ? ((this->value_->type_ == MT_uint       ) ? ((MT_Value<unsigned int>        *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    167     MultiType::operator long()                 const { return (this->value_) ? ((this->value_->type_ == MT_long       ) ? ((MT_Value<long>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    168     MultiType::operator unsigned long()        const { return (this->value_) ? ((this->value_->type_ == MT_ulong      ) ? ((MT_Value<unsigned long>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    169     MultiType::operator long long()            const { return (this->value_) ? ((this->value_->type_ == MT_longlong   ) ? ((MT_Value<long long>           *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    170     MultiType::operator unsigned long long()   const { return (this->value_) ? ((this->value_->type_ == MT_ulonglong  ) ? ((MT_Value<unsigned long long>  *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    171     MultiType::operator float()                const { return (this->value_) ? ((this->value_->type_ == MT_float      ) ? ((MT_Value<float>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    172     MultiType::operator double()               const { return (this->value_) ? ((this->value_->type_ == MT_double     ) ? ((MT_Value<double>              *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    173     MultiType::operator long double()          const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? ((MT_Value<long double>         *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    174     MultiType::operator bool()                 const { return (this->value_) ? ((this->value_->type_ == MT_bool       ) ? ((MT_Value<bool>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    175     MultiType::operator void*()                const { return (this->value_) ? ((this->value_->type_ == MT_void       ) ? ((MT_Value<void*>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    176     MultiType::operator std::string()          const { return (this->value_) ? ((this->value_->type_ == MT_string     ) ? ((MT_Value<std::string>         *)this->value_)->value_ : (*this->value_)) : zeroise<std::string>();          } /** @brief Returns the current value, converted to the requested type. */
    177     MultiType::operator orxonox::Vector2()     const { return (this->value_) ? ((this->value_->type_ == MT_vector2    ) ? ((MT_Value<orxonox::Vector2>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector2>();     } /** @brief Returns the current value, converted to the requested type. */
    178     MultiType::operator orxonox::Vector3()     const { return (this->value_) ? ((this->value_->type_ == MT_vector3    ) ? ((MT_Value<orxonox::Vector3>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector3>();     } /** @brief Returns the current value, converted to the requested type. */
    179     MultiType::operator orxonox::Vector4()     const { return (this->value_) ? ((this->value_->type_ == MT_vector4    ) ? ((MT_Value<orxonox::Vector4>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector4>();     } /** @brief Returns the current value, converted to the requested type. */
    180     MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? ((MT_Value<orxonox::ColourValue>*)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
    181     MultiType::operator orxonox::Quaternion()  const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? ((MT_Value<orxonox::Quaternion> *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Quaternion>();  } /** @brief Returns the current value, converted to the requested type. */
    182     MultiType::operator orxonox::Radian()      const { return (this->value_) ? ((this->value_->type_ == MT_radian     ) ? ((MT_Value<orxonox::Radian>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Radian>();      } /** @brief Returns the current value, converted to the requested type. */
    183     MultiType::operator orxonox::Degree()      const { return (this->value_) ? ((this->value_->type_ == MT_degree     ) ? ((MT_Value<orxonox::Degree>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Degree>();      } /** @brief Returns the current value, converted to the requested type. */
     161    MultiType::operator char()                 const { return (this->value_) ? ((this->value_->type_ == MT_char       ) ? (static_cast<MT_Value<char>                *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     162    MultiType::operator unsigned char()        const { return (this->value_) ? ((this->value_->type_ == MT_uchar      ) ? (static_cast<MT_Value<unsigned char>       *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     163    MultiType::operator short()                const { return (this->value_) ? ((this->value_->type_ == MT_short      ) ? (static_cast<MT_Value<short>               *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     164    MultiType::operator unsigned short()       const { return (this->value_) ? ((this->value_->type_ == MT_ushort     ) ? (static_cast<MT_Value<unsigned short>      *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     165    MultiType::operator int()                  const { return (this->value_) ? ((this->value_->type_ == MT_int        ) ? (static_cast<MT_Value<int>                 *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     166    MultiType::operator unsigned int()         const { return (this->value_) ? ((this->value_->type_ == MT_uint       ) ? (static_cast<MT_Value<unsigned int>        *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     167    MultiType::operator long()                 const { return (this->value_) ? ((this->value_->type_ == MT_long       ) ? (static_cast<MT_Value<long>                *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     168    MultiType::operator unsigned long()        const { return (this->value_) ? ((this->value_->type_ == MT_ulong      ) ? (static_cast<MT_Value<unsigned long>       *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     169    MultiType::operator long long()            const { return (this->value_) ? ((this->value_->type_ == MT_longlong   ) ? (static_cast<MT_Value<long long>           *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     170    MultiType::operator unsigned long long()   const { return (this->value_) ? ((this->value_->type_ == MT_ulonglong  ) ? (static_cast<MT_Value<unsigned long long>  *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     171    MultiType::operator float()                const { return (this->value_) ? ((this->value_->type_ == MT_float      ) ? (static_cast<MT_Value<float>               *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     172    MultiType::operator double()               const { return (this->value_) ? ((this->value_->type_ == MT_double     ) ? (static_cast<MT_Value<double>              *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     173    MultiType::operator long double()          const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? (static_cast<MT_Value<long double>         *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     174    MultiType::operator bool()                 const { return (this->value_) ? ((this->value_->type_ == MT_bool       ) ? (static_cast<MT_Value<bool>                *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     175    MultiType::operator void*()                const { return (this->value_) ? ((this->value_->type_ == MT_void       ) ? (static_cast<MT_Value<void*>               *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     176    MultiType::operator std::string()          const { return (this->value_) ? ((this->value_->type_ == MT_string     ) ? (static_cast<MT_Value<std::string>         *>(this->value_))->value_ : (*this->value_)) : NilValue<std::string>();          } /** @brief Returns the current value, converted to the requested type. */
     177    MultiType::operator orxonox::Vector2()     const { return (this->value_) ? ((this->value_->type_ == MT_vector2    ) ? (static_cast<MT_Value<orxonox::Vector2>    *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector2>();     } /** @brief Returns the current value, converted to the requested type. */
     178    MultiType::operator orxonox::Vector3()     const { return (this->value_) ? ((this->value_->type_ == MT_vector3    ) ? (static_cast<MT_Value<orxonox::Vector3>    *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector3>();     } /** @brief Returns the current value, converted to the requested type. */
     179    MultiType::operator orxonox::Vector4()     const { return (this->value_) ? ((this->value_->type_ == MT_vector4    ) ? (static_cast<MT_Value<orxonox::Vector4>    *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector4>();     } /** @brief Returns the current value, converted to the requested type. */
     180    MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? (static_cast<MT_Value<orxonox::ColourValue>*>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
     181    MultiType::operator orxonox::Quaternion()  const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? (static_cast<MT_Value<orxonox::Quaternion> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Quaternion>();  } /** @brief Returns the current value, converted to the requested type. */
     182    MultiType::operator orxonox::Radian()      const { return (this->value_) ? ((this->value_->type_ == MT_radian     ) ? (static_cast<MT_Value<orxonox::Radian>     *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Radian>();      } /** @brief Returns the current value, converted to the requested type. */
     183    MultiType::operator orxonox::Degree()      const { return (this->value_) ? ((this->value_->type_ == MT_degree     ) ? (static_cast<MT_Value<orxonox::Degree>     *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Degree>();      } /** @brief Returns the current value, converted to the requested type. */
    184184
    185185    template <> void MultiType::createNewValueContainer(const char& value)                 { this->value_ = new MT_Value<char>                (value, MT_char       ); } /** @brief Creates a new value container for the given type. */
  • code/trunk/src/util/MultiType.h

    r3084 r3196  
    6969#include "UtilPrereqs.h"
    7070
    71 #include <boost/static_assert.hpp>
    72 
    73 #include "Math.h"
     71#include <cassert>
     72#include <string>
     73#include <OgreVector2.h>
     74#include <OgreVector3.h>
     75#include <OgreVector4.h>
     76#include <OgreQuaternion.h>
     77#include <OgreColourValue.h>
    7478
    7579namespace orxonox
     
    441445            template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
    442446            /** @brief Creates a new value container (works only with specialized types). */
    443             template <typename T>        void createNewValueContainer(const T& value) { BOOST_STATIC_ASSERT(sizeof(T) == 0); return false; }
     447            template <typename T>        void createNewValueContainer(const T& value) { /* STATIC ASSERT */ *****value; return false; }
    444448
    445449            MT_ValueBase* value_; //!< A pointer to the value container
  • code/trunk/src/util/MultiTypeValue.h

    r3084 r3196  
    3838
    3939#include "UtilPrereqs.h"
     40
     41#include <cassert>
    4042#include "MathConvert.h"
    4143#include "MultiType.h"
    4244#include "Serialise.h"
    43 #include <cassert>
    4445
    4546namespace orxonox
     
    7576        }
    7677
    77         inline bool getValue(char*                 value) const { return ConvertValue<T, char                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    78         inline bool getValue(unsigned char*        value) const { return ConvertValue<T, unsigned char       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    79         inline bool getValue(short*                value) const { return ConvertValue<T, short               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    80         inline bool getValue(unsigned short*       value) const { return ConvertValue<T, unsigned short      >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    81         inline bool getValue(int*                  value) const { return ConvertValue<T, int                 >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    82         inline bool getValue(unsigned int*         value) const { return ConvertValue<T, unsigned int        >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    83         inline bool getValue(long*                 value) const { return ConvertValue<T, long                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    84         inline bool getValue(unsigned long*        value) const { return ConvertValue<T, unsigned long       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    85         inline bool getValue(long long*            value) const { return ConvertValue<T, long long           >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    86         inline bool getValue(unsigned long long*   value) const { return ConvertValue<T, unsigned long long  >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    87         inline bool getValue(float*                value) const { return ConvertValue<T, float               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    88         inline bool getValue(double*               value) const { return ConvertValue<T, double              >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    89         inline bool getValue(long double*          value) const { return ConvertValue<T, long double         >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    90         inline bool getValue(bool*                 value) const { return ConvertValue<T, bool                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    91         inline bool getValue(void**                value) const { return ConvertValue<T, void*               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    92         inline bool getValue(std::string*          value) const { return ConvertValue<T, std::string         >(value, value_, zeroise<std::string>         ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    93         inline bool getValue(orxonox::Vector2*     value) const { return ConvertValue<T, orxonox::Vector2    >(value, value_, zeroise<orxonox::Vector2>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    94         inline bool getValue(orxonox::Vector3*     value) const { return ConvertValue<T, orxonox::Vector3    >(value, value_, zeroise<orxonox::Vector3>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    95         inline bool getValue(orxonox::Vector4*     value) const { return ConvertValue<T, orxonox::Vector4    >(value, value_, zeroise<orxonox::Vector4>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    96         inline bool getValue(orxonox::ColourValue* value) const { return ConvertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    97         inline bool getValue(orxonox::Quaternion*  value) const { return ConvertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    98         inline bool getValue(orxonox::Radian*      value) const { return ConvertValue<T, orxonox::Radian     >(value, value_, zeroise<orxonox::Radian>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    99         inline bool getValue(orxonox::Degree*      value) const { return ConvertValue<T, orxonox::Degree     >(value, value_, zeroise<orxonox::Degree>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    100 
    101         inline bool setValue(const char& value)                 { return !(bHasDefaultValue_ = !ConvertValue<char                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    102         inline bool setValue(const unsigned char& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned char       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    103         inline bool setValue(const short& value)                { return !(bHasDefaultValue_ = !ConvertValue<short               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    104         inline bool setValue(const unsigned short& value)       { return !(bHasDefaultValue_ = !ConvertValue<unsigned short      , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    105         inline bool setValue(const int& value)                  { return !(bHasDefaultValue_ = !ConvertValue<int                 , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    106         inline bool setValue(const unsigned int& value)         { return !(bHasDefaultValue_ = !ConvertValue<unsigned int        , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    107         inline bool setValue(const long& value)                 { return !(bHasDefaultValue_ = !ConvertValue<long                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    108         inline bool setValue(const unsigned long& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned long       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    109         inline bool setValue(const long long& value)            { return !(bHasDefaultValue_ = !ConvertValue<long long           , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    110         inline bool setValue(const unsigned long long& value)   { return !(bHasDefaultValue_ = !ConvertValue<unsigned long long  , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    111         inline bool setValue(const float& value)                { return !(bHasDefaultValue_ = !ConvertValue<float               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    112         inline bool setValue(const double& value)               { return !(bHasDefaultValue_ = !ConvertValue<double              , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    113         inline bool setValue(const long double& value)          { return !(bHasDefaultValue_ = !ConvertValue<long double         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    114         inline bool setValue(const bool& value)                 { return !(bHasDefaultValue_ = !ConvertValue<bool                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    115         inline bool setValue(      void* const& value)          { return !(bHasDefaultValue_ = !ConvertValue<void*               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    116         inline bool setValue(const std::string& value)          { return !(bHasDefaultValue_ = !ConvertValue<std::string         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    117         inline bool setValue(const orxonox::Vector2& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector2    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    118         inline bool setValue(const orxonox::Vector3& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector3    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    119         inline bool setValue(const orxonox::Vector4& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector4    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    120         inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !ConvertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    121         inline bool setValue(const orxonox::Quaternion& value)  { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    122         inline bool setValue(const orxonox::Radian& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Radian     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    123         inline bool setValue(const orxonox::Degree& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Degree     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     78        inline bool getValue(char*                 value) const { return convertValue<T, char                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     79        inline bool getValue(unsigned char*        value) const { return convertValue<T, unsigned char       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     80        inline bool getValue(short*                value) const { return convertValue<T, short               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     81        inline bool getValue(unsigned short*       value) const { return convertValue<T, unsigned short      >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     82        inline bool getValue(int*                  value) const { return convertValue<T, int                 >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     83        inline bool getValue(unsigned int*         value) const { return convertValue<T, unsigned int        >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     84        inline bool getValue(long*                 value) const { return convertValue<T, long                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     85        inline bool getValue(unsigned long*        value) const { return convertValue<T, unsigned long       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     86        inline bool getValue(long long*            value) const { return convertValue<T, long long           >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     87        inline bool getValue(unsigned long long*   value) const { return convertValue<T, unsigned long long  >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     88        inline bool getValue(float*                value) const { return convertValue<T, float               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     89        inline bool getValue(double*               value) const { return convertValue<T, double              >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     90        inline bool getValue(long double*          value) const { return convertValue<T, long double         >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     91        inline bool getValue(bool*                 value) const { return convertValue<T, bool                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     92        inline bool getValue(void**                value) const { return convertValue<T, void*               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     93        inline bool getValue(std::string*          value) const { return convertValue<T, std::string         >(value, value_, zeroise<std::string>         ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     94        inline bool getValue(orxonox::Vector2*     value) const { return convertValue<T, orxonox::Vector2    >(value, value_, zeroise<orxonox::Vector2>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     95        inline bool getValue(orxonox::Vector3*     value) const { return convertValue<T, orxonox::Vector3    >(value, value_, zeroise<orxonox::Vector3>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     96        inline bool getValue(orxonox::Vector4*     value) const { return convertValue<T, orxonox::Vector4    >(value, value_, zeroise<orxonox::Vector4>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     97        inline bool getValue(orxonox::ColourValue* value) const { return convertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     98        inline bool getValue(orxonox::Quaternion*  value) const { return convertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     99        inline bool getValue(orxonox::Radian*      value) const { return convertValue<T, orxonox::Radian     >(value, value_, zeroise<orxonox::Radian>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     100        inline bool getValue(orxonox::Degree*      value) const { return convertValue<T, orxonox::Degree     >(value, value_, zeroise<orxonox::Degree>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     101
     102        inline bool setValue(const char& value)                 { return !(bHasDefaultValue_ = !convertValue<char                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     103        inline bool setValue(const unsigned char& value)        { return !(bHasDefaultValue_ = !convertValue<unsigned char       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     104        inline bool setValue(const short& value)                { return !(bHasDefaultValue_ = !convertValue<short               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     105        inline bool setValue(const unsigned short& value)       { return !(bHasDefaultValue_ = !convertValue<unsigned short      , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     106        inline bool setValue(const int& value)                  { return !(bHasDefaultValue_ = !convertValue<int                 , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     107        inline bool setValue(const unsigned int& value)         { return !(bHasDefaultValue_ = !convertValue<unsigned int        , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     108        inline bool setValue(const long& value)                 { return !(bHasDefaultValue_ = !convertValue<long                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     109        inline bool setValue(const unsigned long& value)        { return !(bHasDefaultValue_ = !convertValue<unsigned long       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     110        inline bool setValue(const long long& value)            { return !(bHasDefaultValue_ = !convertValue<long long           , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     111        inline bool setValue(const unsigned long long& value)   { return !(bHasDefaultValue_ = !convertValue<unsigned long long  , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     112        inline bool setValue(const float& value)                { return !(bHasDefaultValue_ = !convertValue<float               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     113        inline bool setValue(const double& value)               { return !(bHasDefaultValue_ = !convertValue<double              , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     114        inline bool setValue(const long double& value)          { return !(bHasDefaultValue_ = !convertValue<long double         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     115        inline bool setValue(const bool& value)                 { return !(bHasDefaultValue_ = !convertValue<bool                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     116        inline bool setValue(      void* const& value)          { return !(bHasDefaultValue_ = !convertValue<void*               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     117        inline bool setValue(const std::string& value)          { return !(bHasDefaultValue_ = !convertValue<std::string         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     118        inline bool setValue(const orxonox::Vector2& value)     { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector2    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     119        inline bool setValue(const orxonox::Vector3& value)     { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector3    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     120        inline bool setValue(const orxonox::Vector4& value)     { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector4    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     121        inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     122        inline bool setValue(const orxonox::Quaternion& value)  { return !(bHasDefaultValue_ = !convertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     123        inline bool setValue(const orxonox::Radian& value)      { return !(bHasDefaultValue_ = !convertValue<orxonox::Radian     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     124        inline bool setValue(const orxonox::Degree& value)      { return !(bHasDefaultValue_ = !convertValue<orxonox::Degree     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    124125
    125126        inline operator char()                 const { return getConvertedValue<T, char>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
     
    194195        saveAndIncrease( this->value_.z, mem );
    195196        saveAndIncrease( this->value_.w, mem );
    196     }template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const
     197    }
     198    template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const
    197199    {
    198200        return 4*returnSize(this->value_.x);
  • code/trunk/src/util/OutputBuffer.cc

    r2710 r3196  
    4444    void OutputBuffer::registerListener(OutputBufferListener* listener)
    4545    {
    46         this->listeners_.insert(this->listeners_.end(), listener);
     46        this->listeners_.push_back(listener);
    4747    }
    4848
     
    5353    void OutputBuffer::unregisterListener(OutputBufferListener* listener)
    5454    {
    55         for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
     55        for (std::vector<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
    5656        {
    5757            if ((*it) == listener)
    58                 this->listeners_.erase(it++);
     58                it = this->listeners_.erase(it);
    5959            else
    6060                ++it;
     
    127127    void OutputBuffer::callListeners()
    128128    {
    129         for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
     129        for (std::vector<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
    130130            (*it)->outputChanged();
    131131    }
  • code/trunk/src/util/OutputBuffer.h

    r2171 r3196  
    4343#define _OutputBuffer_H__
    4444
    45 #include <list>
     45#include "UtilPrereqs.h"
     46
     47#include <vector>
    4648#include <sstream>
    47 #include <iostream>
    48 
    49 #include "UtilPrereqs.h"
    5049
    5150namespace orxonox
     
    167166            void callListeners();
    168167
    169             std::stringstream stream_;                   //!< The stringstream that stores the assigned text
    170             std::list<OutputBufferListener*> listeners_; //!< A list of all listeners
     168            std::stringstream stream_;                     //!< The stringstream that stores the assigned text
     169            std::vector<OutputBufferListener*> listeners_; //!< A list of all listeners
    171170    };
    172171}
  • code/trunk/src/util/OutputHandler.h

    r2710 r3196  
    6363
    6464            /** @brief Puts some text on the outstream. @param text The text */
    65             static inline std::string log(const std::string& text)
     65            static inline const std::string& log(const std::string& text)
    6666                { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; }
    6767
    6868            /** @brief Puts an error on the outstream. @param text The text */
    69             static inline std::string error(const std::string& text)
     69            static inline const std::string& error(const std::string& text)
    7070                { OutputHandler::getOutStream().setOutputLevel(1); OutputHandler::getOutStream().output(text + "\n"); return text; }
    7171
    7272            /** @brief Puts a warning on the outstream. @param text The text */
    73             static inline std::string warning(const std::string& text)
     73            static inline const std::string& warning(const std::string& text)
    7474                { OutputHandler::getOutStream().setOutputLevel(2); OutputHandler::getOutStream().output(text + "\n"); return text; }
    7575
    7676            /** @brief Puts an info on the outstream. @param text The text */
    77             static inline std::string info(const std::string& text)
     77            static inline const std::string& info(const std::string& text)
    7878                { OutputHandler::getOutStream().setOutputLevel(3); OutputHandler::getOutStream().output(text + "\n"); return text; }
    7979
    8080            /** @brief Puts some debug output on the outstream. @param text The text */
    81             static inline std::string debug(const std::string& text)
     81            static inline const std::string& debug(const std::string& text)
    8282                { OutputHandler::getOutStream().setOutputLevel(4); OutputHandler::getOutStream().output(text + "\n"); return text; }
    8383
  • code/trunk/src/util/SignalHandler.cc

    r3068 r3196  
    3333
    3434#include "SignalHandler.h"
    35 #include "Debug.h"
    3635
    3736#include <iostream>
    3837#include <cstdlib>
    3938#include <cstring>
     39#include "Debug.h"
    4040
    4141namespace orxonox
     
    209209      {
    210210        if (
    211           charsFound == 0 && byte == '(' ||
    212           charsFound == 1 && byte == 'g' ||
    213           charsFound == 2 && byte == 'd' ||
    214           charsFound == 3 && byte == 'b' ||
    215           charsFound == 4 && byte == ')' ||
    216           charsFound == 5 && byte == ' '
     211          (charsFound == 0 && byte == '(') ||
     212          (charsFound == 1 && byte == 'g') ||
     213          (charsFound == 2 && byte == 'd') ||
     214          (charsFound == 3 && byte == 'b') ||
     215          (charsFound == 4 && byte == ')') ||
     216          (charsFound == 5 && byte == ' ')
    217217            )
    218218              charsFound++;
     
    246246
    247247        if (
    248           charsFound == 0 && byte == '(' ||
    249           charsFound == 1 && byte == 'g' ||
    250           charsFound == 2 && byte == 'd' ||
    251           charsFound == 3 && byte == 'b' ||
    252           charsFound == 4 && byte == ')' ||
    253           charsFound == 5 && byte == ' '
     248          (charsFound == 0 && byte == '(') ||
     249          (charsFound == 1 && byte == 'g') ||
     250          (charsFound == 2 && byte == 'd') ||
     251          (charsFound == 3 && byte == 'b') ||
     252          (charsFound == 4 && byte == ')') ||
     253          (charsFound == 5 && byte == ' ')
    254254            )
    255255              charsFound++;
  • code/trunk/src/util/Sleep.cc

    r2774 r3196  
    2828
    2929/**
    30     @file
    31     @brief Implementation of three sleep functions.
     30@file
     31@brief
     32    Implementation of three sleep functions. Avoids including windows.h
    3233*/
    3334
     
    4344    {
    4445        if (microseconds < 1000)
    45             COUT(2) << "Warning: Windows can not sleep less than 1ms, ignoring" << std::endl;
     46            COUT(2) << "Warning: Windows cannot sleep less than 1ms, ignoring" << std::endl;
    4647        Sleep(microseconds / 1000);
    4748    }
  • code/trunk/src/util/Sleep.h

    r2773 r3196  
    2828
    2929/**
    30  @file
    31  @brief
    32     Functions for using sleep() and usleep() on windows.
     30@file
     31@brief
     32    Functions declarations to make the current thread sleep.
    3333 */
    3434
     
    4040namespace orxonox
    4141{
     42    //! Makes the thread sleep for a few @a microseconds
    4243    _UtilExport void usleep(unsigned long microseconds);
     44    //! Makes the thread sleep for a few @a milliseconds
    4345    _UtilExport void msleep(unsigned long milliseconds);
     46    //! Makes the thread sleep for a few @a seconds
    4447    _UtilExport void sleep (unsigned long seconds);
    4548}
  • code/trunk/src/util/String.cc

    r2662 r3196  
    3535
    3636#include <cctype>
    37 #include <iostream>
    38 
    3937#include "Convert.h"
    4038#include "Math.h"
  • code/trunk/src/util/String.h

    r2171 r3196  
    3636
    3737#include "UtilPrereqs.h"
    38 
    3938#include <string>
    40 #include <sstream>
    4139
    4240namespace orxonox
  • code/trunk/src/util/SubString.cc

    r3089 r3196  
    3939
    4040#include "SubString.h"
    41 #include <stdio.h>
     41#include <cstdio>
    4242
    4343namespace orxonox
  • code/trunk/src/util/UtilPrereqs.h

    r2710 r3196  
    6060// Forward declarations
    6161//-----------------------------------------------------------------------
     62namespace Ogre
     63{
     64    class Radian;
     65    class Degree;
     66    class Vector2;
     67    class Vector3;
     68    class Vector4;
     69    class Matrix3;
     70    class Matrix4;
     71    class Quaternion;
     72    class ColourValue;
     73}
     74
    6275namespace orxonox
    6376{
     77    using Ogre::Radian;
     78    using Ogre::Degree;
     79    using Ogre::Vector2;
     80    using Ogre::Vector3;
     81    using Ogre::Vector4;
     82    using Ogre::Matrix3;
     83    using Ogre::Matrix4;
     84    using Ogre::Quaternion;
     85    using Ogre::ColourValue;
     86
    6487    class Exception;
    6588    class ExprParser;
  • code/trunk/src/util/mbool.h

    r2662 r3196  
    3636    struct _UtilExport mbool
    3737    {
    38 //        friend Synchronisable::registerVariable<>()
    3938        public:
    4039            inline mbool(bool value = false)
Note: See TracChangeset for help on using the changeset viewer.