Browse Source

Merge remote-tracking branch 'github/master' into editor-terrain

# Conflicts:
#	Bin/Data/Textures/Editor/EditorIcons.png
#	bin/Data/Scripts/Editor.as
#	bin/Data/Scripts/Editor/EditorScene.as
#	bin/Data/Scripts/Editor/EditorUI.as
#	bin/Data/UI/EditorIcons.xml
luveti 9 years ago
parent
commit
4e87e746f2
100 changed files with 2148 additions and 2482 deletions
  1. 72 0
      .appveyor.yml
  2. 38 38
      .bash_helpers.sh
  3. 4 0
      .gitattributes
  4. 71 33
      .gitignore
  5. 381 40
      .travis.yml
  6. 49 0
      Android/AndroidManifest.xml
  7. 7 0
      Android/CopyData.bat
  8. 0 0
      Android/assets/.gitignore
  9. 0 0
      Android/build.xml
  10. 73 0
      Android/custom_rules.xml
  11. 14 0
      Android/project.properties
  12. 0 0
      Android/res/drawable-hdpi/icon.png
  13. 0 0
      Android/res/drawable-ldpi/icon.png
  14. 0 0
      Android/res/drawable-mdpi/icon.png
  15. 0 0
      Android/res/drawable/logo_large.png
  16. 7 11
      Android/res/layout/samples_list.xml
  17. 11 0
      Android/res/layout/samples_list_text_view.xml
  18. 20 0
      Android/res/layout/scripts_list.xml
  19. 1 0
      Android/res/values/strings.xml
  20. 5 5
      Android/src/com/github/urho3d/SampleLauncher.java
  21. 71 0
      Android/src/com/github/urho3d/ScriptPicker.java
  22. 41 7
      Android/src/com/github/urho3d/Urho3D.java
  23. 588 75
      Android/src/org/libsdl/app/SDLActivity.java
  24. 0 8
      Bin/ConvertModels.bat
  25. 0 262
      Bin/CoreData/Shaders/GLSL/Lighting.glsl
  26. 0 56
      Bin/CoreData/Shaders/GLSL/Samplers.glsl
  27. 0 119
      Bin/CoreData/Shaders/GLSL/Transform.glsl
  28. 0 65
      Bin/CoreData/Shaders/GLSL/Uniforms.glsl
  29. 0 44
      Bin/CoreData/Shaders/HLSL/Blur.hlsl
  30. 0 287
      Bin/CoreData/Shaders/HLSL/Lighting.hlsl
  31. 0 48
      Bin/CoreData/Shaders/HLSL/Samplers.hlsl
  32. 0 34
      Bin/CoreData/Shaders/HLSL/Shadow.hlsl
  33. 0 21
      Bin/CoreData/Shaders/HLSL/Skybox.hlsl
  34. 0 63
      Bin/CoreData/Shaders/HLSL/Transform.hlsl
  35. 0 59
      Bin/CoreData/Shaders/HLSL/Uniforms.hlsl
  36. 0 9
      Bin/CoreData/Techniques/DiffAOAlphaMask.xml
  37. 0 9
      Bin/CoreData/Techniques/DiffNormalAOAlphaMask.xml
  38. 0 10
      Bin/CoreData/Techniques/DiffNormalAlphaMask.xml
  39. 0 10
      Bin/CoreData/Techniques/DiffNormalPacked.xml
  40. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedAO.xml
  41. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedAOAlpha.xml
  42. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedAOAlphaMask.xml
  43. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedAlpha.xml
  44. 0 10
      Bin/CoreData/Techniques/DiffNormalPackedAlphaMask.xml
  45. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedEmissive.xml
  46. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedEmissiveAlpha.xml
  47. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedEnvCube.xml
  48. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedEnvCubeAlpha.xml
  49. 0 10
      Bin/CoreData/Techniques/DiffNormalPackedSpec.xml
  50. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedSpecAO.xml
  51. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedSpecAOAlpha.xml
  52. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedSpecAOAlphaMask.xml
  53. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedSpecAlpha.xml
  54. 0 10
      Bin/CoreData/Techniques/DiffNormalPackedSpecAlphaMask.xml
  55. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedSpecEmissive.xml
  56. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedSpecEmissiveAlpha.xml
  57. 0 9
      Bin/CoreData/Techniques/DiffNormalSpecAOAlphaMask.xml
  58. 0 10
      Bin/CoreData/Techniques/DiffNormalSpecAlphaMask.xml
  59. 0 10
      Bin/CoreData/Techniques/DiffSpecAlphaMask.xml
  60. 0 10
      Bin/CoreData/Techniques/NoTextureNormalPacked.xml
  61. 0 5
      Bin/CoreData/Techniques/NoTextureNormalPackedAlpha.xml
  62. 0 3
      Bin/CoreData/Techniques/NoTextureVColAdd.xml
  63. 0 3
      Bin/CoreData/Techniques/NoTextureVColAddAlpha.xml
  64. 0 3
      Bin/CoreData/Techniques/NoTextureVColMultiply.xml
  65. 0 8
      Bin/CoreData/Techniques/VegetationDiffUnlitAlphaMask.xml
  66. 0 563
      Bin/Data/LuaScripts/TestScene.lua
  67. BIN
      Bin/Data/Models/Box.mdl
  68. BIN
      Bin/Data/Models/Cone.mdl
  69. BIN
      Bin/Data/Models/Cylinder.mdl
  70. BIN
      Bin/Data/Models/Jack.mdl
  71. BIN
      Bin/Data/Models/Jack_Walk.ani
  72. BIN
      Bin/Data/Models/Plane.mdl
  73. BIN
      Bin/Data/Models/Pyramid.mdl
  74. BIN
      Bin/Data/Models/Sphere.mdl
  75. BIN
      Bin/Data/Models/Torus.mdl
  76. BIN
      Bin/Data/Textures/Editor/EditorIcons.png
  77. BIN
      Bin/Data/Textures/OldUI.png
  78. 0 5
      Bin/Data/Textures/OldUI.xml
  79. BIN
      Bin/Data/Textures/UI.png
  80. 0 66
      Bin/Data/UI/EditorHierarchyWindow.xml
  81. 0 259
      Bin/Data/UI/OldStyle.xml
  82. BIN
      Bin/Data/Urho2D/GoldIcon.png
  83. 0 10
      Bin/Data/Urho2D/GoldIcon.xml
  84. BIN
      Bin/Data/Urho2D/GoldIcon/3.png
  85. 0 15
      Bin/Data/Urho2D/imp/imp.xml
  86. BIN
      Bin/Data/Urho2D/imp/imp_all.png
  87. 0 9
      Bin/Editor.bat
  88. 0 6
      Bin/Editor.sh
  89. 0 3
      Bin/Extra/.gitignore
  90. 0 19
      Bin/UpdateDocument.bat
  91. 0 17
      Bin/UpdateDocument.sh
  92. 25 0
      CMake/Modules/AdjustPkgConfigForMSVC.cmake
  93. 164 0
      CMake/Modules/CheckCompilerToolchain.cmake
  94. 89 0
      CMake/Modules/CheckHost.cmake
  95. 6 8
      CMake/Modules/CheckUrho3DLibrary.cpp
  96. 45 0
      CMake/Modules/FindDirectFB.cmake
  97. 239 0
      CMake/Modules/FindDirectX.cmake
  98. 36 0
      CMake/Modules/FindEsound.cmake
  99. 45 0
      CMake/Modules/FindFusionSound.cmake
  100. 46 0
      CMake/Modules/FindMir.cmake

+ 72 - 0
.appveyor.yml

@@ -0,0 +1,72 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+version: '{build}'
+platform:
+  - x86
+  - x64
+clone_depth: 50
+environment:
+  GIT_NAME:
+    secure: onlJNy/nGFT1GXNdusL4jokojSPZ732EFaXwdhPnpM0=
+  GIT_EMAIL:
+    secure: RdTdiZIl3fnggJFH8JhmqT2TAg/23ENX/4sFCrJfQ3s=
+  GH_TOKEN:
+    secure: VP9a1Mu28nO7cN+RVyccA9bNvIG92pGQ0zgFjTIds62In6BdiIxj3FgIb8G3XR0K
+  SF_KEY:
+    secure: JgsjFoVAP5yjNxyS/+S+4byhtnTKCWfI3bkCmHws3P1MwSaUS5+0C6WV1pHIJTVW00Qvo3+JsgVqMYUJ7fo2m/bXvUPNCoSa4BifXZlS6bE=
+  SF_API:
+    secure: cc1q9CXo5BwIYqtgigHpkCGG90zEVM45xx/YzXTOjVp512oQNUzTJq0AmxEYXP78
+# Using neither-in-nor-out-of-source (Urho3D-legacy) build tree when on AppVeyor; using out-of-source (and in-the-source) build tree when on Travis-CI for test coverage
+  build_tree: Build
+  config: Release
+# We cannot afford to have a large matrix on AppVeyor at the moment
+  URHO3D_D3D11: 1
+  matrix:
+    - URHO3D_LIB_TYPE: STATIC
+    - URHO3D_LIB_TYPE: SHARED
+install:
+  - rake ci_timer
+  - ps: if ($env:APPVEYOR_REPO_TAG -eq "true") { $env:RELEASE_TAG = $env:APPVEYOR_REPO_TAG_NAME };
+        if ($env:RELEASE_TAG -or ($env:APPVEYOR_REPO_BRANCH -eq "master" -and (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and (select-string '\[ci package\]' -inputobject $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED))))
+        {
+          $env:PACKAGE_UPLOAD = "1";
+          if ($env:URHO3D_LIB_TYPE -eq "STATIC" -and ($env:Platform -eq "x64")) { $env:SF_DEFAULT = "windows:Windows-64bit-STATIC-3D11.zip" };
+          do { "Installing doxygen and graphviz..."; choco install doxygen.portable graphviz.portable >$null } until ($?);
+        }
+        else
+        {
+          iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))
+        }
+build_script:
+  - ps: $env:COMMIT_MESSAGE = $(git log --format=%B -n 1 $env:APPVEYOR_REPO_COMMIT)
+  - if "%PLATFORM%" == "x64" set "URHO3D_64BIT=1"
+# Our free AppVeyor account is slow for normal daily CI, speed up the build a little bit by excluding Assimp and other tools in the normal build and use the Debug build configuration instead
+  - if "%PACKAGE_UPLOAD%" == "" set "URHO3D_TOOLS=0" && set "config=Debug"
+  - rake ci && if "%PACKAGE_UPLOAD%" == "1" rake ci_package_upload
+  - rake ci_timer
+test: off
+artifacts:
+  - path: Build\*.zip
+deploy: off
+
+# vi: set ts=2 sw=2 expandtab:

+ 38 - 38
.bash_helpers.sh

@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008-2014 the Urho3D project.
+# Copyright (c) 2008-2016 the Urho3D project.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -20,33 +20,30 @@
 # THE SOFTWARE.
 #
 
-# Define helpers
-msg() {
-    echo -e "\n$1\n================================================================================"
-}
+# Detect markers in the build tree
+if [ -f "$BUILD"/.fix-scm ]; then FIX_SCM=1; fi
 
+# Define helpers
 post_cmake() {
-    if [ $GENERATOR == "Eclipse CDT4 - Unix Makefiles" ]; then
-        # Integrate Urho3D documentation into Eclipse IDE
-        ln -snf $(pwd)/Docs/html ~/.eclipse/$(ls -1t ~/.eclipse |grep org.eclipse.platform_ |head -1)/plugins
-
+    if [ $ECLIPSE ]; then
         # Check if xmlstarlet software package is available for fixing the generated Eclipse project setting
+        if xmlstarlet --version >/dev/null 2>&1; then HAS_XMLSTARLET=1; fi
         if [ $HAS_XMLSTARLET ]; then
             # Common fixes for all builds
             #
-            # Remove build type from project name
+            # Remove build configuration from project name
             # Replace deprecated GNU gmake Error Parser with newer version (6.0 -> 7.0) and add GCC Error Parser
             #
             xmlstarlet ed -P -L \
                 -u "/projectDescription/name/text()" -x "concat(substring-before(., '-Release'), substring-before(., '-Debug'), substring-before(., '-RelWithDebInfo'))" \
                 -u "/projectDescription/buildSpec/buildCommand/arguments/dictionary/value[../key/text() = 'org.eclipse.cdt.core.errorOutputParser']" -x "concat('org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;', substring-after(., 'org.eclipse.cdt.core.MakeErrorParser'))" \
-                $1/.project
+                "$BUILD"/.project
 
             # Build-specific fixes
-            if [ $1 == "android-Build" ]; then
+            if [ $ANDROID ]; then
                 # For Android build, add the Android and Java nature to the project setting as it would be done by Eclipse during project import
-                # This fix avoids the step to reimport the project everytime the Eclipse project setting is regenerated by cmake_gcc.sh invocation
-                echo -- Add Android and Java nature to Eclipse project setting files in $( pwd )/$1
+                # This fix avoids the step to reimport the project everytime the Eclipse project setting is regenerated by cmake_generic.sh invocation
+                echo -- post_cmake: Add Android and Java nature to Eclipse project setting files in $BUILD
 
                 #
                 # Add natures (Android nature must be inserted as first nature)
@@ -54,7 +51,7 @@ post_cmake() {
                 xmlstarlet ed -P -L \
                     -i "/projectDescription/natures/nature[1]" -t elem -n nature -v "com.android.ide.eclipse.adt.AndroidNature" \
                     -s "/projectDescription/natures" -t elem -n nature -v "org.eclipse.jdt.core.javanature" \
-                    $1/.project
+                    "$BUILD"/.project
                 #
                 # Add build commands
                 #
@@ -64,48 +61,51 @@ post_cmake() {
                         -s "/projectDescription/buildSpec/buildCommandNew" -t elem -n name -v $c \
                         -s "/projectDescription/buildSpec/buildCommandNew" -t elem -n arguments -v "" \
                         -r "/projectDescription/buildSpec/buildCommandNew" -v "buildCommand" \
-                        $1/.project
+                        "$BUILD"/.project
                 done
+            fi
 
-            elif [ $1 == "raspi-Build" ]; then
-                # For Raspberry Pi build, add [Bin-CC] linked resource
-                #
-                # Replace [Subprojects]/Urho3D linked resource to [Targets]/[Bin-CC] instead
-                #
-                xmlstarlet ed -P -L \
-                    -u "/projectDescription/linkedResources/link/name/text()[. = '[Subprojects]/Urho3D']" -v "[Targets]/[Bin-CC]" \
-                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Targets]/[Bin-CC]']" -v "$( pwd )/Bin-CC" \
-                    $1/.project
-
-            else
-                # For native build, move the Eclipse project setting files back to Source folder to fix source code versioning
-                echo -- Eclipse project setting files have been relocated to: $( pwd )/Source
-                for f in .project .cproject; do mv $1/$f Source; done
+            if [ $FIX_SCM ]; then
+                # Copy the Eclipse project setting files to Source tree in order to fix it so that Eclipse's SCM feature works again
+                echo -- post_cmake: Move Eclipse project setting files to $SOURCE and fix them to reenable Eclipse SCM feature
+                # Leave the original copy in the build tree
+                for f in .project .cproject; do cp "$BUILD"/$f "$SOURCE"; done
+                # Set a marker in the build tree that Eclipse project has been fixed
+                touch "$BUILD"/.fix-scm
 
                 #
                 # Replace [Source directory] linked resource to [Build] instead
                 # Modify build argument to first change directory to Build folder
-                # Replace [Subprojects]/Urho3D linked resource to [Build]/[Bin] instead
+                # Remove [Subprojects]/Urho3D linked resource
                 #
                 xmlstarlet ed -P -L \
                     -u "/projectDescription/linkedResources/link/name/text()[. = '[Source directory]']" -v "[Build]" \
-                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Build]']" -v "$( pwd )/$1" \
-                    -u "/projectDescription/buildSpec/buildCommand/arguments/dictionary/value[../key/text() = 'org.eclipse.cdt.make.core.build.arguments']" -x "concat('-C ../$1 ', .)" \
-                    -u "/projectDescription/linkedResources/link/name/text()[. = '[Subprojects]/Urho3D']" -v "[Build]/[Bin]" \
-                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Build]/[Bin]']" -v "$( pwd )/Bin" \
-                    Source/.project
+                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Build]']" -v "`cd $BUILD; pwd`" \
+                    -u "/projectDescription/buildSpec/buildCommand/arguments/dictionary/value[../key/text() = 'org.eclipse.cdt.make.core.build.arguments']" -x "concat('-C $BUILD ', .)" \
+                    -d "/projectDescription/linkedResources/link[./name = '[Subprojects]/Urho3D']" \
+                    "$SOURCE"/.project
                 #
                 # Fix source path entry to Source folder and modify its filter condition
                 # Fix output path entry to [Build] linked resource and modify its filter condition
                 #
                 xmlstarlet ed -P -L \
                     -u "/cproject/storageModule/cconfiguration/storageModule/pathentry[@kind = 'src']/@path" -v "" \
-                    -s "/cproject/storageModule/cconfiguration/storageModule/pathentry[@kind = 'src']" -t attr -n "excluding" -v "[Subprojects]/|[Targets]/" \
+                    -s "/cproject/storageModule/cconfiguration/storageModule/pathentry[@kind = 'src']" -t attr -n "excluding" -v "[Build]/|[Subprojects]/|[Targets]/|Docs/AngelScriptAPI.h" \
                     -u "/cproject/storageModule/cconfiguration/storageModule/pathentry[@kind = 'out']/@path" -v "[Build]" \
                     -u "/cproject/storageModule/cconfiguration/storageModule/pathentry[@kind = 'out']/@excluding" -x "substring-after(., '[Source directory]/|')" \
-                    Source/.cproject
+                    "$SOURCE"/.cproject
             fi
         fi
+    elif [ -e "$BUILD"/*.xcodeproj/project.pbxproj ] && perl -v >/dev/null 2>&1; then
+        echo -- post_cmake: Fix generated Xcode project
+        # Temporary workaround to fix file references being added into multiple groups warnings (CMake bug https://www.cmake.org/Bug/view.php?id=15272, stil exists in 3.1)
+        perl -i -pe 'BEGIN {$/=undef} s/(Begin PBXGroup section.*?\/\* Sources \*\/,).*?,/\1/s' "$BUILD"/*.xcodeproj/project.pbxproj
+        # Speed up build for Debug build configuration by building only active arch (currently this is not doable via CMake generator-expression as it only works for individual target instead of global)
+        perl -i -pe 'BEGIN {$/=undef} s/(Debug \*\/ = {[^}]+?)SDKROOT/\1ONLY_ACTIVE_ARCH = YES; SDKROOT/s' "$BUILD"/*.xcodeproj/project.pbxproj
+        # Speed up build for Debug build configuration by skipping dSYM file generation
+        if [ $IOS ]; then
+            perl -i -pe 'BEGIN {$/=undef} s/(Debug \*\/ = {[^}]+?)SDKROOT/\1DEBUG_INFORMATION_FORMAT = dwarf; SDKROOT/s' "$BUILD"/*.xcodeproj/project.pbxproj
+        fi
     fi
 }
 

+ 4 - 0
.gitattributes

@@ -0,0 +1,4 @@
+Docs/* linguist-documentation
+Source/ThirdParty/* linguist-vendored
+bin/Data/Fonts/* linguist-vendored
+*.h linguist-language=C++

+ 71 - 33
.gitignore

@@ -1,25 +1,33 @@
-# Build directories
-Build/
-*-Build/
-
 # Output directories
-Bin/*
-!Bin/**/
-!Bin/*.bat
-!Bin/*.sh
-Bin/*.app/
-Bin/*.app.dSYM/
-Bin/Data/LuaScripts/jit/
-Bin/Screenshots
-*-Bin/
-Lib/
-*-Lib/
+/bin/*
+!/bin/**/
+!/bin/*.bat
+!/bin/*.sh
+/bin/*.app/
+/bin/*.app.dSYM/
+/bin/jit/
+/bin/Screenshots/
+/bin/tool/
+/include/
+/lib*/
+generated/
+/Source/Urho3D/tolua++-prefix/
+
+# Output files
+/Source/**/*.a
+/Source/ThirdParty/LuaJIT/src/host/buildvm
+/Source/ThirdParty/LuaJIT/src/host/buildvm_arch.h
+/Source/ThirdParty/LuaJIT/src/host/minilua
+/Source/Urho3D/Precompiled.cpp
+/Source/Urho3D/Urho3D.h
+/Source/Urho3D/Urho3D.pc
+/Source/Urho3D/Urho3D.pc.msvc
+/Source/Urho3D/Urho3DAll.h
+/Source/Urho3D/librevision.h
 
 # Compiled shaders
-*.vs2
-*.vs3
-*.ps2
-*.ps3
+*.vs?
+*.ps?
 
 # Compiled AngelScript
 *.asc
@@ -28,31 +36,60 @@ Lib/
 *.luc
 
 # Generated documentation
-Docs/html/
-Docs/Doxyfile
-Docs/minimal-*
+/Docs/html/
+/Docs/qch/
 
 # Eclipse project settings
-Source/.*project
-Source/.settings
+/.*project
+/.settings
+
+# KDevelop project settings
+/*.kdev?
+
+# Qt Creator project settings
+/CMakeLists.txt.user
+
+# JetBrains IDE project settings
+/.idea/
+/cmake-build-*/
 
-# Android in-the-source project settings
-Source/Android/project.properties
-Source/Android/local.properties
-Source/Android/proguard-project.txt
+# Code::Blocks project settings
+/*.cbp
 
-# Android in-the-source build and output directories
-Source/Android/Engine
-Source/Android/ThirdParty
-Source/Android/libs
+# Codelite project settings
+/*.project
+/*.workspace
 
-# Android in-the-source CMake build files
+# Android project settings
+/Android/local.properties
+
+# Android output directories
+/Android/Urho3D/
+/Android/ThirdParty/
+/Android/libs/
+
+# CMake generated build files
 CMakeCache.txt
 CMakeFiles/
 CMakeScripts/
 Makefile
 cmake_install.cmake
 install_manifest.txt
+CPackConfig.cmake
+CPackSourceConfig.cmake
+CTestTestfile.cmake
+/Source/**/*.cmake
+!/Source/ThirdParty/SDL/cmake/*.cmake
+/Docs/**/*.cmake
+
+# Precompiled header files
+*.gch/
+*.pch/
+*.pch.*
+
+# Custom rake tasks
+/.rake/
+.rake_t_cache
 
 # Misc.
 configure*
@@ -62,3 +99,4 @@ configure*
 *.log
 *.bak
 Thumbs.db
+.directory

+ 381 - 40
.travis.yml

@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008-2014 the Urho3D project.
+# Copyright (c) 2008-2016 the Urho3D project.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -20,51 +20,392 @@
 # THE SOFTWARE.
 #
 
+---
+
+language: cpp
+compiler: gcc
+cache: ccache
+sudo: false
+addons: {apt: {sources: &default_sources [george-edison55-precise-backports, kubuntu-backports], packages: &default_packages [cmake, doxygen, graphviz]}}
+env:
+  global:
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
+    - numjobs=4
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=100M
+    - URHO3D_DEPLOYMENT_TARGET=generic
+matrix:
+  fast_finish: true
+  exclude:
+    - compiler: gcc
+  include:
+    - &Linux-64bit
+      addons: {apt: {sources: [*default_sources, ubuntu-toolchain-r-test], packages: [g++-4.9, &linux_packages [*default_packages, libasound2-dev, libpulse-dev, rpm]]}}
+      env: LINUX=1 URHO3D_LIB_TYPE=STATIC URHO3D_UPDATE_SOURCE_TREE=1 COVERITY_SCAN_THRESHOLD=100 SF_DEFAULT=linux:Linux-64bit-STATIC.tar.gz
+    - &Linux-64bit-shared
+      addons: {apt: {sources: *default_sources, packages: *linux_packages}}
+      env: LINUX=1 URHO3D_LIB_TYPE=SHARED
+    - <<: *Linux-64bit-shared
+      compiler: clang
+      env: LINUX=1 URHO3D_LIB_TYPE=STATIC
+    - <<: *Linux-64bit-shared
+      compiler: clang
+    - &Linux-32bit
+      addons: {apt: {sources: *default_sources, packages: [*linux_packages, g++-multilib, "libxrandr-dev:i386", "libglapi-mesa:i386", "libgl1-mesa-glx:i386", "libgl1-mesa-dev:i386", "libxext-dev:i386", "libxrender-dev:i386", lib32readline6-dev]}}
+      env: LINUX=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0
+    - &Linux-32bit-shared
+      <<: *Linux-32bit
+      env: LINUX=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0
+    - <<: *Linux-32bit
+      compiler: clang
+    - <<: *Linux-32bit-shared
+      compiler: clang
+    - &MinGW-64bit
+      compiler: x86_64-w64-mingw32-gcc
+      addons: {apt: {sources: *default_sources, packages: [*default_packages, gcc-mingw-w64-x86-64, g++-mingw-w64-x86-64, binutils-mingw-w64-x86-64]}}
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC
+    - <<: *MinGW-64bit
+      compiler: x86_64-w64-mingw32-gcc
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED
+    - <<: *MinGW-64bit
+      compiler: x86_64-w64-mingw32-gcc
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_OPENGL=0
+    - <<: *MinGW-64bit
+      compiler: x86_64-w64-mingw32-gcc
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_OPENGL=0
+    # Ubuntu 12.04 LTS does not have up-to-date D3D11 headers, disable the CI build jobs for D3D11 for now until Travis-CI upgrades their OS to 14.04 LTS or better (We may not need these anymore because now we already have CI jobs on AppVeyor to cover the D3D11 build)
+    # <<: *MinGW-64bit
+    # compiler: x86_64-w64-mingw32-gcc
+    # env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_D3D11=1
+    # <<: *MinGW-64bit
+    # compiler: x86_64-w64-mingw32-gcc
+    # env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_D3D11=1
+    - &MinGW-32bit
+      compiler: i686-w64-mingw32-gcc
+      addons: {apt: {sources: *default_sources, packages: [*default_packages, gcc-mingw-w64-i686, g++-mingw-w64-i686, binutils-mingw-w64-i686]}}
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0
+    - <<: *MinGW-32bit
+      compiler: i686-w64-mingw32-gcc
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0
+    - <<: *MinGW-32bit
+      compiler: i686-w64-mingw32-gcc
+      env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0 URHO3D_OPENGL=0
+    - <<: *MinGW-32bit
+      compiler: i686-w64-mingw32-gcc
+      env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0 URHO3D_OPENGL=0
+    # <<: *MinGW-32bit
+    # compiler: i686-w64-mingw32-gcc
+    # env: WIN32=1 URHO3D_LIB_TYPE=STATIC URHO3D_64BIT=0 URHO3D_D3D11=1
+    # <<: *MinGW-32bit
+    # compiler: i686-w64-mingw32-gcc
+    # env: WIN32=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0 URHO3D_D3D11=1
+before_script:
+  - rake ci_timer
+  - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
+  - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
+  # Travis-CI has a special case handling for release tag where it checks out directly from the tag branch instead of the default 'master' branch
+  - if [ $RELEASE_TAG ] || ([ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]); then if [ ${TRAVIS_JOB_NUMBER##*.} == 1 ]; then export SITE_UPDATE=1; fi; if [ "$CC" == "gcc" ] && ([ $RELEASE_TAG ] || echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi; fi
+  - if [ $LINUX ]; then if [ "$URHO3D_64BIT" == "0" ]; then export CMAKE_PREFIX_PATH=/usr/lib/i386-linux-gnu; else export DISPLAY=:99.0; bash -e /etc/init.d/xvfb start; fi; fi
+  - if [ $WIN32 ]; then if [ "$URHO3D_64BIT" == "0" ]; then export ARCH=i686; else export ARCH=x86_64; fi && export MINGW_PREFIX=/usr/bin/${ARCH}-w64-mingw32; fi
+  # MinGW package on Ubuntu 12.04 LTS does not come with d3dcompiler.h file which is required by our CI build with URHO3D_OPENGL=0.
+  # Temporarily workaround the problem by downloading the missing header from Ubuntu 14.04 LTS source package.
+  - if [ $URHO3D_OPENGL ]; then mkdir -p ../Build/{,generated/{UsingBuildTree,UsingSDK}/}include/Urho3D/ThirdParty && wget -P ../Build/include/Urho3D/ThirdParty https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/mingw-w64/trusty/download/package-import%40ubuntu.com-20130624192537-vzn12bb7qd5w3iy8/d3dcompiler.h-20120402093420-bk10a737hzitlkgj-65/d3dcompiler.h && for d in UsingBuildTree UsingSDK; do bash -c "cd ../Build/generated/$d/include/Urho3D/ThirdParty && ln -s ../../../../../include/Urho3D/ThirdParty/d3dcompiler.h ."; done; fi
+  - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$PATH
+  - if [ $URHO3D_BINDINGS ]; then git clone --depth 1 https://github.com/urho3d/fastcomp-clang.git && export LLVM_CLANG_ROOT=$(pwd)/fastcomp-clang && export CXX=g++-4.9 CC=gcc-4.9 && for compiler in gcc g++; do ln -s $(which ccache) $HOME/$compiler-4.9; done && export PATH=$HOME:$PATH; fi
+  # For some reason clang compiler toolchain installation in Travis CI VM does not have symlink in the ccache symlinks directory, so workaround it
+  - if [ "$CC"  == "clang" ]; then ln -s $(which ccache) $HOME/clang && ln -s $(which ccache) $HOME/clang++ && export PATH=$HOME:$PATH; fi
+  - rake ci_setup_cache
+script: rake ci && if [ $SITE_UPDATE ]; then rake ci_site_update; fi && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload && if [ $LINUX ] && [ ! "$URHO3D_64BIT" == "0" ]; then rake ci_package_upload URHO3D_USE_LIB64_RPM=1; fi; fi && rake ci_timer
+after_script:
+  - rake ci_teardown_cache
+  - if [ ${TRAVIS_JOB_NUMBER##*.} == 1 ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then rake ci_create_mirrors; fi
+notifications: {email: {on_success: never, on_failure: change}}
+
+---
+
+branch: {name: Coverity-Scan, active: no, mandatory: yes}
+language: cpp
+compiler: gcc
+cache: ccache
+sudo: false
+addons:
+  apt:
+    packages: [libasound2-dev, libpulse-dev]
+  coverity_scan:
+    project:
+      name: urho3d/Urho3D
+      description: Urho3D is a free lightweight, cross-platform 2D and 3D game engine implemented in C++ and released under the MIT license. Greatly inspired by OGRE and Horde3D.
+    notification_email: [email protected]
+    build_command_prepend: rake cmake URHO3D_LUAJIT=1 URHO3D_LUAJIT_AMALG=1 URHO3D_SAMPLES=1 URHO3D_TOOLS=1 URHO3D_EXTRAS=1 URHO3D_DATABASE_SQLITE=1 URHO3D_LIB_TYPE=SHARED
+    build_command: rake make numjobs=4
+    branch_pattern: .*Coverity-Scan$
+env:
+  global:
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - secure: itgWNvH4Zj0hQpkUctVxMwJwVX3hIluVuvUbzO2XG7dxQaMMfcLGwVKgq8X1HOf4dJCUv5WL0jcSMWXbdc8tvqQJwBb5R2Z2JJYpTTAgtmLy7TNn6zgetZtGrYEJuTlxSItbS/NF4iPDO25ih7j5Ma0ffXRpBnlURQaytfYfFaQ=
+    - LINUX=1
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=100M
+before_script:
+  - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
+  - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
+  - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$PATH
+  - rake ci_setup_cache
+script: true
+after_script: rake ci_teardown_cache
+
+---
+
+branch: {name: Annotate, active: no}
+language: cpp
+compiler: gcc
+cache: ccache
+sudo: false
+addons: {apt: {sources: [kubuntu-backports, ubuntu-toolchain-r-test], packages: [cmake, g++-4.9, libasound2-dev, libpulse-dev]}}
+env:
+  global:
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - numjobs=4
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=100M
+before_script:
+  - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
+  - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
+  - git clone --depth 1 https://github.com/urho3d/fastcomp-clang.git && export LLVM_CLANG_ROOT=$(pwd)/fastcomp-clang
+  - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$PATH
+  - export CXX=g++-4.9 CC=gcc-4.9
+  - for compiler in gcc g++; do ln -s $(which ccache) $HOME/$compiler-4.9; done && export PATH=$HOME:$PATH
+  - rake ci_setup_cache
+script: rake ci_annotate
+after_script: rake ci_teardown_cache
+
+---
+
+branch: {name: Android-CI, active: yes}
+language: android
+cache: {directories: $HOME/.ccache}
+android: {components: [build-tools-22.0.1]}
+jdk: oraclejdk8
+sudo: false
+addons: {apt: {sources: &default_sources george-edison55-precise-backports, packages: &default_packages [doxygen, graphviz, g++-multilib]}}
 env:
   global:
-    - secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
-    - secure: AfoHc5tpnYoI2TVGUeE9Xdru+15pd5N4YzO7EWvwmMnrHtNO3retrmKOGpnIyfbP2BeWRTW/z+BI4G0RrfvubjHu2us4wRh6Jq8+UZohBBkM+ldTnyqYHX97q+6ScWBWZGg7dpthd1x/7fmds8dSRzustHUhI7RzPbWEMQH1DGI=
-    - DISPLAY=:99.0
-    - NUMJOBS=3
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
+    - numjobs=4
+    - ANDROID=1
+    - ANDROID_TMP=~/tmp
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=100M
   matrix:
-    - LINUX=1               URHO3D_64BIT=1 URHO3D_LIB_TYPE=STATIC SITE_UPDATE=1
-    - LINUX=1               URHO3D_64BIT=1 URHO3D_LIB_TYPE=SHARED
-    - WINDOWS=1 ARCH=x86_64 URHO3D_64BIT=1 URHO3D_LIB_TYPE=STATIC
-    - WINDOWS=1 ARCH=x86_64 URHO3D_64BIT=1 URHO3D_LIB_TYPE=SHARED
-    - LINUX=1                              URHO3D_LIB_TYPE=STATIC
-    - LINUX=1                              URHO3D_LIB_TYPE=SHARED
-    - WINDOWS=1 ARCH=i686                  URHO3D_LIB_TYPE=STATIC
-    - WINDOWS=1 ARCH=i686                  URHO3D_LIB_TYPE=SHARED
-    - ANDROID=1                            URHO3D_LIB_TYPE=STATIC
-    - ANDROID=1                            URHO3D_LIB_TYPE=SHARED
-    - RPI=1                                URHO3D_LIB_TYPE=STATIC
-    - RPI=1                                URHO3D_LIB_TYPE=SHARED
+    # x86 and x86_64 emulation currently requires hardware acceleration which Travis-CI cannot provide, so skip testing using AVD for now
+    - ANDROID_ABI=x86_64 ANDROID_TOOLCHAIN_NAME=x86_64-clang URHO3D_LIB_TYPE=STATIC INSTALL=sys-img-x86_64-android-21   # Using default native API level 21
+    - ANDROID_ABI=x86_64 ANDROID_TOOLCHAIN_NAME=x86_64-clang URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86_64-android-21
+    - ANDROID_ABI=x86    ANDROID_TOOLCHAIN_NAME=x86-clang URHO3D_LIB_TYPE=STATIC INSTALL=sys-img-x86-android-21 ANDROID_NATIVE_API_LEVEL=21  # 9 is the default but at least 12 is needed when LuaJIT is enabled
+    - ANDROID_ABI=x86    ANDROID_TOOLCHAIN_NAME=x86-clang URHO3D_LIB_TYPE=SHARED INSTALL=sys-img-x86-android-21 ANDROID_NATIVE_API_LEVEL=21
+    - ANDROID_ABI=armeabi-v7a ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang URHO3D_LIB_TYPE=STATIC          # Using default native API Level 9
+    - ANDROID_ABI=armeabi-v7a ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang URHO3D_LIB_TYPE=SHARED AVD=21
 matrix:
   fast_finish: true
-#  allow_failures:
-#    - env: RPI=1 URHO3D_LIB_TYPE=STATIC
-#    - env: RPI=1 URHO3D_LIB_TYPE=SHARED
+  include:
+    # ANDROID_ANDROID_ABI=arm64-v8a uses NEON by default, so the following two CI jobs also test NEON code path in the build
+    - addons: &newer_gcc {apt: {sources: [*default_sources, ubuntu-toolchain-r-test], packages: [*default_packages, g++-4.9]}}
+      env: ANDROID_ABI=arm64-v8a ANDROID_TOOLCHAIN_NAME=aarch64-linux-android-clang URHO3D_LIB_TYPE=STATIC NO_SDK_SYSIMG=1   # Using default native API level 21
+    - addons: {<<: *newer_gcc}
+      env: ANDROID_ABI=arm64-v8a ANDROID_TOOLCHAIN_NAME=aarch64-linux-android-clang URHO3D_LIB_TYPE=SHARED NO_SDK_SYSIMG=1
+before_script:
+  - rake ci_timer
+  - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
+  - export COMMIT_MESSAGE=$(git log --format=%B -n1 $TRAVIS_COMMIT)
+  - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
+  - if [ $RELEASE_TAG ] || (! [[ $TRAVIS_BRANCH =~ [^-]+-[^-]+-CI ]] && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi
+  - git clone --depth 1 --branch strip https://github.com/urho3d/android-ndk.git && export ANDROID_NDK=$(pwd)/android-ndk && if ([ $AVD ] || [ $PACKAGE_UPLOAD ]) && [ $INSTALL ]; then (while :; do echo 'y'; sleep 1; done) |android update sdk --no-ui --all --filter $INSTALL; fi
+  - if [ "$ANDROID_ABI" == "arm64-v8a" ]; then export PATH=$HOME:$PATH CXX=g++-4.9 CC=gcc-4.9 && for compiler in gcc g++; do ln -s $(which ccache) $HOME/$compiler-4.9; done; fi
+  - export C_PATH=$(pwd)/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin
+  - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$C_PATH:$PATH; for f in $C_PATH/{clang,clang++}; do touch -d "2015-01-01 00:00:00 +0800" $f; done
+  - rake ci_setup_cache
+script: rake ci && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi && rake ci_timer
+after_script: rake ci_teardown_cache
+
+---
+
+branch: {name: RPI-CI, active: yes}
 language: cpp
 compiler: gcc
-before_install:
-    - bash -c "[ '$TRAVIS_BRANCH' == 'master' ] && [ '$TRAVIS_PULL_REQUEST' == 'false' ]" && export ON_MASTER_COMMIT=1 && bash -c "[ $SITE_UPDATE ]" && export SITE_UPDATE_ON_MASTER_COMMIT=1 || true
-    - bash -c "[ $ON_MASTER_COMMIT ]" && export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT) && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]' && git fetch --depth=2000 --tags origin $TRAVIS_BRANCH && export PACKAGE_UPLOAD=1 || true
-    - bash -c "[ $ON_MASTER_COMMIT ]" && export RELEASE_TAG=$(git describe --tags --exact-match $TRAVIS_COMMIT 2>/dev/null) && bash -c "[ $RELEASE_TAG ]" && export PACKAGE_UPLOAD=1 || true
-    - bash -c "[ $ANDROID ]" && wget -q http://dl.google.com/android/ndk/android-ndk32-r10-linux-x86_64.tar.bz2 && tar xjf *.bz2 && rm *.bz2 && ln -s android-ndk* android-ndk && export ANDROID_NDK=$(pwd)/android-ndk && bash -c "[ $PACKAGE_UPLOAD ]" && wget -q http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz && tar xzf *.tgz && rm *.tgz && ln -s android-sdk* android-sdk && export ANDROID_SDK=$(pwd)/android-sdk || true
-    - bash -c "[ $RPI ]" && git clone --depth 1 https://github.com/raspberrypi/tools.git rpi-tools && export RASPI_TOOL=$(pwd)/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin && git clone --depth=1 https://github.com/urho3d/rpi-sysroot.git rpi-sysroot && export RASPI_ROOT=$(pwd)/rpi-sysroot || true
-    - bash -c "( [ $SITE_UPDATE_ON_MASTER_COMMIT ] || [ $PACKAGE_UPLOAD ] )" && travis_retry sudo add-apt-repository ppa:george-edison55/precise-backports -y || true
-    - travis_retry sudo apt-get update -q -y
-install:
-    - travis_retry sudo apt-get install -q -y --no-install-recommends libasound2-dev
-    - bash -c "[ x$URHO3D_64BIT == 'x' ]" && travis_retry sudo apt-get remove -q -y gvfs-daemons && travis_retry sudo apt-get install -q -y libxrandr-dev:i386 libglapi-mesa:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev:i386 libxext-dev:i386 libxrender-dev:i386 g++-multilib && export CMAKE_PREFIX_PATH=/usr/lib/i386-linux-gnu || true
-    - bash -c "( [ $SITE_UPDATE_ON_MASTER_COMMIT ] || [ $PACKAGE_UPLOAD ] )" && travis_retry sudo apt-get install -q -y --no-install-recommends doxygen graphviz || true
-    - bash -c "[ $WINDOWS ]" && travis_retry sudo apt-get install -q -y gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 binutils-mingw-w64 binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 && export MINGW_PREFIX=/usr/bin/${ARCH}-w64-mingw32 || true
-    - bash -c "( [ $LINUX ] || [ $RPI ] ) && [ $PACKAGE_UPLOAD ]" && travis_retry sudo apt-get install -q -y rpm || true
-    - bash -c "[ $ANDROID ] && [ $PACKAGE_UPLOAD ]" && (while :; do echo 'y'; sleep 1; done) |android-sdk/tools/android update sdk --no-ui --filter platform-tool,build-tools-20.0.0,android-19,system-image,extra-android-support || true
-    - bash -e /etc/init.d/xvfb start
-script: rake travis_ci
-after_success:
-    - bash -c "[ $SITE_UPDATE_ON_MASTER_COMMIT ]" && rake travis_ci_site_update && rake travis_ci_rebase
-    - bash -c "[ $PACKAGE_UPLOAD ]" && rake travis_ci_package_upload
+cache: ccache
+sudo: false
+addons: {apt: {sources: &default_sources george-edison55-precise-backports, packages: &default_packages [doxygen, graphviz, g++-multilib, rpm]}}
+env:
+  global:
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
+    - numjobs=4
+    - RPI=1
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=100M
+  matrix:
+    # RPI 1
+    - URHO3D_LIB_TYPE=STATIC
+    - URHO3D_LIB_TYPE=SHARED
+    # RPI 2/3
+    - URHO3D_LIB_TYPE=STATIC RPI_ABI='armeabi-v7a with NEON'
+    - URHO3D_LIB_TYPE=SHARED RPI_ABI='armeabi-v7a with NEON'
+matrix:
+  fast_finish: true
+before_script:
+  - rake ci_timer
+  - git clone --depth 1 https://github.com/raspberrypi/tools.git rpi-tools && export RPI_PREFIX=$(pwd)/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf && git clone --depth 1 https://github.com/urho3d/rpi-sysroot.git && export RPI_SYSROOT=$(pwd)/rpi-sysroot && for f in $RPI_PREFIX-{gcc,g++}; do touch -d "2015-01-01 00:00:00 +0800" $f; done
+  - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
+  - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
+  - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
+  - if [[ $RELEASE_TAG ]] || (! [[ $TRAVIS_BRANCH =~ [^-]+-[^-]+-CI ]] && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi
+  - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):${RPI_PREFIX%/*}:$PATH
+  - rake ci_setup_cache
+script: rake ci && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi && rake ci_timer
+after_script: rake ci_teardown_cache
+
+---
+
+branch: {name: ARM-CI, active: yes}
+language: cpp
+compiler: gcc
+cache: ccache
+sudo: false
+addons: {apt: {sources: &default_sources [george-edison55-precise-backports, kubuntu-backports], packages: &default_packages [cmake, doxygen, graphviz, g++-multilib, rpm]}}
+env:
+  global:
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
+    - numjobs=4
+    - ARM=1
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=100M
+  matrix:
+    # ODROID-X2
+    - SYSROOT=armhf-sysroot URHO3D_LIB_TYPE=STATIC ARM_ABI_FLAGS='-mcpu=cortex-a9 -mfpu=neon-fp16'
+    - SYSROOT=armhf-sysroot URHO3D_LIB_TYPE=SHARED ARM_ABI_FLAGS='-mcpu=cortex-a9 -mfpu=neon-fp16'
+matrix:
+  fast_finish: true
+  include:
+    # ODROID-C2
+    - addons: &newer_gcc {apt: {sources: [*default_sources, ubuntu-toolchain-r-test], packages: [*default_packages, g++-4.9]}}
+      env: SYSROOT=arm64-sysroot URHO3D_LIB_TYPE=STATIC ARM_ABI_FLAGS='-mcpu=cortex-a53'
+    - addons: {<<: *newer_gcc}
+      env: SYSROOT=arm64-sysroot URHO3D_LIB_TYPE=SHARED ARM_ABI_FLAGS='-mcpu=cortex-a53'
+before_script:
+  - rake ci_timer
+  - if [[ $SYSROOT =~ arm64 ]]; then wget https://releases.linaro.org/components/toolchain/binaries/latest-5/aarch64-linux-gnu/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu.tar.xz -O arm-tools.tar.xz && tar xf arm-tools.tar.xz && rm arm-tools.tar.xz && mv gcc-linaro* gcc-linaro && export ARM_PREFIX=$(pwd)/gcc-linaro/bin/aarch64-linux-gnu PATH=$HOME:$PATH CXX=g++-4.9 CC=gcc-4.9 && for compiler in gcc g++; do ln -s $(which ccache) $HOME/$compiler-4.9; done; fi
+  - if [[ $SYSROOT =~ armhf ]]; then wget https://releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz -O arm-tools.tar.xz && tar xf arm-tools.tar.xz && rm arm-tools.tar.xz && mv gcc-linaro* gcc-linaro && export ARM_PREFIX=$(pwd)/gcc-linaro/bin/arm-linux-gnueabihf; fi
+  - for f in $ARM_PREFIX-{gcc,g++}; do touch -d "2015-01-01 00:00:00 +0800" $f; done
+  - git clone --depth 1 https://github.com/urho3d/$SYSROOT.git && export ARM_SYSROOT=$(pwd)/$SYSROOT
+  - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
+  - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
+  - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
+  - if [[ $RELEASE_TAG ]] || (! [[ $TRAVIS_BRANCH =~ [^-]+-[^-]+-CI ]] && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi
+  - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):${ARM_PREFIX%/*}:$PATH
+  - rake ci_setup_cache
+script: rake ci && if [[ $PACKAGE_UPLOAD ]]; then rake ci_package_upload && if [[ "$SYSROOT" == "arm64-sysroot" ]]; then rake ci_package_upload URHO3D_USE_LIB64_RPM=1; fi; fi && rake ci_timer
+after_script: rake ci_teardown_cache
+
+---
+
+branch: {name: Web-CI, active: yes}
+language: cpp
+compiler: gcc
+cache: ccache
+sudo: false
+addons: {apt: {sources: [george-edison55-precise-backports, kubuntu-backports, ubuntu-toolchain-r-test], packages: [cmake, doxygen, graphviz, g++-4.9]}}
+env:
+  global:
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
+    - numjobs=2
+    - WEB=1
+    - EMSCRIPTEN_SHARE_DATA=1
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=100M
+  matrix:
+    - URHO3D_LIB_TYPE=STATIC
+    - URHO3D_LIB_TYPE=SHARED
+matrix:
+  fast_finish: true
+before_script:
+  - rake ci_timer
+  - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
+  - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
+  - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
+  - if [ $RELEASE_TAG ] || (! [[ $TRAVIS_BRANCH =~ [^-]+-[^-]+-CI ]] && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi
+  - export DISPLAY=:99.0; bash -e /etc/init.d/xvfb start
+  - git clone --depth 1 https://github.com/urho3d/emscripten-sdk.git && emscripten-sdk/emsdk activate --build=Release sdk-master-64bit && source emscripten-sdk/emsdk_env.sh
+  - export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$PATH; for f in $EMSCRIPTEN/{emcc,em++}; do touch -d "2015-09-01 00:00:00 +0800" $f; done
+  - rake ci_setup_cache
+script: rake ci && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload && if [ "$URHO3D_LIB_TYPE" == "SHARED" ]; then rake ci_emscripten_samples_update; fi; fi && rake ci_timer
+after_script: rake ci_teardown_cache
+
+---
+
+branch: {name: OSX-CI, active: yes, mandatory: yes}
+language: objective-c
+cache: {directories: $HOME/.ccache}
+osx_image: xcode8
+env:
+  global:
+    - secure: SLJCjkjDsTMbCIV9Wecz5JATnhk0fuzlnLMeZdvvFDv+8NL8cXyutkU0VfyRSLf3HSD1Js79a6fRMROyVGWj/w/BRrjqGnZzsB6+ZeJNnadiVIF5Gh+w90We5ccvSp2G4DyYgwkNnkKlJK7zNEWGu/K+bHL1EOCA+EIVrFMyA44=
+    - secure: ecj/PwpbHkH9AYFsc2TMeRuNm5E3xMM8A0x4AcGhzpwDuZWdFx3R1T4G9u45Z5aUyTJWGqOeX1JPaEVVFZuYnNBKRy0kmiUrM9EE0j7WsT57K48tP1ysn2ynyvHgbYkKOfYR0t8XAMWTBbulT9DVVk3DS69//2WgiXGDVUEJTyI=
+    - numjobs=3
+    - OSX=1
+    - USE_CCACHE=1
+    - CCACHE_SLOPPINESS=pch_defines,time_macros
+    - CCACHE_COMPRESS=1
+    - CCACHE_MAXSIZE=300M
+  matrix:
+    # MAKEFILE=1    URHO3D_LIB_TYPE=SHARED URHO3D_DEPLOYMENT_TARGET=generic
+    - XCODE=1       URHO3D_LIB_TYPE=STATIC CMAKE_OSX_DEPLOYMENT_TARGET=10.11 SF_DEFAULT=mac:OSX-64bit-STATIC.tar.gz
+    # XCODE=1       URHO3D_LIB_TYPE=SHARED CMAKE_OSX_DEPLOYMENT_TARGET=10.11
+    - XCODE=1 IOS=1 URHO3D_LIB_TYPE=STATIC IPHONEOS_DEPLOYMENT_TARGET=9.1 sdk=iphonesimulator
+matrix:
+  fast_finish: true
+before_script:
+  - rake ci_timer
+  - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
+  - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
+  - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
+  - if [[ $XCODE ]] && ([[ $RELEASE_TAG ]] || (! [[ $TRAVIS_BRANCH =~ [^-]+-[^-]+-CI ]] && echo $COMMIT_MESSAGE |grep -cq '\[ci package\]')); then export PACKAGE_UPLOAD=1; fi
+  - which cmake >/dev/null 2>&1 || cmake=cmake
+  - if [[ $PACKAGE_UPLOAD ]]; then doxygen='doxygen graphviz';
+      whitelist='brew-cask ccache cmake doxygen graphviz libpng libyaml md5deep openssl pkg-config readline';
+      for f in $(brew list); do [[ $whitelist =~ $f ]] || brew uninstall --force $f; done &&
+      for f in $(brew cask list |grep -v Uninstalling); do [[ $whitelist =~ $f ]] || brew cask uninstall --force $f; done &&
+      brew cleanup;
+    fi
+  - travis_retry brew install ccache $cmake $doxygen
+  - export PATH=$(brew info ccache |grep -o '\S*lib\S*'):$PATH
+  - if [ $XCODE ]; then pushd $(dirname $(xcodebuild -find-executable clang)) && sudo cp -p $(which ccache) . && for compiler in clang clang++; do sudo mv $compiler{,.orig} && sudo ln -sf $(pwd)/clang.orig /usr/local/bin/$compiler && sudo ln -sf ccache $compiler; done && popd && if [ $IOS ]; then redundant=AppleTV,Watch; elif [ $TVOS ]; then redundant=iPhone,Watch; else redundant=iPhone,AppleTV,Watch; fi && eval sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/{$redundant}{OS,Simulator}.platform; if echo $COMMIT_MESSAGE |egrep -cq '\[(ccache clear|xcode 64bit only)\]' || [[ $(ccache -s |grep 'files in cache' |rev |cut -d' ' -f1 |rev) == '0' ]]; then export XCODE_64BIT_ONLY=1; fi; fi
+  - rake ci_setup_cache
+script: rake ci && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi && rake ci_timer
+after_script: rake ci_teardown_cache
+
+# Below samples are excluded from Xcode/OSX build due to build time constraint
+data:
+  excluded_sample:
+    '#2': [42_PBRMaterials]
+    '#3': [42_PBRMaterials]
+
+...
 
 # vi: set ts=2 sw=2 expandtab:

+ 49 - 0
Android/AndroidManifest.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="com.github.urho3d"
+          android:versionCode="1"
+          android:versionName="1.0"
+          android:installLocation="auto">
+
+    <!-- Android 2.3.3 -->
+    <uses-sdk
+        android:minSdkVersion="10"
+        android:targetSdkVersion="12"/>
+
+    <!-- OpenGL ES 2.0 -->
+    <uses-feature android:glEsVersion="0x00020000"/>
+
+    <!-- Allow writing to external storage -->
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+
+    <!-- Allow opening network sockets -->
+    <uses-permission android:name="android.permission.INTERNET"/>
+
+    <application
+        android:label="@string/app_name"
+        android:icon="@drawable/icon"
+        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+        android:hardwareAccelerated="true"
+        android:allowBackup="false">
+        <activity
+            android:name=".SampleLauncher"
+            android:configChanges="keyboardHidden|orientation"
+            android:noHistory="true"
+            android:screenOrientation="portrait">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+        <activity
+            android:name=".Urho3D"
+            android:label="@string/app_name"
+            android:configChanges="keyboardHidden|orientation"
+            android:screenOrientation="landscape"/>
+        <activity
+            android:name=".ScriptPicker"
+            android:configChanges="keyboardHidden|orientation"
+            android:noHistory="true"
+            android:screenOrientation="portrait"/>
+    </application>
+</manifest>

+ 7 - 0
Android/CopyData.bat

@@ -0,0 +1,7 @@
+:: Only call this when using "Android" as build tree and the host system does not have the capability to create symbolic link
+
+md assets\Data
+xcopy ..\bin\Data\*.* assets\Data /S /E /C /Y
+md assets\CoreData
+xcopy ..\bin\CoreData\*.* assets\CoreData /S /E /C /Y
+rd /S /Q assets\CoreData\Shaders\HLSL

+ 0 - 0
Source/Android/assets/.gitignore → Android/assets/.gitignore


+ 0 - 0
Source/Android/build.xml → Android/build.xml


+ 73 - 0
Android/custom_rules.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2008-2016 the Urho3D project.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+-->
+<project name="Urho3D_custom_rules" default="help">
+
+    <!--
+        Optionally patch assets directories to have a trailing indicator character(s) in their names for easy identification
+        The patch is done when ASSET_DIR_INDICATOR environment variable is set
+        Without the patch, the FileSystem::DirExist() reduces its accuracy and the FileSystem::ScanDir() only scans for files
+    -->
+    <property environment="env"/>
+    <condition property="patched-asset.dir" value="assets${env.ASSET_DIR_INDICATOR}" else="assets">
+        <isset property="env.ASSET_DIR_INDICATOR"/>
+    </condition>
+    <property name="asset.absolute.dir" location="${patched-asset.dir}"/>
+
+    <target name="-pre-build" if="env.ASSET_DIR_INDICATOR">
+        <delete dir="${patched-asset.dir}"/>
+        <mkdir dir="${patched-asset.dir}"/>
+        <apply executable="mkdir" dest="${patched-asset.dir}" addsourcefile="false">
+            <targetfile/>
+            <dirset dir="${asset.dir}"/>
+            <chainedmapper>
+                <regexpmapper from="(.+)" to="\1${env.ASSET_DIR_INDICATOR}"/>
+                <firstmatchmapper>
+                    <filtermapper>
+                        <replacestring from="/" to="${env.ASSET_DIR_INDICATOR}/"/>
+                    </filtermapper>
+                    <filtermapper>
+                        <replacestring from="\\" to="${env.ASSET_DIR_INDICATOR}\\"/>
+                    </filtermapper>
+                </firstmatchmapper>
+            </chainedmapper>
+        </apply>
+        <copy todir="${patched-asset.dir}">
+            <fileset dir="${asset.dir}">
+                <type type="file"/>
+            </fileset>
+            <firstmatchmapper>
+                <filtermapper>
+                    <replacestring from="/" to="${env.ASSET_DIR_INDICATOR}/"/>
+                </filtermapper>
+                <filtermapper>
+                    <replacestring from="\\" to="${env.ASSET_DIR_INDICATOR}\\"/>
+                </filtermapper>
+            </firstmatchmapper>
+        </copy>
+    </target>
+
+    <target name="-post-build" if="env.ASSET_DIR_INDICATOR">
+        <delete dir="${patched-asset.dir}"/>
+    </target>
+
+</project>

+ 14 - 0
Android/project.properties

@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-21

+ 0 - 0
Source/Android/res/drawable-hdpi/icon.png → Android/res/drawable-hdpi/icon.png


+ 0 - 0
Source/Android/res/drawable-ldpi/icon.png → Android/res/drawable-ldpi/icon.png


+ 0 - 0
Source/Android/res/drawable-mdpi/icon.png → Android/res/drawable-mdpi/icon.png


+ 0 - 0
Source/Android/res/drawable/logo_large.png → Android/res/drawable/logo_large.png


+ 7 - 11
Source/Android/res/layout/samples_list.xml → Android/res/layout/samples_list.xml

@@ -1,14 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
+              xmlns:tools="http://schemas.android.com/tools"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:orientation="vertical">
 
     <ImageView
-        android:id="@+id/imageView"
+        android:id="@+id/logo"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:src="@drawable/logo_large" />
+        android:src="@drawable/logo_large"
+        tools:ignore="ContentDescription" />
 
     <ListView
         android:id="@android:id/list"
@@ -16,10 +18,4 @@
         android:layout_height="0dip"
         android:layout_weight="1" />
 
-    <TextView
-        android:id="@android:id/empty"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="No activities" />
-
 </LinearLayout>

+ 11 - 0
Android/res/layout/samples_list_text_view.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+          android:id="@android:id/text1"
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content"
+          android:gravity="center_vertical"
+          android:paddingBottom="14dp"
+          android:paddingTop="14dp"
+          android:paddingLeft="14dp"
+          android:paddingRight="14dp"
+          android:textSize="22sp"/>

+ 20 - 0
Android/res/layout/scripts_list.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:orientation="vertical">
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceLarge"
+        android:text="@string/script_list"
+        android:id="@+id/textView"/>
+
+    <ExpandableListView
+        android:id="@android:id/list"
+        android:layout_width="match_parent"
+        android:layout_height="0dip"
+        android:layout_weight="1"/>
+
+</LinearLayout>

+ 1 - 0
Source/Android/res/values/strings.xml → Android/res/values/strings.xml

@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <string name="app_name">Urho3D</string>
+    <string name="script_list">Choose a script to play</string>
 </resources>

+ 5 - 5
Source/Android/src/com/github/urho3d/SampleLauncher.java → Android/src/com/github/urho3d/SampleLauncher.java

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2008-2014 the Urho3D project.
+// Copyright (c) 2008-2016 the Urho3D project.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -33,16 +33,16 @@ import android.widget.ListView;
 
 public class SampleLauncher extends ListActivity {
 
-    public static final String LIBRARY_NAMES = "LIBRARY_NAMES";
-    public static final String PICKED_LIBRARY = "PICKED_LIBRARY";
+    public static final String LIBRARY_NAMES = "libraryNames";
+    public static final String PICKED_LIBRARY = "pickedLibrary";
     private static final int OBTAINING_LIBNAMES = 1;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        // Start Urho3D activity with the intention for obtaining the library name(s)
-        startActivityForResult(new Intent(this, Urho3D.class), OBTAINING_LIBNAMES);
+        // Start Urho3D activity with the intention for obtaining the library name(s), except when a library is already being picked externally
+        startActivityForResult(new Intent(this, Urho3D.class).putExtra(PICKED_LIBRARY, getIntent().getStringExtra(PICKED_LIBRARY)), OBTAINING_LIBNAMES);
 
         requestWindowFeature(Window.FEATURE_NO_TITLE);
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

+ 71 - 0
Android/src/com/github/urho3d/ScriptPicker.java

@@ -0,0 +1,71 @@
+package com.github.urho3d;
+
+import android.app.ExpandableListActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ExpandableListView;
+import android.widget.SimpleExpandableListAdapter;
+
+import java.util.*;
+
+public class ScriptPicker extends ExpandableListActivity {
+
+    private static final String LANG = "lang";
+    private static final String INFO = "info";
+    private static final String SCRIPT = "script";
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Prepare an expandable list view for picking the sample script names
+        @SuppressWarnings("unchecked")
+        final HashMap<String, ArrayList<String>> scripts = (HashMap<String, ArrayList<String>>) getIntent().getSerializableExtra(Urho3D.SCRIPTS);
+        setListAdapter(new SimpleExpandableListAdapter(this,
+                new ArrayList<Map<String, String>>() {{
+                    for (final String lang : scripts.keySet()) {
+                        add(new HashMap<String, String>() {{
+                            put(LANG, lang);
+                            put(INFO, "Click to expand/collapse");
+                        }});
+                    }
+                }}, android.R.layout.simple_expandable_list_item_2, new String[]{LANG, INFO}, new int[]{android.R.id.text1, android.R.id.text2},
+                new ArrayList<List<Map<String, String>>>() {{
+                    for (final String lang : scripts.keySet()) {
+                        add(new ArrayList<Map<String, String>>() {{
+                            // Sort to make non-numbered samples on top
+                            ArrayList<String> sortedScripts = scripts.get(lang);
+                            Collections.sort(sortedScripts, new Comparator<String>() {
+                                private String sortName(String name) {
+                                    return name.contains("_") ? name : "00_" + name;
+                                }
+
+                                @Override
+                                public int compare(String lhs, String rhs) {
+                                    return sortName(lhs).compareTo(sortName(rhs));
+                                }
+                            });
+                            for (final String script : sortedScripts) {
+                                // Filter to exclude directory names from being listed
+                                if (script.contains(".")) {
+                                    add(new HashMap<String, String>() {{
+                                        put(SCRIPT, script);
+                                    }});
+                                }
+                            }
+                        }});
+                    }
+                }}, R.layout.samples_list_text_view, new String[]{SCRIPT}, new int[]{android.R.id.text1}));
+        setContentView(R.layout.scripts_list);
+    }
+
+    @Override
+    public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
+        @SuppressWarnings("unchecked")
+        Map<String, String> map = (Map<String, String>) getExpandableListAdapter().getChild(groupPosition, childPosition);
+        setResult(RESULT_OK, getIntent().putExtra(Urho3D.PICKED_SCRIPT, map.get(SCRIPT)));
+        finish();
+        return true;
+    }
+
+}

+ 41 - 7
Source/Android/src/com/github/urho3d/Urho3D.java → Android/src/com/github/urho3d/Urho3D.java

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2008-2014 the Urho3D project.
+// Copyright (c) 2008-2016 the Urho3D project.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -22,16 +22,27 @@
 
 package com.github.urho3d;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-
+import android.content.Intent;
+import android.content.res.AssetManager;
+import android.util.Log;
 import org.libsdl.app.SDLActivity;
 
-import android.content.Intent;
+import java.io.IOException;
+import java.util.*;
 
 public class Urho3D extends SDLActivity {
 
+    public static final String SCRIPTS = "scripts";
+    public static final String PICKED_SCRIPT = "pickedScript";
+    private static final String TAG = "Urho3D";
+    private static final int OBTAINING_SCRIPT = 1;
+    private static String[] mArguments = new String[0];
+
+    @Override
+    protected String[] getArguments() {
+        return mArguments;
+    }
+
     @Override
     protected boolean onLoadLibrary(ArrayList<String> libraryNames) {
         // Ensure "Urho3D" (in case of Urho3D shared lib type is used) and "Urho3DPlayer" are being sorted to the top of the list 
@@ -71,10 +82,33 @@ public class Urho3D extends SDLActivity {
         } else {
             // Intention for loading a picked library name (and remove all others)
             libraryNames.subList(startIndex, libraryNames.size()).clear();
-            libraryNames.add(pickedLibrary);
+            mArguments = pickedLibrary.split(":");
+            libraryNames.add(mArguments[0]);
+            if ("Urho3DPlayer".equals(mArguments[0]) && mArguments.length == 1) {
+                // Urho3DPlayer needs a script name to play
+                try {
+                    final AssetManager assetManager = getContext().getAssets();
+                    HashMap<String, ArrayList<String>> scripts = new HashMap<String, ArrayList<String>>(2) {{
+                        put("AngleScript", new ArrayList<String>(Arrays.asList(assetManager.list("Data/Scripts"))));
+                        put("Lua", new ArrayList<String>(Arrays.asList(assetManager.list("Data/LuaScripts"))));
+                    }};
+                    startActivityForResult(new Intent(this, ScriptPicker.class).putExtra(SCRIPTS, scripts), OBTAINING_SCRIPT);
+                } catch (IOException e) {
+                    Log.e(TAG, "Could not scan assets directory for playable scripts", e);
+                }
+            }
         }
 
         return super.onLoadLibrary(libraryNames);
     }
 
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (OBTAINING_SCRIPT != requestCode || RESULT_CANCELED == resultCode)
+            return;
+        String script = data.getStringExtra(PICKED_SCRIPT);
+        script = (script.endsWith(".as") ? "Scripts/" : "LuaScripts/") + script;
+        mArguments = new String[]{mArguments[0], script};
+    }
+
 }

File diff suppressed because it is too large
+ 588 - 75
Android/src/org/libsdl/app/SDLActivity.java


+ 0 - 8
Bin/ConvertModels.bat

@@ -1,8 +0,0 @@
-cd /d "%~dp0"
-OgreImporter ../SourceAssets/Jack.mesh.xml Data/Models/Jack.mdl -t
-OgreImporter ../SourceAssets/Level.mesh.xml Data/Models/NinjaSnowWar/Level.mdl -t
-OgreImporter ../SourceAssets/Mushroom.mesh.xml Data/Models/Mushroom.mdl -t
-OgreImporter ../SourceAssets/Ninja.mesh.xml Data/Models/NinjaSnowWar/Ninja.mdl -t
-OgreImporter ../SourceAssets/Potion.mesh.xml Data/Models/NinjaSnowWar/Potion.mdl -t
-OgreImporter ../SourceAssets/SnowBall.mesh.xml Data/Models/NinjaSnowWar/SnowBall.mdl -t
-OgreImporter ../SourceAssets/SnowCrate.mesh.xml Data/Models/NinjaSnowWar/SnowCrate.mdl -t

+ 0 - 262
Bin/CoreData/Shaders/GLSL/Lighting.glsl

@@ -1,262 +0,0 @@
-#ifdef COMPILEVS
-vec3 GetAmbient(float zonePos)
-{
-    return cAmbientStartColor + zonePos * cAmbientEndColor;
-}
-
-#ifdef NUMVERTEXLIGHTS
-float GetVertexLight(int index, vec3 worldPos, vec3 normal)
-{
-    vec3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    vec3 lightPos = cVertexLights[index * 3 + 2].xyz;
-    float invRange = cVertexLights[index * 3].w;
-    float cutoff = cVertexLights[index * 3 + 1].w;
-    float invCutoff = cVertexLights[index * 3 + 2].w;
-
-    // Directional light
-    if (invRange == 0.0)
-    {
-        float NdotL = max(dot(normal, lightDir), 0.0);
-        return NdotL;
-    }
-    // Point/spot light
-    else
-    {
-        vec3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        vec3 localDir = lightVec / lightDist;
-        float NdotL = max(dot(normal, localDir), 0.0);
-        float atten = clamp(1.0 - lightDist * lightDist, 0.0, 1.0);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = clamp((spotEffect - cutoff) * invCutoff, 0.0, 1.0);
-        return NdotL * atten * spotAtten;
-    }
-}
-
-float GetVertexLightVolumetric(int index, vec3 worldPos)
-{
-    vec3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    vec3 lightPos = cVertexLights[index * 3 + 2].xyz;
-    float invRange = cVertexLights[index * 3].w;
-    float cutoff = cVertexLights[index * 3 + 1].w;
-    float invCutoff = cVertexLights[index * 3 + 2].w;
-
-    // Directional light
-    if (invRange == 0.0)
-        return 1.0;
-    // Point/spot light
-    else
-    {
-        vec3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        vec3 localDir = lightVec / lightDist;
-        float atten = clamp(1.0 - lightDist * lightDist, 0.0, 1.0);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = clamp((spotEffect - cutoff) * invCutoff, 0.0, 1.0);
-        return atten * spotAtten;
-    }
-}
-#endif
-
-#ifdef SHADOW
-
-#if defined(DIRLIGHT) && !defined(GL_ES)
-    #define NUMCASCADES 4
-#else
-    #define NUMCASCADES 1
-#endif
-
-vec4 GetShadowPos(int index, vec4 projWorldPos)
-{
-    #if defined(DIRLIGHT)
-        return cLightMatrices[index] * projWorldPos;
-    #elif defined(SPOTLIGHT)
-        return cLightMatrices[1] * projWorldPos;
-    #else
-        return vec4(projWorldPos.xyz - cLightPos.xyz, 1.0);
-    #endif
-}
-
-#endif
-#endif
-
-#ifdef COMPILEPS
-float GetDiffuse(vec3 normal, vec3 worldPos, out vec3 lightDir)
-{
-    #ifdef DIRLIGHT
-        lightDir = cLightDirPS;
-        return max(dot(normal, lightDir), 0.0);
-    #else
-        vec3 lightVec = (cLightPosPS.xyz - worldPos) * cLightPosPS.w;
-        float lightDist = length(lightVec);
-        lightDir = lightVec / lightDist;
-        return max(dot(normal, lightDir), 0.0) * texture2D(sLightRampMap, vec2(lightDist, 0.0)).r;
-    #endif
-}
-
-float GetDiffuseVolumetric(vec3 worldPos)
-{
-    #ifdef DIRLIGHT
-        return 1.0;
-    #else
-        vec3 lightVec = (cLightPosPS.xyz - worldPos) * cLightPosPS.w;
-        float lightDist = length(lightVec);
-        return texture2D(sLightRampMap, vec2(lightDist, 0.0)).r;
-    #endif
-}
-
-float GetSpecular(vec3 normal, vec3 eyeVec, vec3 lightDir, float specularPower)
-{
-    vec3 halfVec = normalize(normalize(eyeVec) + lightDir);
-    return pow(max(dot(normal, halfVec), 0.0), specularPower);
-}
-
-float GetIntensity(vec3 color)
-{
-    return dot(color, vec3(0.333));
-}
-
-#ifdef SHADOW
-
-#if defined(DIRLIGHT) && !defined(GL_ES)
-    #define NUMCASCADES 4
-#else
-    #define NUMCASCADES 1
-#endif
-
-float GetShadow(vec4 shadowPos)
-{
-    #ifndef GL_ES
-        #ifndef LQSHADOW
-            // Take four samples and average them
-            // Note: in case of sampling a point light cube shadow, we optimize out the w divide as it has already been performed
-            #ifndef POINTLIGHT
-                vec2 offsets = cShadowMapInvSize * shadowPos.w;
-            #else
-                vec2 offsets = cShadowMapInvSize;
-            #endif
-            vec4 inLight = vec4(
-                shadow2DProj(sShadowMap, shadowPos).r,
-                shadow2DProj(sShadowMap, vec4(shadowPos.x + offsets.x, shadowPos.yzw)).r,
-                shadow2DProj(sShadowMap, vec4(shadowPos.x, shadowPos.y + offsets.y, shadowPos.zw)).r,
-                shadow2DProj(sShadowMap, vec4(shadowPos.xy + offsets.xy, shadowPos.zw)).r
-            );
-            return cShadowIntensity.y + dot(inLight, vec4(cShadowIntensity.x));
-        #else
-            // Take one sample
-            float inLight = shadow2DProj(sShadowMap, shadowPos).r;
-            return cShadowIntensity.y + cShadowIntensity.x * inLight;
-        #endif
-    #else
-        #ifndef LQSHADOW
-            // Take four samples and average them
-            vec2 offsets = cShadowMapInvSize * shadowPos.w;
-            vec4 inLight = vec4(
-                texture2DProj(sShadowMap, shadowPos).r * shadowPos.w > shadowPos.z,
-                texture2DProj(sShadowMap, vec4(shadowPos.x + offsets.x, shadowPos.yzw)).r * shadowPos.w > shadowPos.z,
-                texture2DProj(sShadowMap, vec4(shadowPos.x, shadowPos.y + offsets.y, shadowPos.zw)).r * shadowPos.w > shadowPos.z,
-                texture2DProj(sShadowMap, vec4(shadowPos.xy + offsets.xy, shadowPos.zw)).r * shadowPos.w > shadowPos.z
-            );
-            return cShadowIntensity.y + dot(inLight, vec4(cShadowIntensity.x));
-        #else
-            // Take one sample
-            return cShadowIntensity.y + (texture2DProj(sShadowMap, shadowPos).r * shadowPos.w > shadowPos.z ? cShadowIntensity.x : 0.0);
-        #endif
-    #endif
-}
-
-#ifdef POINTLIGHT
-float GetPointShadow(vec3 lightVec)
-{
-    vec3 axis = textureCube(sFaceSelectCubeMap, lightVec).rgb;
-    float depth = abs(dot(lightVec, axis));
-
-    // Expand the maximum component of the light vector to get full 0.0 - 1.0 UV range from the cube map,
-    // and to avoid sampling across faces. Some GPU's filter across faces, while others do not, and in this
-    // case filtering across faces is wrong
-    const vec3 factor = vec3(1.0 / 256.0);
-    lightVec += factor * axis * lightVec;
-
-    // Read the 2D UV coordinates, adjust according to shadow map size and add face offset
-    vec4 indirectPos = textureCube(sIndirectionCubeMap, lightVec);
-    indirectPos.xy *= cShadowCubeAdjust.xy;
-    indirectPos.xy += vec2(cShadowCubeAdjust.z + indirectPos.z * 0.5, cShadowCubeAdjust.w + indirectPos.w);
-
-    vec4 shadowPos = vec4(indirectPos.xy, cShadowDepthFade.x + cShadowDepthFade.y / depth, 1.0);
-    return GetShadow(shadowPos);
-}
-#endif
-
-#ifdef DIRLIGHT
-float GetDirShadowFade(float inLight, float depth)
-{
-    return min(inLight + max((depth - cShadowDepthFade.z) * cShadowDepthFade.w, 0.0), 1.0);
-}
-
-#ifndef GL_ES
-float GetDirShadow(const vec4 iShadowPos[NUMCASCADES], float depth)
-{
-    vec4 shadowPos;
-
-    if (depth < cShadowSplits.x)
-        shadowPos = iShadowPos[0];
-    else if (depth < cShadowSplits.y)
-        shadowPos = iShadowPos[1];
-    else if (depth < cShadowSplits.z)
-        shadowPos = iShadowPos[2];
-    else
-        shadowPos = iShadowPos[3];
-        
-    return GetDirShadowFade(GetShadow(shadowPos), depth);
-}
-
-float GetDirShadowDeferred(vec4 projWorldPos, float depth)
-{
-    vec4 shadowPos;
-
-    if (depth < cShadowSplits.x)
-        shadowPos = cLightMatricesPS[0] * projWorldPos;
-    else if (depth < cShadowSplits.y)
-        shadowPos = cLightMatricesPS[1] * projWorldPos;
-    else if (depth < cShadowSplits.z)
-        shadowPos = cLightMatricesPS[2] * projWorldPos;
-    else
-        shadowPos = cLightMatricesPS[3] * projWorldPos;
-
-    return GetDirShadowFade(GetShadow(shadowPos), depth);
-}
-#else
-float GetDirShadow(const vec4 iShadowPos[NUMCASCADES], float depth)
-{
-    return GetDirShadowFade(GetShadow(iShadowPos[0]), depth);
-}
-#endif
-#endif
-
-float GetShadow(vec4 iShadowPos[NUMCASCADES], float depth)
-{
-    #if defined(DIRLIGHT)
-        return GetDirShadow(iShadowPos, depth);
-    #elif defined(SPOTLIGHT)
-        return GetShadow(iShadowPos[0]);
-    #else
-        return GetPointShadow(iShadowPos[0].xyz);
-    #endif
-}
-
-#ifndef GL_ES
-float GetShadowDeferred(vec4 projWorldPos, float depth)
-{
-    #if defined(DIRLIGHT)
-        return GetDirShadowDeferred(projWorldPos, depth);
-    #elif defined(SPOTLIGHT)
-        vec4 shadowPos = cLightMatricesPS[1] * projWorldPos;
-        return GetShadow(shadowPos);
-    #else
-        vec3 shadowPos = projWorldPos.xyz - cLightPosPS.xyz;
-        return GetPointShadow(shadowPos);
-    #endif
-}
-#endif
-#endif
-#endif

+ 0 - 56
Bin/CoreData/Shaders/GLSL/Samplers.glsl

@@ -1,56 +0,0 @@
-#ifdef COMPILEPS
-uniform sampler2D sDiffMap;
-uniform samplerCube sDiffCubeMap;
-uniform sampler2D sNormalMap;
-uniform sampler2D sSpecMap;
-uniform sampler2D sEmissiveMap;
-uniform sampler2D sEnvMap;
-uniform samplerCube sEnvCubeMap;
-uniform sampler2D sLightRampMap;
-uniform sampler2D sLightSpotMap;
-uniform samplerCube sLightCubeMap;
-#ifndef GL_ES
-    uniform sampler3D sVolumeMap;
-    uniform sampler2D sAlbedoBuffer;
-    uniform sampler2D sNormalBuffer;
-    uniform sampler2D sDepthBuffer;
-    uniform sampler2D sLightBuffer;
-    uniform sampler2DShadow sShadowMap;
-    uniform samplerCube sFaceSelectCubeMap;
-    uniform samplerCube sIndirectionCubeMap;
-    uniform samplerCube sZoneCubeMap;
-    uniform sampler3D sZoneVolumeMap;
-#else
-    uniform sampler2D sShadowMap;
-#endif
-
-vec3 DecodeNormal(vec4 normalInput)
-{
-    #ifdef PACKEDNORMAL
-        vec3 normal;
-        normal.xy = normalInput.ag * 2.0 - 1.0;
-        normal.z = sqrt(max(1.0 - dot(normal.xy, normal.xy), 0.0));
-        return normal;
-    #else
-        return normalize(normalInput.rgb * 2.0 - 1.0);
-    #endif
-}
-
-vec3 EncodeDepth(float depth)
-{
-    vec3 ret;
-    depth *= 255.0;
-    ret.x = floor(depth);
-    depth = (depth - ret.x) * 255.0;
-    ret.y = floor(depth);
-    ret.z = (depth - ret.y);
-    ret.xy *= 1.0 / 255.0;
-    return ret;
-}
-
-float DecodeDepth(vec3 depth)
-{
-    const vec3 dotValues = vec3(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0));
-    return dot(depth, dotValues);
-}
-#endif

+ 0 - 119
Bin/CoreData/Shaders/GLSL/Transform.glsl

@@ -1,119 +0,0 @@
-#ifdef COMPILEVS
-attribute vec4 iPos;
-attribute vec3 iNormal;
-attribute vec4 iColor;
-attribute vec2 iTexCoord;
-attribute vec2 iTexCoord2;
-attribute vec4 iTangent;
-attribute vec4 iBlendWeights;
-attribute vec4 iBlendIndices;
-attribute vec3 iCubeTexCoord;
-attribute vec4 iCubeTexCoord2;
-#ifndef GL_ES
-    attribute vec4 iInstanceMatrix1;
-    attribute vec4 iInstanceMatrix2;
-    attribute vec4 iInstanceMatrix3;
-#endif
-
-#ifdef SKINNED
-mat4 GetSkinMatrix(vec4 blendWeights, vec4 blendIndices)
-{
-    ivec4 idx = ivec4(blendIndices) * 3;
-    const vec4 lastColumn = vec4(0.0, 0.0, 0.0, 1.0);
-    return mat4(cSkinMatrices[idx.x], cSkinMatrices[idx.x + 1], cSkinMatrices[idx.x + 2], lastColumn) * blendWeights.x +
-        mat4(cSkinMatrices[idx.y], cSkinMatrices[idx.y + 1], cSkinMatrices[idx.y + 2], lastColumn) * blendWeights.y +
-        mat4(cSkinMatrices[idx.z], cSkinMatrices[idx.z + 1], cSkinMatrices[idx.z + 2], lastColumn) * blendWeights.z +
-        mat4(cSkinMatrices[idx.w], cSkinMatrices[idx.w + 1], cSkinMatrices[idx.w + 2], lastColumn) * blendWeights.w;
-}
-#endif
-
-#ifdef INSTANCED
-mat4 GetInstanceMatrix()
-{
-    const vec4 lastColumn = vec4(0.0, 0.0, 0.0, 1.0);
-    return mat4(iInstanceMatrix1, iInstanceMatrix2, iInstanceMatrix3, lastColumn);
-}
-#endif
-
-mat3 GetNormalMatrix(mat4 modelMatrix)
-{
-    return mat3(modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz);
-}
-
-vec2 GetTexCoord(vec2 texCoord)
-{
-    return vec2(dot(texCoord, cUOffset.xy) + cUOffset.w, dot(texCoord, cVOffset.xy) + cVOffset.w);
-}
-
-vec4 GetClipPos(vec3 worldPos)
-{
-    vec4 ret = cViewProj * vec4(worldPos, 1.0);
-    // While getting the clip coordinate, also automatically set gl_ClipVertex for user clip planes
-    #ifndef GL_ES
-    gl_ClipVertex = ret;
-    #endif
-    return ret;
-}
-
-float GetZonePos(vec3 worldPos)
-{
-    return clamp((cZone * vec4(worldPos, 1.0)).z, 0.0, 1.0);
-}
-
-float GetDepth(vec4 clipPos)
-{
-    return dot(clipPos.zw, cDepthMode.zw);
-}
-
-vec3 GetBillboardPos(vec4 iPos, vec2 iSize, mat4 modelMatrix)
-{
-    return (modelMatrix * iPos).xyz + cBillboardRot * vec3(iSize.x, iSize.y, 0.0);
-}
-
-vec3 GetBillboardNormal()
-{
-    return vec3(-cBillboardRot[2][0], -cBillboardRot[2][1], -cBillboardRot[2][2]);
-}
-
-// Note: the skinning/instancing model matrix is a transpose, so the matrix multiply order must be swapped
-// (see GetWorldPos(), GetWorldNormal() and GetWorldTangent() below)
-#if defined(SKINNED)
-    #define iModelMatrix GetSkinMatrix(iBlendWeights, iBlendIndices)
-#elif defined(INSTANCED)
-    #define iModelMatrix GetInstanceMatrix();
-#else
-    #define iModelMatrix cModel
-#endif
-
-vec3 GetWorldPos(mat4 modelMatrix)
-{
-    #if defined(SKINNED) || defined(INSTANCED)
-        return (iPos * modelMatrix).xyz;
-    #elif defined(BILLBOARD)
-        return GetBillboardPos(iPos, iTexCoord2, modelMatrix);
-    #else
-        return (modelMatrix * iPos).xyz;
-    #endif
-}
-
-vec3 GetWorldNormal(mat4 modelMatrix)
-{
-    #if defined(SKINNED) || defined(INSTANCED)
-        return normalize(iNormal * GetNormalMatrix(modelMatrix));
-    #elif defined(BILLBOARD)
-        return GetBillboardNormal();
-    #else
-        return normalize(GetNormalMatrix(modelMatrix) * iNormal);
-    #endif
-}
-
-vec3 GetWorldTangent(mat4 modelMatrix)
-{   
-    mat3 normalMatrix = GetNormalMatrix(modelMatrix);
-    #if defined(SKINNED) || defined(INSTANCED)
-        return normalize(iTangent.xyz * normalMatrix);
-    #else
-        return normalize(normalMatrix * iTangent.xyz);
-    #endif
-}
-#endif

+ 0 - 65
Bin/CoreData/Shaders/GLSL/Uniforms.glsl

@@ -1,65 +0,0 @@
-#ifdef COMPILEVS
-uniform vec3 cAmbientStartColor;
-uniform vec3 cAmbientEndColor;
-uniform mat3 cBillboardRot;
-uniform vec3 cCameraPos;
-uniform mat3 cCameraRot;
-uniform float cNearClip;
-uniform float cFarClip;
-uniform vec4 cDepthMode;
-uniform vec3 cFrustumSize;
-uniform float cDeltaTime;
-uniform float cElapsedTime;
-uniform vec4 cGBufferOffsets;
-uniform vec3 cLightDir;
-uniform vec4 cLightPos;
-uniform mat4 cModel;
-uniform mat4 cViewProj;
-uniform vec4 cUOffset;
-uniform vec4 cVOffset;
-uniform mat4 cZone;
-#ifndef GL_ES
-    uniform mat4 cLightMatrices[4];
-#else
-    uniform mat4 cLightMatrices[2];
-#endif
-#ifdef SKINNED
-    #ifdef RASPI
-        uniform vec4 cSkinMatrices[32*3];
-    #else
-        uniform vec4 cSkinMatrices[64*3];
-    #endif
-#endif
-#ifdef NUMVERTEXLIGHTS
-    uniform vec4 cVertexLights[4*3];
-#endif
-#endif
-
-#ifdef COMPILEPS
-#ifdef GL_ES
-    precision mediump float;
-#endif
-
-uniform vec3 cAmbientColor;
-uniform vec3 cCameraPosPS;
-uniform float cDeltaTimePS;
-uniform float cElapsedTimePS;
-uniform vec4 cFogParams;
-uniform vec3 cFogColor;
-uniform vec2 cGBufferInvSize;
-uniform vec4 cLightColor;
-uniform vec3 cLightDirPS;
-uniform vec4 cLightPosPS;
-uniform vec4 cMatDiffColor;
-uniform vec3 cMatEmissiveColor;
-uniform vec3 cMatEnvMapColor;
-uniform vec4 cMatSpecColor;
-uniform float cNearClipPS;
-uniform float cFarClipPS;
-uniform vec4 cShadowCubeAdjust;
-uniform vec4 cShadowDepthFade;
-uniform vec2 cShadowIntensity;
-uniform vec2 cShadowMapInvSize;
-uniform vec4 cShadowSplits;
-uniform mat4 cLightMatricesPS[4];
-#endif

+ 0 - 44
Bin/CoreData/Shaders/HLSL/Blur.hlsl

@@ -1,44 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Transform.hlsl"
-#include "Samplers.hlsl"
-#include "ScreenPos.hlsl"
-#include "PostProcess.hlsl"
-
-uniform float2 cBlurDir;
-uniform float cBlurRadius;
-uniform float cBlurSigma;
-uniform float2 cBlurHOffsets;
-uniform float2 cBlurHInvSize;
-
-void VS(float4 iPos : POSITION,
-    out float4 oPos : POSITION,
-    out float2 oTexCoord : TEXCOORD0,
-    out float2 oScreenPos : TEXCOORD1)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oTexCoord = GetQuadTexCoord(oPos) + cBlurHOffsets;
-    oScreenPos = GetScreenPosPreDiv(oPos);
-}
-
-void PS(float2 iTexCoord : TEXCOORD0,
-    float2 iScreenPos : TEXCOORD1,
-    out float4 oColor : COLOR0)
-{
-    #ifdef BLUR3
-        oColor = GaussianBlur(3, cBlurDir, cBlurHInvSize * cBlurRadius, cBlurSigma, sDiffMap, iTexCoord);
-    #endif
-
-    #ifdef BLUR5
-        oColor = GaussianBlur(5, cBlurDir, cBlurHInvSize * cBlurRadius, cBlurSigma, sDiffMap, iTexCoord);
-    #endif
-
-    #ifdef BLUR7
-        oColor = GaussianBlur(7, cBlurDir, cBlurHInvSize * cBlurRadius, cBlurSigma, sDiffMap, iTexCoord);
-    #endif
-
-    #ifdef BLUR9
-        oColor = GaussianBlur(9, cBlurDir, cBlurHInvSize * cBlurRadius, cBlurSigma, sDiffMap, iTexCoord);
-    #endif
-}

+ 0 - 287
Bin/CoreData/Shaders/HLSL/Lighting.hlsl

@@ -1,287 +0,0 @@
-#pragma warning(disable:3571)
-
-#ifdef COMPILEVS
-float3 GetAmbient(float zonePos)
-{
-    return cAmbientStartColor + zonePos * cAmbientEndColor;
-}
-
-#ifdef NUMVERTEXLIGHTS
-float GetVertexLight(int index, float3 worldPos, float3 normal)
-{
-    float3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    float3 lightPos = cVertexLights[index * 3 + 2].xyz;
-    float invRange = cVertexLights[index * 3].w;
-    float cutoff = cVertexLights[index * 3 + 1].w;
-    float invCutoff = cVertexLights[index * 3 + 2].w;
-
-    // Directional light
-    if (invRange == 0.0)
-    {
-        float NdotL = max(dot(normal, lightDir), 0.0);
-        return NdotL;
-    }
-    // Point/spot light
-    else
-    {
-        float3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        float3 localDir = lightVec / lightDist;
-        float NdotL = max(dot(normal, localDir), 0.0);
-        float atten = saturate(1.0 - lightDist * lightDist);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = saturate((spotEffect - cutoff) * invCutoff);
-        return NdotL * atten * spotAtten;
-    }
-}
-
-float GetVertexLightVolumetric(int index, float3 worldPos)
-{
-    float3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    float3 lightPos = cVertexLights[index * 3 + 2].xyz;
-    float invRange = cVertexLights[index * 3].w;
-    float cutoff = cVertexLights[index * 3 + 1].w;
-    float invCutoff = cVertexLights[index * 3 + 2].w;
-
-    // Directional light
-    if (invRange == 0.0)
-    {
-        return 1.0;
-    }
-    // Point/spot light
-    else
-    {
-        float3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        float3 localDir = lightVec / lightDist;
-        float atten = saturate(1.0 - lightDist * lightDist);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = saturate((spotEffect - cutoff) * invCutoff);
-        return atten * spotAtten;
-    }
-}
-#endif
-
-#ifdef SHADOW
-
-#ifdef DIRLIGHT
-    #ifdef SM3
-        #define NUMCASCADES 4
-    #else
-        #define NUMCASCADES 3
-    #endif
-#else
-    #define NUMCASCADES 1
-#endif
-
-void GetShadowPos(float4 projWorldPos, out float4 shadowPos[NUMCASCADES])
-{
-    // Shadow projection: transform from world space to shadow space
-    #if defined(DIRLIGHT)
-        shadowPos[0] = mul(projWorldPos, cLightMatrices[0]);
-        shadowPos[1] = mul(projWorldPos, cLightMatrices[1]);
-        shadowPos[2] = mul(projWorldPos, cLightMatrices[2]);
-        #ifdef SM3
-            shadowPos[3] = mul(projWorldPos, cLightMatrices[3]);
-        #endif
-    #elif defined(SPOTLIGHT)
-        shadowPos[0] = mul(projWorldPos, cLightMatrices[1]);
-    #else
-        shadowPos[0] = float4(projWorldPos.xyz - cLightPos.xyz, 0.0);
-    #endif
-}
-#endif
-#endif
-
-#ifdef COMPILEPS
-float GetDiffuse(float3 normal, float3 worldPos, out float3 lightDir)
-{
-    #ifdef DIRLIGHT
-        lightDir = cLightDirPS;
-        return saturate(dot(normal, lightDir));
-    #else
-        float3 lightVec = (cLightPosPS.xyz - worldPos) * cLightPosPS.w;
-        float lightDist = length(lightVec);
-        lightDir = lightVec / lightDist;
-        return saturate(dot(normal, lightDir)) * tex1D(sLightRampMap, lightDist).r;
-    #endif
-}
-
-float GetDiffuseVolumetric(float3 worldPos)
-{
-    #ifdef DIRLIGHT
-        return 1.0;
-    #else
-        float3 lightVec = (cLightPosPS.xyz - worldPos) * cLightPosPS.w;
-        float lightDist = length(lightVec);
-        return tex1D(sLightRampMap, lightDist).r;
-    #endif
-}
-
-float GetSpecular(float3 normal, float3 eyeVec, float3 lightDir, float specularPower)
-{
-    float3 halfVec = normalize(normalize(eyeVec) + lightDir);
-    return pow(dot(normal, halfVec), specularPower);
-}
-
-float GetIntensity(float3 color)
-{
-    return dot(color, float3(0.333, 0.333, 0.333));
-}
-
-#ifdef SHADOW
-
-#ifdef DIRLIGHT
-    #ifdef SM3
-        #define NUMCASCADES 4
-    #else
-        #define NUMCASCADES 3
-    #endif
-#else
-    #define NUMCASCADES 1
-#endif
-
-float GetShadow(float4 shadowPos)
-{
-    #ifndef LQSHADOW
-        // Take four samples and average them
-        // Note: in case of sampling a point light cube shadow, we optimize out the w divide as it has already been performed
-        #ifndef POINTLIGHT
-            float2 offsets = cShadowMapInvSize * shadowPos.w;
-        #else
-            float2 offsets = cShadowMapInvSize;
-        #endif
-        float4 inLight = float4(
-            tex2Dproj(sShadowMap, shadowPos).r,
-            tex2Dproj(sShadowMap, float4(shadowPos.x + offsets.x, shadowPos.yzw)).r,
-            tex2Dproj(sShadowMap, float4(shadowPos.x, shadowPos.y + offsets.y, shadowPos.zw)).r,
-            tex2Dproj(sShadowMap, float4(shadowPos.xy + offsets.xy, shadowPos.zw)).r
-        );
-        #ifndef SHADOWCMP
-            return cShadowIntensity.y + dot(inLight, cShadowIntensity.x);
-        #else
-            #ifndef POINTLIGHT
-                return cShadowIntensity.y + dot(inLight * shadowPos.w > shadowPos.z, cShadowIntensity.x);
-            #else
-                return cShadowIntensity.y + dot(inLight > shadowPos.z, cShadowIntensity.x);
-            #endif
-        #endif
-    #else
-        // Take one sample
-        float inLight = tex2Dproj(sShadowMap, shadowPos).r;
-        #ifndef SHADOWCMP
-            return cShadowIntensity.y + cShadowIntensity.x * inLight;
-        #else
-            #ifndef POINTLIGHT
-                return cShadowIntensity.y + cShadowIntensity.x * (inLight * shadowPos.w > shadowPos.z);
-            #else
-                return cShadowIntensity.y + cShadowIntensity.x * (inLight > shadowPos.z);
-            #endif
-        #endif
-    #endif
-}
-
-#ifdef POINTLIGHT
-float GetPointShadow(float3 lightVec)
-{
-    float3 axis = texCUBE(sFaceSelectCubeMap, lightVec).rgb;
-    float depth = abs(dot(lightVec, axis));
-
-    // Expand the maximum component of the light vector to get full 0.0 - 1.0 UV range from the cube map,
-    // and to avoid sampling across faces. Some GPU's filter across faces, while others do not, and in this
-    // case filtering across faces is wrong
-    const float factor = 1.0 / 256.0;
-    lightVec += factor * axis * lightVec;
-
-    // Read the 2D UV coordinates, adjust according to shadow map size and add face offset
-    float4 indirectPos = texCUBE(sIndirectionCubeMap, lightVec);
-    indirectPos.xy *= cShadowCubeAdjust.xy;
-    indirectPos.xy += float2(cShadowCubeAdjust.z + indirectPos.z * 0.5, cShadowCubeAdjust.w + indirectPos.w);
-
-    float4 shadowPos = float4(indirectPos.xy, cShadowDepthFade.x + cShadowDepthFade.y / depth, 1.0);
-    return GetShadow(shadowPos);
-}
-#endif
-
-#ifdef DIRLIGHT
-float GetDirShadowFade(float inLight, float depth)
-{
-    return saturate(inLight + saturate((depth - cShadowDepthFade.z) * cShadowDepthFade.w));
-}
-
-float GetDirShadow(const float4 iShadowPos[NUMCASCADES], float depth)
-{
-    float4 shadowPos;
-
-    #ifdef SM3
-        if (depth < cShadowSplits.x)
-            shadowPos = iShadowPos[0];
-        else if (depth < cShadowSplits.y)
-            shadowPos = iShadowPos[1];
-        else if (depth < cShadowSplits.z)
-            shadowPos = iShadowPos[2];
-        else
-            shadowPos = iShadowPos[3];
-    #else
-        if (depth < cShadowSplits.x)
-            shadowPos = iShadowPos[0];
-        else if (depth < cShadowSplits.y)
-            shadowPos = iShadowPos[1];
-        else
-            shadowPos = iShadowPos[2];
-    #endif
-
-    return GetDirShadowFade(GetShadow(shadowPos), depth);
-}
-
-float GetDirShadowDeferred(float4 projWorldPos, float depth)
-{
-    float4 shadowPos;
-
-    #ifdef SM3
-        if (depth < cShadowSplits.x)
-            shadowPos = mul(projWorldPos, cLightMatricesPS[0]);
-        else if (depth < cShadowSplits.y)
-            shadowPos = mul(projWorldPos, cLightMatricesPS[1]);
-        else if (depth < cShadowSplits.z)
-            shadowPos = mul(projWorldPos, cLightMatricesPS[2]);
-        else
-            shadowPos = mul(projWorldPos, cLightMatricesPS[3]);
-    #else
-        if (depth < cShadowSplits.x)
-            shadowPos = mul(projWorldPos, cLightMatricesPS[0]);
-        else if (depth < cShadowSplits.y)
-            shadowPos = mul(projWorldPos, cLightMatricesPS[1]);
-        else if (depth < cShadowSplits.z)
-            shadowPos = mul(projWorldPos, cLightMatricesPS[2]);
-    #endif
-
-    return GetDirShadowFade(GetShadow(shadowPos), depth);
-}
-#endif
-
-float GetShadow(float4 iShadowPos[NUMCASCADES], float depth)
-{
-    #if defined(DIRLIGHT)
-        return GetDirShadow(iShadowPos, depth);
-    #elif defined(SPOTLIGHT)
-        return GetShadow(iShadowPos[0]);
-    #else
-        return GetPointShadow(iShadowPos[0].xyz);
-    #endif
-}
-
-float GetShadowDeferred(float4 projWorldPos, float depth)
-{
-    #if defined(DIRLIGHT)
-        return GetDirShadowDeferred(projWorldPos, depth);
-    #elif defined(SPOTLIGHT)
-        float4 shadowPos = mul(projWorldPos, cLightMatricesPS[1]);
-        return GetShadow(shadowPos);
-    #else
-        float3 shadowPos = projWorldPos.xyz - cLightPosPS.xyz;
-        return GetPointShadow(shadowPos);
-    #endif
-}
-#endif
-#endif

+ 0 - 48
Bin/CoreData/Shaders/HLSL/Samplers.hlsl

@@ -1,48 +0,0 @@
-#ifdef COMPILEPS
-sampler2D sDiffMap : register(S0);
-samplerCUBE sDiffCubeMap : register(S0);
-sampler2D sAlbedoBuffer : register(S0);
-sampler2D sNormalMap : register(S1);
-sampler2D sNormalBuffer : register(S1);
-sampler2D sSpecMap : register(S2);
-sampler2D sEmissiveMap : register(S3);
-sampler2D sEnvMap : register(S4);
-samplerCUBE sEnvCubeMap : register(S4);
-sampler1D sLightRampMap : register(S5);
-sampler2D sLightSpotMap : register(S6);
-samplerCUBE sLightCubeMap : register(S6);
-sampler2D sShadowMap : register(S7);
-samplerCUBE sFaceSelectCubeMap : register(S8);
-samplerCUBE sIndirectionCubeMap : register(S9);
-sampler2D sDepthBuffer : register(S10);
-sampler2D sLightBuffer : register(S11);
-sampler3D sVolumeMap : register(S12);
-samplerCUBE sZoneCubeMap : register(S13);
-sampler3D sZoneVolumeMap : register(S13);
-
-float4 Sample(sampler2D map, float2 texCoord)
-{
-    // Use tex2Dlod if available to avoid divergence and allow branching
-    #ifdef SM3
-        return tex2Dlod(map, float4(texCoord, 0.0, 0.0));
-    #else
-        return tex2D(map, texCoord);
-    #endif
-}
-
-float3 DecodeNormal(float4 normalInput)
-{
-    #ifdef PACKEDNORMAL
-        float3 normal;
-        normal.xy = normalInput.ag * 2.0 - 1.0;
-        #ifdef SM3
-            normal.z = sqrt(max(1.0 - dot(normal.xy, normal.xy), 0.0));
-        #else
-            normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
-        #endif
-        return normal;
-    #else
-        return normalInput.rgb * 2.0 - 1.0;
-    #endif
-}
-#endif

+ 0 - 34
Bin/CoreData/Shaders/HLSL/Shadow.hlsl

@@ -1,34 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    float2 iTexCoord : TEXCOORD0,
-    out float2 oTexCoord : TEXCOORD0,
-    out float4 oPos : POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oTexCoord = GetTexCoord(iTexCoord);
-}
-
-void PS(
-    float2 iTexCoord : TEXCOORD0,
-    out float4 oColor : COLOR0)
-{
-    #ifdef ALPHAMASK
-        float alpha = tex2D(sDiffMap, iTexCoord).a;
-        if (alpha < 0.5)
-            discard;
-    #endif
-
-    oColor = 1.0;
-}

+ 0 - 21
Bin/CoreData/Shaders/HLSL/Skybox.hlsl

@@ -1,21 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    out float4 oPos : POSITION,
-    out float3 oTexCoord : TEXCOORD0)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    
-    oPos.z = oPos.w;
-    oTexCoord = iPos.xyz;
-}
-
-void PS(float3 iTexCoord : TEXCOORD0,
-    out float4 oColor : COLOR0)
-{
-    oColor = cMatDiffColor * texCUBE(sDiffCubeMap, iTexCoord);
-}

+ 0 - 63
Bin/CoreData/Shaders/HLSL/Transform.hlsl

@@ -1,63 +0,0 @@
-#ifdef COMPILEVS
-#ifdef SKINNED
-float4x3 GetSkinMatrix(float4 blendWeights, int4 blendIndices)
-{
-    return cSkinMatrices[blendIndices.x] * blendWeights.x +
-        cSkinMatrices[blendIndices.y] * blendWeights.y +
-        cSkinMatrices[blendIndices.z] * blendWeights.z +
-        cSkinMatrices[blendIndices.w] * blendWeights.w;
-}
-#endif
-
-float2 GetTexCoord(float2 iTexCoord)
-{
-    return float2(dot(iTexCoord, cUOffset.xy) + cUOffset.w, dot(iTexCoord, cVOffset.xy) + cVOffset.w);
-};
-
-float4 GetClipPos(float3 worldPos)
-{
-    return mul(float4(worldPos, 1.0), cViewProj);
-}
-
-float GetZonePos(float3 worldPos)
-{
-    return saturate(mul(float4(worldPos, 1.0), cZone).z);
-}
-
-float GetDepth(float4 clipPos)
-{
-    return dot(clipPos.zw, cDepthMode.zw);
-}
-
-float3 GetBillboardPos(float4 iPos, float2 iSize, float4x3 modelMatrix)
-{
-    return mul(iPos, modelMatrix) + mul(float3(iSize.x, iSize.y, 0.0), cBillboardRot);
-}
-
-float3 GetBillboardNormal()
-{
-    return float3(-cBillboardRot[2][0], -cBillboardRot[2][1], -cBillboardRot[2][2]);
-}
-
-#if defined(SKINNED)
-    #define iModelMatrix GetSkinMatrix(iBlendWeights, iBlendIndices);
-#elif defined(INSTANCED)
-    #define iModelMatrix iModelInstance
-#else
-    #define iModelMatrix cModel
-#endif
-
-#ifdef BILLBOARD
-    #define GetWorldPos(modelMatrix) GetBillboardPos(iPos, iSize, modelMatrix)
-#else
-    #define GetWorldPos(modelMatrix) mul(iPos, modelMatrix)
-#endif
-
-#ifdef BILLBOARD
-    #define GetWorldNormal(modelMatrix) GetBillboardNormal()
-#else
-    #define GetWorldNormal(modelMatrix) normalize(mul(iNormal, (float3x3)modelMatrix))
-#endif
-
-#define GetWorldTangent(modelMatrix) normalize(mul(iTangent.xyz, (float3x3)modelMatrix))
-#endif

+ 0 - 59
Bin/CoreData/Shaders/HLSL/Uniforms.hlsl

@@ -1,59 +0,0 @@
-#ifdef COMPILEVS
-// Vertex shader uniforms
-uniform float3 cAmbientStartColor;
-uniform float3 cAmbientEndColor;
-uniform float3x3 cBillboardRot;
-uniform float3 cCameraPos;
-uniform float3x3 cCameraRot;
-uniform float cNearClip;
-uniform float cFarClip;
-uniform float4 cDepthMode;
-uniform float cDeltaTime;
-uniform float cElapsedTime;
-uniform float3 cFrustumSize;
-uniform float4 cGBufferOffsets;
-uniform float3 cLightDir;
-uniform float4 cLightPos;
-uniform float4x3 cModel;
-uniform float4x4 cViewProj;
-uniform float4 cUOffset;
-uniform float4 cVOffset;
-uniform float4x3 cZone;
-uniform float4x4 cLightMatrices[4];
-#ifdef SKINNED
-    uniform float4x3 cSkinMatrices[64];
-#endif
-#ifdef NUMVERTEXLIGHTS
-    uniform float4 cVertexLights[4*3];
-#endif
-#endif
-
-#ifdef COMPILEPS
-// Pixel shader uniforms
-uniform float3 cAmbientColor;
-uniform float3 cCameraPosPS;
-uniform float cDeltaTimePS;
-uniform float cElapsedTimePS;
-uniform float4 cFogParams;
-uniform float3 cFogColor;
-uniform float2 cGBufferInvSize;
-uniform float4 cLightColor;
-uniform float4 cLightPosPS;
-uniform float3 cLightDirPS;
-uniform float4 cMatDiffColor;
-uniform float3 cMatEmissiveColor;
-uniform float3 cMatEnvMapColor;
-uniform float4 cMatSpecColor;
-uniform float cNearClipPS;
-uniform float cFarClipPS;
-uniform float4 cShadowCubeAdjust;
-uniform float4 cShadowDepthFade;
-uniform float2 cShadowIntensity;
-uniform float2 cShadowMapInvSize;
-uniform float4 cShadowSplits;
-#ifdef SM3
-    uniform float4x4 cLightMatricesPS[4];
-#else
-    uniform float4x4 cLightMatricesPS[3];
-#endif
-#endif

+ 0 - 9
Bin/CoreData/Techniques/DiffAOAlphaMask.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true">
-    <pass name="base" vsdefines="AO" psdefines="AO" />
-    <pass name="light" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" psdefines="PREPASS" />
-    <pass name="material" vsdefines="AO" psdefines="MATERIAL AO" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="AO" psdefines="DEFERRED AO" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalAOAlphaMask.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
-    <pass name="base" vsdefines="AO" psdefines="AO" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
-    <pass name="material" vsdefines="AO" psdefines="MATERIAL AO" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP AO" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalAlphaMask.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true">
-    <pass name="base" />
-    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP" sm3="true" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
-    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPacked.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="base" />
-    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP PACKEDNORMAL" sm3="true" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
-    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedAO.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="base" vsdefines="AO" psdefines="AO" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
-    <pass name="material" vsdefines="AO" psdefines="MATERIAL AO" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP PACKEDNORMAL AO" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedAOAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="alpha" vsdefines="AO" psdefines="AO" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedAOAlphaMask.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
-    <pass name="base" vsdefines="AO" psdefines="AO" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
-    <pass name="material" vsdefines="AO" psdefines="MATERIAL AO" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP PACKEDNORMAL AO" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="alpha" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPackedAlphaMask.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true">
-    <pass name="base" />
-    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP PACKEDNORMAL" sm3="true" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
-    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedEmissive.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="base" psdefines="EMISSIVEMAP" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
-    <pass name="material" psdefines="MATERIAL EMISSIVEMAP" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL EMISSIVEMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedEmissiveAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="alpha" psdefines="EMISSIVEMAP" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedEnvCube.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="base" vsdefines="NORMALMAP ENVCUBEMAP" psdefines="NORMALMAP PACKEDNORMAL ENVCUBEMAP" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
-    <pass name="material" vsdefines="NORMALMAP ENVCUBEMAP" psdefines="MATERIAL NORMALMAP PACKEDNORMAL ENVCUBEMAP" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP ENVCUBEMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL ENVCUBEMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedEnvCubeAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="alpha" vsdefines="NORMALMAP ENVCUBEMAP" psdefines="NORMALMAP PACKEDNORMAL ENVCUBEMAP" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPackedSpec.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="base" />
-    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP PACKEDNORMAL SPECMAP" sm3="true" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL SPECMAP" />
-    <pass name="material" psdefines="MATERIAL SPECMAP" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL SPECMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedSpecAO.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="base" vsdefines="AO" psdefines="AO" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL SPECMAP" />
-    <pass name="material" vsdefines="AO" psdefines="MATERIAL SPECMAP AO" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP PACKEDNORMAL SPECMAP AO" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedSpecAOAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="alpha" vsdefines="AO" psdefines="AO" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedSpecAOAlphaMask.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
-    <pass name="base" vsdefines="AO" psdefines="AO" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL SPECMAP" />
-    <pass name="material" vsdefines="AO" psdefines="MATERIAL SPECMAP AO" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP PACKEDNORMAL SPECMAP AO" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedSpecAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="alpha" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPackedSpecAlphaMask.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true">
-    <pass name="base" />
-    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP PACKEDNORMAL SPECMAP" sm3="true" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL SPECMAP" />
-    <pass name="material" psdefines="MATERIAL SPECMAP" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL SPECMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedSpecEmissive.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="base" psdefines="EMISSIVEMAP" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL SPECMAP" />
-    <pass name="material" psdefines="MATERIAL SPECMAP EMISSIVEMAP" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL SPECMAP EMISSIVEMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedSpecEmissiveAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
-    <pass name="alpha" psdefines="EMISSIVEMAP" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL SPECMAP" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalSpecAOAlphaMask.xml

@@ -1,9 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
-    <pass name="base" vsdefines="AO" psdefines="AO" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP SPECMAP" />
-    <pass name="material" vsdefines="AO" psdefines="MATERIAL SPECMAP AO" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP SPECMAP AO" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalSpecAlphaMask.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true">
-    <pass name="base" />
-    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP SPECMAP" sm3="true" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP SPECMAP" />
-    <pass name="material" psdefines="MATERIAL SPECMAP" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP SPECMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffSpecAlphaMask.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
-    <pass name="base" />
-    <pass name="litbase" psdefines="AMBIENT SPECMAP" />
-    <pass name="light" psdefines="SPECMAP" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" psdefines="PREPASS SPECMAP" />
-    <pass name="material" psdefines="MATERIAL SPECMAP" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" psdefines="DEFERRED SPECMAP" />
-    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/NoTextureNormalPacked.xml

@@ -1,10 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid">
-    <pass name="base" />
-    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP PACKEDNORMAL" sm3="true" />
-    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
-    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/NoTextureNormalPackedAlpha.xml

@@ -1,5 +0,0 @@
-<technique vs="LitSolid" ps="LitSolid">
-    <pass name="alpha"  depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureVColAdd.xml

@@ -1,3 +0,0 @@
-<technique vs="Unlit" ps="Unlit" vsdefines="VERTEXCOLOR" psdefines="VERTEXCOLOR">
-    <pass name="alpha" depthwrite="false" blend="add" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureVColAddAlpha.xml

@@ -1,3 +0,0 @@
-<technique vs="Unlit" ps="Unlit" vsdefines="VERTEXCOLOR" psdefines="VERTEXCOLOR">
-    <pass name="alpha" depthwrite="false" blend="addalpha" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureVColMultiply.xml

@@ -1,3 +0,0 @@
-<technique vs="Unlit" ps="Unlit" vsdefines="VERTEXCOLOR" psdefines="VERTEXCOLOR">
-    <pass name="alpha" depthwrite="false" blend="multiply" />
-</technique>

+ 0 - 8
Bin/CoreData/Techniques/VegetationDiffUnlitAlphaMask.xml

@@ -1,8 +0,0 @@
-<technique vs="Vegetation" ps="Unlit" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
-    <pass name="base" />
-    <pass name="prepass" psdefines="PREPASS" />
-    <pass name="material" />
-    <pass name="deferred" psdefines="DEFERRED" />
-    <pass name="depth" vs="VegetationDepth" ps="Depth" psdefines="ALPHAMASK" />
-    <pass name="shadow" vs="VegetationShadow" ps="Shadow" psdefines="ALPHAMASK" />
-</technique>

+ 0 - 563
Bin/Data/LuaScripts/TestScene.lua

@@ -1,563 +0,0 @@
-require "LuaScripts/Utilities/Network"
-
-local testScene
-local camera
-local cameraNode
-
-local yaw = 0
-local pitch = 0
-local drawDebug = 0
-
-function Start()
-    if not engine:IsHeadless() then
-        InitConsole()
-        InitUI()
-    else
-        OpenConsoleWindow()
-    end
-    
-    ParseNetworkArguments()
-
-    InitScene()
-    
-    SubscribeToEvent("Update", "HandleUpdate")
-    SubscribeToEvent("KeyDown", "HandleKeyDown")
-    SubscribeToEvent("MouseMove", "HandleMouseMove")
-    SubscribeToEvent("MouseButtonDown", "HandleMouseButtonDown")
-    SubscribeToEvent("MouseButtonUp", "HandleMouseButtonUp")
-    SubscribeToEvent("PostRenderUpdate", "HandlePostRenderUpdate")
-    SubscribeToEvent("SpawnBox", "HandleSpawnBox")
-    SubscribeToEvent("PhysicsCollision", "HandlePhysicsCollision")
-    
-    network:RegisterRemoteEvent("SpawnBox")
-    
-    if runServer then
-        network:StartServer(serverPort)
-        SubscribeToEvent("ClientConnected", "HandleClientConnected")
-
-        -- Disable physics interpolation to ensure clients get sent physically correct transforms
-        testScene:GetComponent("PhysicsWorld"):SetInterpolation(false)
-    end
-    
-    if runClient then
-        network:Connect(serverAddress, serverPort, testScene)
-    end
-end
-
-function Stop()
-    testScene = nil
-    camera = nil
-    cameraNode = nil
-end
-
-function InitConsole()
-    local uiStyle = cache:GetResource("XMLFile", "UI/DefaultStyle.xml")
-
-    engine:CreateDebugHud()
-    debugHud.defaultStyle = uiStyle
-    debugHud.mode = DEBUGHUD_SHOW_ALL
-
-    engine:CreateConsole()
-    console.defaultStyle = uiStyle
-end
-
-function InitUI()
-    local uiStyle = cache:GetResource("XMLFile", "UI/DefaultStyle.xml")
-    
-    local newCursor = Cursor:new()
-    newCursor.styleAuto = uiStyle
-    newCursor.position = IntVector2(graphics:GetWidth()/ 2, graphics:GetHeight() / 2)
-    ui.cursor = newCursor
-    
-    if GetPlatform() == "Android" or GetPlatform() == "iOS" then
-        ui.cursor.visible = false
-    end
-end
-
-function InitScene()
-    testScene = Scene()
-    
-    -- Create the camera outside the scene so it is unaffected by scene load/save
-    cameraNode = Node()
-    camera = cameraNode:CreateComponent("Camera")
-    cameraNode.position = Vector3(0, 2, 0)
-
-    if not engine:IsHeadless() then
-        renderer:SetViewport(0, Viewport:new(testScene, camera))
-        
-        -- Add bloom & FXAA effects to the renderpath. Clone the default renderpath so that we don't affect it
-        -- local newRenderPathPtr = renderer:GetViewport(0):GetRenderPath():Clone()
-        -- local newRenderPath = newRenderPathPtr:Get()
-        local newRenderPath = renderer:GetViewport(0):GetRenderPath():Clone()
-        newRenderPath:Append(cache:GetResource("XMLFile", "PostProcess/Bloom.xml"))
-        newRenderPath:Append(cache:GetResource("XMLFile", "PostProcess/EdgeFilter.xml"))
-        newRenderPath:SetEnabled("Bloom", false)
-        newRenderPath:SetEnabled("EdgeFilter", false)
-        renderer:GetViewport(0):SetRenderPath(newRenderPath)
-        audio:SetListener(cameraNode:CreateComponent("SoundListener"))
-    end
-    
-    if runClient then
-        return
-    end
-
-    local world = testScene:CreateComponent("PhysicsWorld")
-    testScene:CreateComponent("Octree")
-    testScene:CreateComponent("DebugRenderer")
-
-    local zoneNode = testScene:CreateChild("Zone")
-    local zone = zoneNode:CreateComponent("Zone")
-    zone.ambientColor = Color(0.15, 0.15, 0.15)
-    zone.fogColor = Color(0.5, 0.5, 0.7)
-    zone.fogStart = 100.0
-    zone.fogEnd = 300.0
-    zone.boundingBox = BoundingBox(-1000, 1000)
-    
-    if true then
-        local lightNode = testScene:CreateChild("GlobalLight")
-        lightNode.direction = Vector3(0.3, -0.5, 0.425)
-        
-        local light = lightNode:CreateComponent("Light")
-        light.lightType = LIGHT_DIRECTIONAL
-        light.castShadows = true
-        light.shadowBias = BiasParameters(0.00025, 0.5)
-        light.shadowCascade = CascadeParameters(10.0, 50.0, 200.0, 0.0, 0.8)
-        light.specularIntensity = 0.5
-    end
-
-    if true then
-        local objectNode = testScene:CreateChild("Floor")
-        objectNode.position = Vector3(0, -0.5, 0)
-        objectNode.scale = Vector3(200, 1, 200)
-        
-        local object = objectNode:CreateComponent("StaticModel")
-        object.model = cache:GetResource("Model", "Models/Box.mdl")
-        object.material = cache:GetResource("Material", "Materials/StoneTiled.xml")
-        object.occluder = true
-
-        local body = objectNode:CreateComponent("RigidBody")
-        local shape = objectNode:CreateComponent("CollisionShape")
-        shape:SetBox(Vector3(1, 1, 1))
-    end
-
-    for i = 1, 50 do
-        local objectNode = testScene:CreateChild("Box")
-        objectNode.position = Vector3(Random() * 180 - 90, 1, Random() * 180 - 90)
-        objectNode:SetScale(2)
-
-        local object = objectNode:CreateComponent("StaticModel")
-        object.model = cache:GetResource("Model", "Models/Box.mdl")
-        object.material = cache:GetResource("Material", "Materials/Stone.xml")
-        object.castShadows = true
-
-        local body = objectNode:CreateComponent("RigidBody")
-        local shape = objectNode:CreateComponent("CollisionShape")
-        shape:SetBox(Vector3(1, 1, 1))
-    end
-
-    for i = 1, 10 do
-        local objectNode = testScene:CreateChild("Box")
-        objectNode.position = Vector3(Random() * 180 - 90, 10, Random() * 180 - 90)
-        objectNode:SetScale(20)
-
-        local object = objectNode:CreateComponent("StaticModel")
-        object.model = cache:GetResource("Model", "Models/Box.mdl")
-        object.material = cache:GetResource("Material", "Materials/Stone.xml")
-        object.castShadows = true
-        object.occluder = true
-
-        local body = objectNode:CreateComponent("RigidBody")
-        local shape = objectNode:CreateComponent("CollisionShape")
-        shape:SetBox(Vector3(1, 1, 1))
-    end
-    
-    
-    
-    for i = 1, 50 do
-        local objectNode = testScene:CreateChild("Mushroom")
-        objectNode.position = Vector3(Random() * 180 - 90, 0, Random() * 180 - 90)
-        objectNode.rotation = Quaternion(0, Random(360.0), 0)
-        objectNode:SetScale(5)
-
-        local object = objectNode:CreateComponent("StaticModel")
-        object.model = cache:GetResource("Model", "Models/Mushroom.mdl")
-        object.material = cache:GetResource("Material", "Materials/Mushroom.xml")
-        object.castShadows = true
-
-        local body = objectNode:CreateComponent("RigidBody")
-        local shape = objectNode:CreateComponent("CollisionShape")
-        shape:SetTriangleMesh(object:GetModel())
-    end
-
-    
-    for i = 1, 50 do
-        local objectNode = testScene:CreateChild("Jack")
-        objectNode:SetPosition(Vector3(Random() * 180 - 90, 0, Random() * 180 - 90))
-        objectNode:SetRotation(Quaternion(0, Random() * 360, 0))
-
-        local object = objectNode:CreateComponent("AnimatedModel")
-        object.model = cache:GetResource("Model", "Models/Jack.mdl")
-        object.material = cache:GetResource("Material", "Materials/Jack.xml")
-        object.castShadows = true
-        
-        -- Create a capsule shape for detecting collisions
-        local body = objectNode:CreateComponent("RigidBody")
-        body.trigger = true
-        
-        local shape = objectNode:CreateComponent("CollisionShape")
-        shape:SetCapsule(0.7, 1.8, Vector3(0.0, 0.9, 0.0))
-        local ctrl = objectNode:CreateComponent("AnimationController")
-        ctrl:Play("Models/Jack_Walk.ani", 0, true, 0.0)
-    end
-end
-
-function HandleUpdate(eventType, eventData)
-    local timeStep = eventData:GetFloat("TimeStep")
-    
-    if ui:GetFocusElement() == nil then
-        local speedMultiplier = 1.0
-        if input:GetKeyDown(KEY_LSHIFT) then
-            speedMultiplier = 5.0
-        end        
-        if input:GetKeyDown(KEY_LCTRL) then
-            speedMultiplier = 0.1
-        end
-        
-        local speed = timeStep * speedMultiplier
-        
-        if input:GetKeyDown(KEY_W) then
-            cameraNode:Translate(Vector3(0, 0, 10) * speed)
-        end
-        if input:GetKeyDown(KEY_S) then
-            cameraNode:Translate(Vector3(0, 0, -10) * speed)
-        end
-        if input:GetKeyDown(KEY_A) then
-            cameraNode:Translate(Vector3(-10, 0, 0) * speed)
-        end
-        if input:GetKeyDown(KEY_D) then
-            cameraNode:Translate(Vector3(10, 0, 0) * speed)
-        end
-    end    
-end
-
-function HandleKeyDown(eventType, eventData)
-    local key = eventData:GetInt("Key")
-
-    if key == KEY_ESC then
-        if ui:GetFocusElement() == nil then
-            engine:Exit()
-        else
-            console:SetVisible(false)
-        end
-    end
-
-    if key == KEY_F1 then
-        console:Toggle()
-    end
-    
-    if ui:GetFocusElement() == nil then
-        if key == KEY_1 then
-            local quality = renderer:GetTextureQuality()
-            quality = quality + 1
-            if quality > 2 then
-                quality = 0
-            end
-            renderer:SetTextureQuality(quality)
-        end
-        
-        if key == KEY_2 then
-            local quality = renderer:GetMaterialQuality()
-            quality = quality + 1
-            if quality > 2 then
-                quality = 0
-            end
-            renderer:SetMaterialQuality(quality)
-        end
-        
-        if key == KEY_3 then
-            renderer:SetSpecularLighting(not renderer:GetSpecularLighting())
-        end
-
-        if key == KEY_4 then
-            renderer:SetDrawShadows(not renderer:GetDrawShadows())
-        end
-
-        if key == KEY_5 then
-            local size = renderer:GetShadowMapSize()
-            size = size * 2
-            if size > 2048 then
-                size = 512
-            end
-            renderer:SetShadowMapSize(size)
-        end
-
-        if key == KEY_6 then
-            renderer:SetShadowQuality(renderer:GetShadowQuality() + 1)
-        end
-
-        if key == KEY_7 then
-            local occlusion = renderer:GetMaxOccluderTriangles() > 0
-            occlusion = not occlusion
-            if occlusion then
-                renderer:SetMaxOccluderTriangles(5000)
-            else
-                renderer:SetMaxOccluderTriangles(0)
-            end
-        end
-        
-        if key == KEY_8 then
-            renderer:SetDynamicInstancing(not renderer:GetDynamicInstancing())
-        end
-
-        if key == KEY_SPACE then
-            drawDebug = drawDebug + 1
-            if drawDebug > 2 then
-                drawDebug = 0
-            end
-        end
-
-        if key == KEY_B then
-            renderer:GetViewport(0):GetRenderPath():ToggleEnabled("Bloom")
-        end
-
-        if key == KEY_F then
-            renderer:GetViewport(0):GetRenderPath():ToggleEnabled("EdgeFilter")
-        end
-
-        if key == KEY_O then
-            camera:SetOrthographic(not camera:IsOrthographic())
-        end
-
-        if key == KEY_T then
-            debugHud:Toggle(DEBUGHUD_SHOW_PROFILER)
-        end
-        
-        
-        if key == KEY_F5  then
-            testScene:SaveXML(fileSystem:GetProgramDir() + "Data/Scenes/LuaTestScene.xml")
-        end
-        
-        if key == KEY_F7 then
-            testScene:LoadXML(fileSystem:GetProgramDir() + "Data/Scenes/LuaTestScene.xml")
-        end
-    end    
-end
-
-function HandleMouseMove(eventType, eventData)
-    local buttons = eventData:GetInt("Buttons")
-    if buttons == MOUSEB_RIGHT then
-        local mousedx = eventData:GetInt("DX")
-        local mousedy = eventData:GetInt("DY")
-        yaw = yaw + (mousedx / 10.0)
-        pitch = pitch + (mousedy / 10.0)
-        if pitch < -90.0 then
-            pitch = -90.0
-        end
-        if pitch > 90.0 then
-            pitch = 90.0
-        end
-        cameraNode:SetRotation(Quaternion(pitch, yaw, 0))
-    end
-end
-
-
-function HandleMouseButtonDown(eventType, eventData)
-    local button = eventData:GetInt("Button")
-    if button == MOUSEB_RIGHT then
-        local cursor = ui:GetCursor()
-        cursor:SetVisible(false)        
-    end    
-    
-    -- Test either creating a new physics object or painting a decal (SHIFT down)
-    if button == MOUSEB_LEFT and ui:GetElementAt(ui:GetCursorPosition(), true) == nil and ui:GetFocusElement() == nil then
-        if not input:GetQualifierDown(QUAL_SHIFT) then
-            local eventData = VariantMap()
-            eventData:SetVector3("Pos", cameraNode:GetPosition())
-            eventData:SetQuaternion("Rot", cameraNode:GetRotation())
-
-            -- If we are the client, send the spawn command as a remote event, else send locally
-            if runClient then
-                if network:GetServerConnection() ~= nil then
-                    network:GetServerConnection():SendRemoteEvent("SpawnBox", true, eventData)
-                end
-            else
-                SendEvent("SpawnBox", eventData)
-            end
-        else
-            local pos = ui:GetCursorPosition()
-            if ui:GetElementAt(pos, true) == nil and testScene:GetComponent("Octree") ~= nil then
-                local cameraRay = camera:GetScreenRay(pos.x / graphics:GetWidth(), pos.y / graphics:GetHeight())
-                local result = testScene:GetComponent("Octree"):RaycastSingle(cameraRay, RAY_TRIANGLE, 250.0, DRAWABLE_GEOMETRY)
-                if result.drawable ~= nil then
-                    local rayHitPos = cameraRay.origin + cameraRay.direction * result.distance
-                    local decal = result.drawable:GetNode():GetComponent("DecalSet")
-                    if decal == nil then
-                        decal = result.drawable:GetNode():CreateComponent("DecalSet")
-                        decal.material = cache:GetResource("Material", "Materials/UrhoDecal.xml")
-                        -- Increase max. vertices/indices if the target is skinned
-                        if result.drawable:GetTypeName() == "AnimatedModel" then
-                            decal.maxVertices = 2048
-                            decal.maxIndices = 4096
-                        end
-                    end
-                    decal:AddDecal(result.drawable, rayHitPos, cameraNode:GetWorldRotation(), 0.5, 1.0, 1.0, Vector2(0, 0), Vector2(1, 1))
-                end
-            end
-        end
-    end
-end
-
-function HandleSpawnBox(eventType, eventData)
-    local position = eventData:GetVector3("Pos")
-    local rotation = eventData:GetQuaternion("Rot")
-    
-    local newNode = testScene:CreateChild("")
-    newNode.position = position
-    newNode.rotation =rotation
-    newNode:SetScale(0.2)
-    
-    local body = newNode:CreateComponent("RigidBody")
-    body.mass = 1.0
-    body.friction = 1.0
-    body.linearVelocity = rotation * Vector3(0.0, 1.0, 10.0)
-
-    local shape = newNode:CreateComponent("CollisionShape")
-    shape:SetBox(Vector3(1, 1, 1))
-
-    local object = newNode:CreateComponent("StaticModel")
-    object.model = cache:GetResource("Model", "Models/Box.mdl")
-    object.material = cache:GetResource("Material", "Materials/StoneSmall.xml")
-    object.castShadows = true
-    object.shadowDistance = 150.0
-    object.drawDistance = 200.0
-end
-
-function HandleMouseButtonUp(eventType, eventData)
-    if eventData:GetInt("Button") == MOUSEB_RIGHT then
-        ui:GetCursor():SetVisible(true)
-    end
-end
-
-function HandlePostRenderUpdate()
-    if engine.headless then
-        return
-    end
-    
-    -- Draw rendering debug geometry without depth test to see the effect of occlusion
-    if drawDebug == 1 then
-        renderer:DrawDebugGeometry(true)
-    end
-    if drawDebug == 2 then
-        testScene:GetComponent("PhysicsWorld"):DrawDebugGeometry(true)
-    end
-    
-    local pos = ui.cursorPosition
-    if ui:GetElementAt(pos, true) == nil and testScene:GetComponent("Octree") ~= nil then
-        local cameraRay = camera:GetScreenRay(pos.x / graphics:GetWidth(), pos.y / graphics:GetHeight())
-        local result = testScene:GetComponent("Octree"):RaycastSingle(cameraRay, RAY_TRIANGLE, 250.0, DRAWABLE_GEOMETRY)
-        if result.drawable ~= nil then
-            local rayHitPos = cameraRay.origin + cameraRay.direction * result.distance
-            testScene:GetComponent("DebugRenderer"):AddBoundingBox(BoundingBox(rayHitPos + Vector3(-0.01, -0.01, -0.01), rayHitPos +
-                Vector3(0.01, 0.01, 0.01)), Color(1.0, 1.0, 1.0), true)
-        end
-    end
-end
-
-function HandleClientConnected(eventType, eventData)
-    local connection = eventData:GetPtr("Connection", "Connection")
-    connection.scene = testScene -- Begin scene replication to the client
-    connection.logStatistics = true
-end
-
-
-function HandlePhysicsCollision(eventType, eventData)
-    -- Check if either of the nodes has an AnimatedModel component
-    local nodeA = eventData:GetPtr("Node", "NodeA")
-    local nodeB = eventData:GetPtr("Node", "NodeB")
-    if nodeA:HasComponent("AnimatedModel") then
-        HandleHit(nodeA)
-    elseif nodeB:HasComponent("AnimatedModel") then
-        HandleHit(nodeB)
-    end
-end
-
-function HandleHit(node)
-    -- Remove the trigger physics shape, and create the ragdoll
-    node:RemoveComponent("RigidBody")
-    node:RemoveComponent("CollisionShape")
-    CreateRagdoll(node:GetComponent("AnimatedModel"))
-end
-
-function CreateRagdoll(model)
-    local root = model:GetNode()
-    CreateRagdollBone(root, "Bip01_Pelvis", SHAPE_BOX, Vector3(0.3, 0.2, 0.25), Vector3(0, 0, 0), Quaternion(0, 0, 0))
-    CreateRagdollBone(root, "Bip01_Spine1", SHAPE_BOX, Vector3(0.35, 0.2, 0.3), Vector3(0.15, 0, 0), Quaternion(0, 0, 0))
-    CreateRagdollBone(root, "Bip01_L_Thigh", SHAPE_CAPSULE, Vector3(0.175, 0.45, 0.175), Vector3(0.25, 0, 0), Quaternion(0, 0, 90))
-    CreateRagdollBone(root, "Bip01_R_Thigh", SHAPE_CAPSULE, Vector3(0.175, 0.45, 0.175), Vector3(0.25, 0, 0), Quaternion(0, 0, 90))
-    CreateRagdollBone(root, "Bip01_L_Calf", SHAPE_CAPSULE, Vector3(0.15, 0.55, 0.15), Vector3(0.25, 0, 0), Quaternion(0, 0, 90))
-    CreateRagdollBone(root, "Bip01_R_Calf", SHAPE_CAPSULE, Vector3(0.15, 0.55, 0.15), Vector3(0.25, 0, 0), Quaternion(0, 0, 90))
-    CreateRagdollBone(root, "Bip01_Head", SHAPE_BOX, Vector3(0.2, 0.2, 0.2), Vector3(0.1, 0, 0), Quaternion(0, 0, 0))
-    CreateRagdollBone(root, "Bip01_L_UpperArm", SHAPE_CAPSULE, Vector3(0.15, 0.35, 0.15), Vector3(0.1, 0, 0), Quaternion(0, 0, 90))
-    CreateRagdollBone(root, "Bip01_R_UpperArm", SHAPE_CAPSULE, Vector3(0.15, 0.35, 0.15), Vector3(0.1, 0, 0), Quaternion(0, 0, 90))
-    CreateRagdollBone(root, "Bip01_L_Forearm", SHAPE_CAPSULE, Vector3(0.125, 0.4, 0.125), Vector3(0.2, 0, 0), Quaternion(0, 0, 90))
-    CreateRagdollBone(root, "Bip01_R_Forearm", SHAPE_CAPSULE, Vector3(0.125, 0.4, 0.125), Vector3(0.2, 0, 0), Quaternion(0, 0, 90))
-    
-    CreateRagdollConstraint(root, "Bip01_L_Thigh", "Bip01_Pelvis", CONSTRAINT_CONETWIST, Vector3(0, 0, -1), Vector3(0, 0, 1), Vector2(45, 45), Vector2(0, 0), true)
-    CreateRagdollConstraint(root, "Bip01_R_Thigh", "Bip01_Pelvis", CONSTRAINT_CONETWIST, Vector3(0, 0, -1), Vector3(0, 0, 1), Vector2(45, 45), Vector2(0, 0), true)
-    CreateRagdollConstraint(root, "Bip01_L_Calf", "Bip01_L_Thigh", CONSTRAINT_HINGE, Vector3(0, 0, -1), Vector3(0, 0, -1), Vector2(90, 0), Vector2(0, 0), true)
-    CreateRagdollConstraint(root, "Bip01_R_Calf", "Bip01_R_Thigh", CONSTRAINT_HINGE, Vector3(0, 0, -1), Vector3(0, 0, -1), Vector2(90, 0), Vector2(0, 0), true)
-    CreateRagdollConstraint(root, "Bip01_Spine1", "Bip01_Pelvis", CONSTRAINT_HINGE, Vector3(0, 0, 1), Vector3(0, 0, 1), Vector2(45, 0), Vector2(-10, 0), true)
-    CreateRagdollConstraint(root, "Bip01_Head", "Bip01_Spine1", CONSTRAINT_CONETWIST, Vector3(1, 0, 0), Vector3(1, 0, 0), Vector2(0, 30), Vector2(0, 0), true)
-    CreateRagdollConstraint(root, "Bip01_L_UpperArm", "Bip01_Spine1", CONSTRAINT_CONETWIST, Vector3(0, -1, 0), Vector3(0, 1, 0), Vector2(45, 45), Vector2(0, 0), false)
-    CreateRagdollConstraint(root, "Bip01_R_UpperArm", "Bip01_Spine1", CONSTRAINT_CONETWIST, Vector3(0, -1, 0), Vector3(0, 1, 0), Vector2(45, 45), Vector2(0, 0), false)
-    CreateRagdollConstraint(root, "Bip01_L_Forearm", "Bip01_L_UpperArm", CONSTRAINT_HINGE, Vector3(0, 0, -1), Vector3(0, 0, -1), Vector2(90, 0), Vector2(0, 0), true)
-    CreateRagdollConstraint(root, "Bip01_R_Forearm", "Bip01_R_UpperArm", CONSTRAINT_HINGE, Vector3(0, 0, -1), Vector3(0, 0, -1), Vector2(90, 0), Vector2(0, 0), true)
-
-    -- Disable animation from all bones (both physical and non-physical) to not interfere
-    local skel = model:GetSkeleton()
-    for i = 1, skel:GetNumBones() do
-        skel:GetBone(i-1).animated = false
-    end
-end
-
-function CreateRagdollBone(root, boneName, type, size, position, rotation)
-    local boneNode = root:GetChild(boneName, true)
-    if boneNode == nil or boneNode:HasComponent("RigidBody") then
-        return
-    end
-
-    -- In networked operation both client and server detect collisions separately, and create ragdolls on their own
-    -- (bones are not synced over network.) To prevent replicated component ID range clashes when the client creates
-    -- any components, it is important that the LOCAL creation mode is specified.
-    local body = boneNode:CreateComponent("RigidBody", LOCAL)
-    body.mass = 1.0
-    body.linearDamping = 0.05
-    body.angularDamping = 0.85
-    body.linearRestThreshold = 1.5
-    body.angularRestThreshold = 2.5
-
-    local shape = boneNode:CreateComponent("CollisionShape", LOCAL)
-    shape.shapeType = type
-    shape.size = size
-    shape.position = position
-    shape.rotation = rotation
-end
-
-function CreateRagdollConstraint(root, boneName, parentName, type, axis, parentAxis, highLimit, lowLimit, disableCollision)
-    local boneNode = root:GetChild(boneName, true)
-    local parentNode = root:GetChild(parentName, true)
-    if boneNode == nil or parentNode == nil or boneNode:HasComponent("Constraint") then
-        return
-    end
-
-    local constraint = boneNode:CreateComponent("Constraint", LOCAL)
-    constraint.constraintType = type
-    constraint.disableCollision = disableCollision
-    -- The connected body must be specified before setting the world position
-    constraint.otherBody = parentNode:GetComponent("RigidBody")
-    constraint.worldPosition = boneNode.worldPosition
-    constraint:SetAxis(axis)
-    constraint:SetOtherAxis(parentAxis)
-    constraint.highLimit = highLimit
-    constraint.lowLimit = lowLimit
-end

BIN
Bin/Data/Models/Box.mdl


BIN
Bin/Data/Models/Cone.mdl


BIN
Bin/Data/Models/Cylinder.mdl


BIN
Bin/Data/Models/Jack.mdl


BIN
Bin/Data/Models/Jack_Walk.ani


BIN
Bin/Data/Models/Plane.mdl


BIN
Bin/Data/Models/Pyramid.mdl


BIN
Bin/Data/Models/Sphere.mdl


BIN
Bin/Data/Models/Torus.mdl


BIN
Bin/Data/Textures/Editor/EditorIcons.png


BIN
Bin/Data/Textures/OldUI.png


+ 0 - 5
Bin/Data/Textures/OldUI.xml

@@ -1,5 +0,0 @@
-<texture>
-    <mipmap enable="false" />
-    <quality low="0" />
-</texture>
-

BIN
Bin/Data/Textures/UI.png


+ 0 - 66
Bin/Data/UI/EditorHierarchyWindow.xml

@@ -1,66 +0,0 @@
-<element type="Window">
-    <attribute name="Name" value="HierarchyWindow" />
-    <attribute name="Is Movable" value="true" />
-    <attribute name="Is Resizable" value="true" />
-    <attribute name="Resize Border" value="6 6 6 6" />
-    <attribute name="Layout Mode" value="Vertical" />
-    <attribute name="Layout Spacing" value="4" />
-    <attribute name="Layout Border" value="6 6 6 6" />
-    <element>
-        <attribute name="Min Size" value="0 16" />
-        <attribute name="Max Size" value="2147483647 16" />
-        <attribute name="Layout Mode" value="Horizontal" />
-        <element type="Text">
-            <attribute name="Text" value="Hierarchy" />
-        </element>
-        <element type="Button" style="CloseButton">
-            <attribute name="Name" value="CloseButton" />
-        </element>
-    </element>
-    <element type="BorderImage" style="EditorDivider" />
-    <element>
-        <attribute name="Min Size" value="0 17" />
-        <attribute name="Max Size" value="2147483647 17" />
-        <attribute name="Layout Mode" value="Horizontal" />
-        <attribute name="Layout Spacing" value="4" />
-        <element type="Button">
-            <attribute name="Name" value="ExpandButton" />
-            <attribute name="Min Size" value="70 17" />
-            <attribute name="Max Size" value="70 17" />
-            <attribute name="Layout Mode" value="Horizontal" />
-            <attribute name="Layout Border" value="1 1 1 1" />
-            <element type="Text">
-                <attribute name="Text" value="Expand" />
-                <attribute name="Text Alignment" value="Center" />
-            </element>
-        </element>
-        <element type="Button">
-            <attribute name="Name" value="CollapseButton" />
-            <attribute name="Min Size" value="70 17" />
-            <attribute name="Max Size" value="70 17" />
-            <attribute name="Layout Mode" value="Horizontal" />
-            <attribute name="Layout Border" value="1 1 1 1" />
-            <element type="Text">
-                <attribute name="Text" value="Collapse" />
-                <attribute name="Text Alignment" value="Center" />
-            </element>
-        </element>
-        <element type="CheckBox">
-            <attribute name="Name" value="AllCheckBox" />
-            <attribute name="Min Size" value="45 15" />
-            <attribute name="Max Size" value="45 15" />
-            <attribute name="Indent Spacing" value="30" />
-            <attribute name="Indent" value="1" />
-            <attribute name="Layout Mode" value="Horizontal" />
-            <attribute name="Layout Border" value="5 1 1 1" />
-            <element type="Text">
-                <attribute name="Text" value="All" />
-            </element>
-        </element>
-    </element>
-    <element type="ListView" style="HierarchyListView">
-        <attribute name="Name" value="HierarchyList" />
-        <attribute name="Highlight Mode" value="Always" />
-        <attribute name="Multiselect" value="true" />
-    </element>
-</element>

+ 0 - 259
Bin/Data/UI/OldStyle.xml

@@ -1,259 +0,0 @@
-<elements>
-    <element type="BorderImage" >
-        <attribute name="Texture" value="Texture2D;Textures/OldUI.png" />
-    </element>
-    <element type="Button" style="BorderImage">
-        <attribute name="Size" value="16 16" />
-        <attribute name="Image Rect" value="16 0 32 16" />
-        <attribute name="Border" value="4 4 4 4" />
-        <attribute name="Pressed Image Offset" value="16 0" />
-        <attribute name="Hover Image Offset" value="0 16" />
-        <attribute name="Pressed Child Offset" value="-1 1" />
-    </element>
-    <element type="CheckBox" style="BorderImage">
-        <attribute name="Min Size" value="16 16" />
-        <attribute name="Max Size" value="16 16" />
-        <attribute name="Image Rect" value="64 0 80 16" />
-        <attribute name="Border" value="4 4 4 4" />
-        <attribute name="Checked Image Offset" value="16 0" />
-        <attribute name="Hover Image Offset" value="0 16" />
-    </element>
-    <element type="CloseButton" style="Button" auto="false">    <!-- non-auto style is shown explicitly in the Editor's style drop down list for user selection -->
-        <attribute name="Min Size" value="16 16" />
-        <attribute name="Max Size" value="16 16" />
-        <attribute name="Image Rect" value="128 0 144 16" />
-    </element>
-    <element type="Cursor">
-        <attribute name="Shapes">
-            <variant type="Int" value="8" />
-            <variant type="String" value="Normal" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="0 0 12 24" />
-            <variant type="IntVector2" value="0 0" />
-            <variant type="String" value="ResizeVertical" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="0 64 20 84" />
-            <variant type="IntVector2" value="9 9" />
-            <variant type="String" value="ResizeDiagonalTopRight" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="20 64 40 84" />
-            <variant type="IntVector2" value="9 9" />
-            <variant type="String" value="ResizeHorizontal" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="40 64 60 84" />
-            <variant type="IntVector2" value="9 9" />
-            <variant type="String" value="ResizeDiagonalTopLeft" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="60 64 80 84" />
-            <variant type="IntVector2" value="9 9" />
-            <variant type="String" value="RejectDrop" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="80 64 100 84" />
-            <variant type="IntVector2" value="9 9" />
-            <variant type="String" value="AcceptDrop" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="100 64 128 90" />
-            <variant type="IntVector2" value="0 0" />
-            <variant type="String" value="Busy" />
-            <variant type="ResourceRef" value="Image;Textures/OldUI.png" />
-            <variant type="IntRect" value="128 64 148 85" />
-            <variant type="IntVector2" value="9 9" />
-        </attribute>
-    </element>
-    <element type="DropDownList" style="BorderImage">
-        <attribute name="Image Rect" value="16 0 32 16" />
-        <attribute name="Border" value="4 4 4 4" />
-        <attribute name="Pressed Image Offset" value="16 0" />
-        <attribute name="Hover Image Offset" value="0 16" />
-        <attribute name="Pressed Child Offset" value="-1 1" />
-        <attribute name="Layout Mode" value="Horizontal" />
-        <attribute name="Layout Border" value="4 1 4 1" />
-        <element internal="true">
-            <element type="Text" internal="true" />
-        </element>
-        <element type="Window" internal="true" popup="true">
-            <attribute name="Layout Border" value="2 2 2 2" />
-            <element type="ListView" internal="true">
-                <attribute name="Highlight Mode" value="Always" />
-                <element type="BorderImage" internal="true">    <!-- Override scroll panel attributes from default ListView -->
-                    <attribute name="Image Rect" value="96 0 112 16" />
-                    <attribute name="Border" value="2 2 2 2" />
-                </element>
-            </element>
-        </element>
-    </element>
-    <element type="LineEdit" style="BorderImage">
-        <attribute name="Image Rect" value="112 0 128 16" />
-        <attribute name="Border" value="2 2 2 2" />
-        <attribute name="Clip Border" value="1 1 1 1" />
-        <attribute name="Hover Image Offset" value="0 16" />    <!-- Background color of the hover image IS the hover color of LineEdit -->
-        <element type="Text" internal="true">
-            <attribute name="Selection Color" value="0.7 0.7 0.7 1" />
-        </element>
-        <element type="BorderImage" internal="true">
-            <attribute name="Size" value="4 16" />
-            <attribute name="Priority" value="1" />
-            <attribute name="Image Rect" value="12 0 16 16" />
-        </element>
-    </element>
-    <element type="ListView" style="ScrollView" />  <!-- Shortcut to copy all the styles from ScrollView -->
-    <element type="ListViewHierarchyOverlay" style="BorderImage">
-        <attribute name="Min Size" value="16 16" />
-        <attribute name="Max Size" value="16 16" />
-        <attribute name="Image Rect" value="160 0 176 16" />
-        <attribute name="Checked Image Offset" value="16 0" />
-        <attribute name="Hover Image Offset" value="0 16" />
-    </element>
-    <element type="Menu" style="BorderImage">
-        <attribute name="Image Rect" value="96 0 112 16" />
-        <attribute name="Border" value="2 2 2 2" />
-        <attribute name="Pressed Image Offset" value="16 0" />
-        <attribute name="Hover Image Offset" value="0 16" />
-    </element>
-    <element type="ScrollBar">
-        <attribute name="Left Image Rect" value="32 32 48 48" />
-        <attribute name="Up Image Rect" value="0 32 16 48" />
-        <attribute name="Right Image Rect" value="48 32 64 48" />
-        <attribute name="Down Image Rect" value="16 32 32 48" />
-        <element type="Button" internal="true">
-            <attribute name="Size" value="12 12" />
-            <attribute name="Border" value="3 3 3 3" />
-            <attribute name="Pressed Image Offset" value="64 0" />
-            <attribute name="Hover Image Offset" value="0 16" />
-        </element>
-        <element type="Slider" internal="true">
-            <attribute name="Size" value="12 12" />
-            <attribute name="Image Rect" value="112 0 128 16" />
-            <attribute name="Border" value="3 3 3 3" />
-            <element type="BorderImage" internal="true">
-                <attribute name="Image Rect" value="48 0 64 16" />
-                <attribute name="Border" value="4 4 4 4" />
-                <attribute name="Hover Image Offset" value="0 16" />
-            </element>
-        </element>
-        <element type="Button" internal="true">
-            <attribute name="Size" value="12 12" />
-            <attribute name="Border" value="3 3 3 3" />
-            <attribute name="Pressed Image Offset" value="64 0" />
-            <attribute name="Hover Image Offset" value="0 16" />
-        </element>
-    </element>
-    <element type="ScrollView">
-        <element type="ScrollBar" internal="true">
-            <attribute name="Size" value="0 12" />
-        </element>
-        <element type="ScrollBar" internal="true">
-            <attribute name="Size" value="12 0" />
-        </element>
-        <element type="BorderImage" internal="true">
-            <attribute name="Image Rect" value="112 0 128 16" />
-            <attribute name="Border" value="2 2 2 2" />
-            <attribute name="Clip Border" value="1 1 1 1" />
-        </element>
-    </element>
-    <element type="Slider" style="BorderImage">
-        <attribute name="Size" value="12 12" />
-        <attribute name="Image Rect" value="112 0 128 16" />
-        <attribute name="Border" value="3 3 3 3" />
-        <element type="BorderImage" internal="true">
-            <attribute name="Image Rect" value="48 0 64 16" />
-            <attribute name="Border" value="4 4 4 4" />
-            <attribute name="Hover Image Offset" value="0 16" />
-        </element>
-    </element>
-    <element type="Window" style="BorderImage">
-        <attribute name="Image Rect" value="48 0 64 16" />
-        <attribute name="Border" value="3 3 3 3" />
-        <attribute name="Resize Border" value="8 8 8 8" />
-    </element>
-    <element type="Text">
-        <attribute name="Font" value="Font;Fonts/Anonymous Pro.ttf" />
-        <attribute name="Font Size" value="11" />
-    </element>
-    <element type="DebugHudText" style="Text" auto="false" />
-    <element type="ConsoleBackground" auto="false">
-        <attribute name="Top Left Color" value="0 0.25 0 0.75" />
-        <attribute name="Top Right Color" value="0 0.25 0 0.75" />
-        <attribute name="Bottom Left Color" value="0.25 0.75 0.25 0.75" />
-        <attribute name="Bottom Right Color" value="0.25 0.75 0.25 0.75" />
-        <attribute name="Layout Border" value="4 4 4 4" />
-    </element>
-    <element type="ConsoleText" style="Text" auto="false" />
-    <element type="ConsoleHighlightedText" style="Text" auto="false">
-        <attribute name="Color" value="0.75 0 0 1" />
-    </element>
-    <element type="ConsoleLineEdit" style="LineEdit" auto="false">
-        <attribute name="Min Size" value="0 17" />
-        <attribute name="Max Size" value="2147483647 17" />
-        <attribute name="Top Left Color" value="0 0 0 0.5" />
-        <attribute name="Top Right Color" value="0 0 0 0.5" />
-        <attribute name="Bottom Left Color" value="0 0 0 0.5" />
-        <attribute name="Bottom Right Color" value="0 0 0 0.5" />
-        <element type="Text" internal="true" style="none">
-            <attribute name="Selection Color" value="0 0.5 0 0.75" />
-        </element>
-    </element>
-    <element type="FileSelector" style="Window" auto="false">
-        <attribute name="Size" value="400 300" />
-        <attribute name="Is Movable" value="true" />
-        <attribute name="Is Resizable" value="true" />
-        <attribute name="Resize Border" value="6 6 6 6" />
-        <attribute name="Layout Mode" value="vertical" />
-        <attribute name="Layout Spacing" value="4" />
-        <attribute name="Layout Border" value="6 6 6 6" />
-        <attribute name="Modal Shade Color" value="0.45 0.70 0.45 0.05" />
-        <attribute name="Modal Frame Color" value="0.45 0.70 0.45" />
-        <attribute name="Modal Frame Size" value="2 2" />
-    </element>
-    <element type="FileSelectorButton" style="Button" auto="false">
-        <attribute name="Min Size" value="80 22" />
-        <attribute name="Max Size" value="80 22" />
-    </element>
-    <element type="FileSelectorButtonText" style="Text" auto="false" />
-    <element type="FileSelectorListView" style="ListView" auto="false" />
-    <element type="FileSelectorLineEdit" style="LineEdit" auto="false">
-        <attribute name="Min Size" value="0 17" />
-        <attribute name="Max Size" value="2147483647 17" />
-    </element>
-    <element type="FileSelectorFilterList" style="DropDownList" auto="false">
-        <attribute name="Min Size" value="64 18" />
-        <attribute name="Max Size" value="64 18" />
-        <attribute name="Resize Popup" value="true" />
-    </element>
-    <element type="FileSelectorFilterText" style="Text" auto="false">
-        <attribute name="Is Enabled" value="true" />
-        <attribute name="Selection Color" value="0.7 0.7 0.7 1" />
-        <attribute name="Hover Color" value="0.45 0.7 0.45 1" />
-    </element>
-    <element type="FileSelectorLayout" auto="false">
-        <attribute name="Layout Spacing" value="4" />
-        <attribute name="Min Size" value="0 17" />
-        <attribute name="Max Size" value="2147483647 17" />
-    </element>
-    <element type="FileSelectorListText" style="Text" auto="false">
-        <attribute name="Hover Color" value="0.45 0.7 0.45 1" />
-        <attribute name="Selection Color" value="0.7 0.7 0.7 1" />
-    </element>
-    <element type="FileSelectorTitleText" style="Text" auto="false" />
-    <element type="EditorDivider" style="BorderImage" auto="false">
-        <attribute name="Image Rect" value="144 32 160 43" />
-        <attribute name="Border" value="2 2 2 2" />
-        <attribute name="Min Size" value="0 11" />
-        <attribute name="Max Size" value="2147483647 11" />
-    </element>
-    <element type="EditorMenuBar" style="BorderImage" auto="false">
-        <attribute name="Image Rect" value="96 0 112 16" />
-        <attribute name="Border" value="2 2 2 2" />
-    </element>
-    <element type="EditorMenuText" style="Text" auto="false" />
-    <element type="EditorAttributeText" auto="false">
-        <attribute name="Font" value="Font;Fonts/BlueHighway.ttf" />
-        <attribute name="Font Size" value="9" />
-    </element>
-    <element type="EditorEnumAttributeText" style="EditorAttributeText" auto="false">
-        <attribute name="Is Enabled" value="true" />
-        <attribute name="Selection Color" value="0.7 0.7 0.7 1" />
-        <attribute name="Hover Color" value="0.45 0.7 0.45 1" />
-    </element>
-    <element type="EditorAttributeEdit" style="LineEdit" auto="false" />
-</elements>

BIN
Bin/Data/Urho2D/GoldIcon.png


+ 0 - 10
Bin/Data/Urho2D/GoldIcon.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Created with TexturePacker http://texturepacker.com-->
-<!-- $TexturePacker:SmartUpdate:97bda036b40e92e88fe7433e328fa1b7$ -->
-<TextureAtlas imagePath="Urho2D/GoldIcon.png">
-    <SubTexture name="1" x="2" y="2" width="60" height="60"/>
-    <SubTexture name="2" x="64" y="2" width="42" height="60" frameX="-9" frameY="0" frameWidth="60" frameHeight="60"/>
-    <SubTexture name="3" x="108" y="2" width="18" height="60" frameX="-20" frameY="0" frameWidth="60" frameHeight="60"/>
-    <SubTexture name="4" x="62" y="64" width="42" height="60" frameX="-9" frameY="0" frameWidth="60" frameHeight="60"/>
-    <SubTexture name="5" x="2" y="64" width="58" height="60" frameX="-1" frameY="0" frameWidth="60" frameHeight="60"/>
-</TextureAtlas>

BIN
Bin/Data/Urho2D/GoldIcon/3.png


+ 0 - 15
Bin/Data/Urho2D/imp/imp.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Created with TexturePacker http://texturepacker.com-->
-<!-- $TexturePacker:SmartUpdate:f81cc230b601898a13f4c5b211f51db1$ -->
-<TextureAtlas imagePath="imp_all.png">
-    <SubTexture name="imp_blood" x="242" y="153" width="226" height="73"/>
-    <SubTexture name="imp_body" x="2" y="304" width="124" height="131"/>
-    <SubTexture name="imp_footbig" x="2" y="437" width="65" height="49"/>
-    <SubTexture name="imp_footsmall" x="69" y="437" width="59" height="45"/>
-    <SubTexture name="imp_handbig" x="205" y="304" width="66" height="102"/>
-    <SubTexture name="imp_handsmall" x="130" y="426" width="63" height="83"/>
-    <SubTexture name="imp_handthrow" x="128" y="304" width="75" height="120"/>
-    <SubTexture name="imp_head" x="2" y="153" width="238" height="149"/>
-    <SubTexture name="imp_headangry" x="242" y="2" width="238" height="149"/>
-    <SubTexture name="imp_headblink" x="2" y="2" width="238" height="149"/>
-</TextureAtlas>

BIN
Bin/Data/Urho2D/imp/imp_all.png


+ 0 - 9
Bin/Editor.bat

@@ -1,9 +0,0 @@
-@ECHO OFF
-
-IF [%1] == [] (
-        "%~dp0Urho3DPlayer" Scripts/Editor.as -w -s
-        )
-
-IF NOT [%1] == [] (
-        "%~dp0Urho3DPlayer" Scripts/Editor.as %*
-        )

+ 0 - 6
Bin/Editor.sh

@@ -1,6 +0,0 @@
-if [ $# -eq 0 ]
-then
-    $( dirname $0 )/Urho3DPlayer Scripts/Editor.as -w -s
-else
-    $( dirname $0 )/Urho3DPlayer Scripts/Editor.as $@
-fi

+ 0 - 3
Bin/Extra/.gitignore

@@ -1,3 +0,0 @@
-# Place holder to ensure Git includes this directory
-*
-!.gitignore

+ 0 - 19
Bin/UpdateDocument.bat

@@ -1,19 +0,0 @@
-@echo off
-doxygen -v 1>nul 2>&1
-if %errorlevel% == 0 goto :start
-echo Could not update document because doxygen is not installed
-exit /B 1
-:start
-pushd "%~dp0..\Docs"
-echo Dumping AngelScript API...
-"%~dp0ScriptCompiler" -dumpapi ScriptAPI.dox AngelScriptAPI.h
-if errorlevel 1 exit /B 1
-echo Dumping LuaScript API...
-pushd ..\Source\Engine\LuaScript\pkgs
-"%~dp0tolua++" -L ToDoxHook.lua -P -o "%~dp0..\Docs\LuaScriptAPI.dox" "%~dp0LuaPkgToDox.txt"
-if errorlevel 1 exit /B 1
-popd
-echo Converting Doxygen files to HTML...
-doxygen Doxyfile 1>nul
-echo Finish.
-popd

+ 0 - 17
Bin/UpdateDocument.sh

@@ -1,17 +0,0 @@
-doxygen -v 1>/dev/null 2>&1
-if [ $? -ne 0 ]; then echo "Could not update document because doxygen is not installed" && exit 1; fi
-cd $( dirname $0 )
-BIN=`pwd`
-cd ../Docs
-echo "Dumping AngelScript API..."
-$BIN/ScriptCompiler -dumpapi ScriptAPI.dox AngelScriptAPI.h
-if [ $? -ne 0 ]; then exit 1; fi
-echo "Dumping LuaScript API..."
-out=`pwd`/LuaScriptAPI.dox
-pushd ../Source/Engine/LuaScript/pkgs >/dev/null
-$BIN/tolua++ -L ToDoxHook.lua -P -o $out $BIN/LuaPkgToDox.txt
-if [ $? -ne 0 ]; then exit 1; fi
-popd >/dev/null
-echo "Converting Doxygen files to HTML..."
-doxygen Doxyfile 1>/dev/null
-echo "Finish."

+ 25 - 0
CMake/Modules/AdjustPkgConfigForMSVC.cmake

@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# VS generator is multi-config, we need to use the CMake generator expression to get the correct target linker filename during post build step
+
+configure_file (Urho3D.pc.msvc Urho3D.pc @ONLY)

+ 164 - 0
CMake/Modules/CheckCompilerToolchain.cmake

@@ -0,0 +1,164 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Check the chosen compiler toolchain in the build tree
+#
+# Native ABI:
+#  NATIVE_64BIT
+#
+# Target architecture:
+#  ARM
+#  RPI
+#  POWERPC
+#
+# Compiler version in major.minor.patch format, except MSVC where it follows its own format:
+#  COMPILER_VERSION
+#
+# CPU SIMD instruction extensions support:
+#  HAVE_MMX
+#  HAVE_3DNOW
+#  HAVE_SSE
+#  HAVE_SSE2
+#  HAVE_ALTIVEC
+#
+
+if (EMSCRIPTEN AND CMAKE_HOST_WIN32)
+    set (EMCC_FIX EMCC_FIX)
+    set (NULL_DEVICE${EMCC_FIX} ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/null.c)
+    execute_process (COMMAND ${CMAKE_COMMAND} -E touch ${NULL_DEVICE${EMCC_FIX}})
+endif ()
+
+if (NOT MSVC AND NOT DEFINED NATIVE_PREDEFINED_MACROS)
+    if (IOS OR TVOS)
+        # Assume arm64 is the native arch (this does not prevent our build system to target armv7 later in universal binary build)
+        set (ARCH_FLAGS -arch arm64)
+    elseif (ANDROID_COMPILER_IS_CLANG)
+        # Use the same target flag as configured by Android/CMake toolchain file
+        string (REGEX REPLACE "^.*-target ([^ ]+).*$" "-target;\\1" ARCH_FLAGS "${ANDROID_CXX_FLAGS}")  # Stringify for string replacement
+    endif ()
+    execute_process (COMMAND ${CMAKE_C_COMPILER} ${ARCH_FLAGS} -E -dM -xc ${NULL_DEVICE${EMCC_FIX}} RESULT_VARIABLE CC_EXIT_STATUS OUTPUT_VARIABLE NATIVE_PREDEFINED_MACROS ERROR_QUIET)
+    if (NOT CC_EXIT_STATUS EQUAL 0)
+        message (FATAL_ERROR "Could not check compiler toolchain as it does not handle '-E -dM' compiler flags correctly")
+    endif ()
+    string (REPLACE \n ";" NATIVE_PREDEFINED_MACROS "${NATIVE_PREDEFINED_MACROS}")    # Stringify for string replacement
+    set (NATIVE_PREDEFINED_MACROS ${NATIVE_PREDEFINED_MACROS} CACHE INTERNAL "Compiler toolchain native predefined macros")
+endif ()
+
+macro (check_native_define REGEX OUTPUT_VAR)
+    if (NOT DEFINED ${OUTPUT_VAR})
+        string (REGEX MATCH "#define +${REGEX} +([^;]+)" matched "${NATIVE_PREDEFINED_MACROS}")
+        if (matched)
+            string (REGEX MATCH "\\(.*\\)" captured "${REGEX}")
+            if (captured)
+                set (GROUP 2)
+            else ()
+                set (GROUP 1)
+            endif ()
+            string (REGEX REPLACE "#define +${REGEX} +([^;]+)" \\${GROUP} matched "${matched}")
+            set (${OUTPUT_VAR} ${matched})
+        else ()
+            set (${OUTPUT_VAR} 0)
+        endif ()
+        set (${OUTPUT_VAR} ${${OUTPUT_VAR}} CACHE INTERNAL "Compiler toolchain has predefined macros matching ${REGEX}")
+    endif ()
+endmacro ()
+
+if (MSVC)
+    # TODO: revisit this later because VS may use Clang as compiler in the future
+    # On MSVC compiler, use the chosen CMake/VS generator to determine the ABI
+    set (NATIVE_64BIT ${CMAKE_CL_64})
+    # Determine MSVC compiler version based on CMake informational variables
+    set (COMPILER_VERSION ${MSVC_VERSION})
+else ()
+    # Determine the native ABI based on the size of pointer
+    check_native_define (__SIZEOF_POINTER__ SIZEOF_POINTER)
+    if (SIZEOF_POINTER EQUAL 8)
+        set (NATIVE_64BIT 1)
+    endif ()
+    # Android arm64 compiler only emits __aarch64__ while iOS arm64 emits __aarch64__, __arm64__, and __arm__; for armv7a all emit __arm__
+    check_native_define ("__(arm|aarch64)__" ARM)
+    # For completeness sake as currently we do not support PowerPC (yet)
+    check_native_define ("__(ppc|PPC|powerpc|POWERPC)(64)*__" POWERPC)
+    # GCC/Clang and all their derivatives should understand this command line option to get the compiler version
+    if (NOT DEFINED COMPILER_VERSION)
+        execute_process (COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+        set (COMPILER_VERSION ${COMPILER_VERSION} CACHE INTERNAL "GCC/Clang Compiler version")
+    endif ()
+endif ()
+
+macro (check_extension CPU_INSTRUCTION_EXTENSION)
+    string (TOUPPER "${CPU_INSTRUCTION_EXTENSION}" UCASE_EXT_NAME)   # Stringify to guard against empty variable
+    if (NOT DEFINED HAVE_${UCASE_EXT_NAME})
+        execute_process (COMMAND ${CMAKE_C_COMPILER} -m${CPU_INSTRUCTION_EXTENSION} -E -dM -xc ${NULL_DEVICE${EMCC_FIX}} RESULT_VARIABLE CC_EXIT_STATUS OUTPUT_VARIABLE PREDEFINED_MACROS ERROR_QUIET)
+        if (NOT CC_EXIT_STATUS EQUAL 0)
+            message (FATAL_ERROR "Could not check compiler toolchain CPU instruction extension as it does not handle '-E -dM' compiler flags correctly")
+        endif ()
+        if (NOT ${ARGN} STREQUAL "")
+            set (EXPECTED_MACRO ${ARGN})
+        else ()
+            set (EXPECTED_MACRO __${UCASE_EXT_NAME}__)
+        endif ()
+        string (REGEX MATCH "#define +${EXPECTED_MACRO} +1" matched "${PREDEFINED_MACROS}")
+        if (matched)
+            set (matched 1)
+        else ()
+            set (matched 0)
+        endif ()
+        set (HAVE_${UCASE_EXT_NAME} ${matched} CACHE INTERNAL "Compiler toolchain supports ${UCASE_EXT_NAME} CPU instruction extension")
+    endif ()
+endmacro ()
+
+if (NOT ARM)
+    if (MSVC)
+        # In our documentation we have already declared that we only support CPU with SSE2 extension on Windows platform, so we can safely hard-code these for MSVC compiler
+        foreach (VAR HAVE_MMX HAVE_SSE HAVE_SSE2)
+            set (${VAR} 1)
+        endforeach ()
+    else ()
+        if (MINGW AND COMPILER_VERSION VERSION_LESS 4.9.1)
+            if (NOT DEFINED URHO3D_SSE)     # Only give the warning once during initial configuration
+                # Certain MinGW versions fail to compile SSE code. This is the initial guess for known "bad" version range, and can be tightened later
+                message (WARNING "Disabling SSE by default due to MinGW version. It is recommended to upgrade to MinGW with GCC >= 4.9.1. You can also try to re-enable SSE with CMake option -DURHO3D_SSE=1, but this may result in compile errors.")
+            endif ()
+        elseif (NOT EMSCRIPTEN)     # Emscripten does not support SSE/SSE2 (yet) now but erroneously responding positively to our probe, so skip them for Emscripten for now
+            check_extension (sse)
+            check_extension (sse2)
+        endif ()
+        if (NOT APPLE AND NOT WIN32)    # Linux only
+            check_extension (mmx)
+            check_extension (3dnow __3dNOW__)
+        endif ()
+    endif ()
+    # For completeness sake as currently we do not support PowerPC (yet)
+    if (POWERPC)
+        check_extension (altivec)
+    endif ()
+endif ()
+
+# Explicitly set the variable to 1 when it is defined and truthy or 0 when it is not defined or falsy
+foreach (VAR NATIVE_64BIT HAVE_MMX HAVE_3DNOW HAVE_SSE HAVE_SSE2 HAVE_ALTIVEC)
+    if (${VAR})
+        set (${VAR} 1)
+    else ()
+        set (${VAR} 0)
+    endif ()
+endforeach ()

+ 89 - 0
CMake/Modules/CheckHost.cmake

@@ -0,0 +1,89 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Check the capability of the host system
+#
+#  NULL_DEVICE
+#
+# WIN32 only:
+#  HAS_MKLINK (capable to create mklink which is analogous to symlink)
+#
+# non-WIN32:
+#  HAS_LIB64 (multilib capable)
+#  CCACHE_VERSION (when ccache is used)
+#
+# Neither here nor there:
+#  BASH_ON_WINDOWS
+#
+
+if (CMAKE_HOST_WIN32)
+    set (NULL_DEVICE nul)
+    if (NOT DEFINED HAS_MKLINK)
+        # Test whether the host system is capable of setting up symbolic link
+        execute_process (COMMAND cmd /C mklink test-link CMakeCache.txt RESULT_VARIABLE MKLINK_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+        if (MKLINK_EXIT_CODE EQUAL 0)
+            set (HAS_MKLINK TRUE)
+            file (REMOVE ${CMAKE_BINARY_DIR}/test-link)
+        else ()
+            set (HAS_MKLINK FALSE)
+            message (WARNING "Could not use MKLINK to setup symbolic links as this Windows user account does not have the privilege to do so. "
+                "When MKLINK is not available then the build system will fallback to use file/directory copy of the library headers from source tree to build tree. "
+                "In order to prevent stale headers being used in the build, this file/directory copy will be redone also as a post-build step for each library targets. "
+                "This may slow down the build unnecessarily or even cause other unforseen issues due to incomplete or stale headers in the build tree. "
+                "Request your Windows Administrator to grant your user account to have privilege to create symlink via MKLINK command. "
+                "You are NOT advised to use the Administrator account directly to generate build tree in all cases.")
+        endif ()
+        set (HAS_MKLINK ${HAS_MKLINK} CACHE INTERNAL "MKLINK capability")
+    endif ()
+else ()
+    set (NULL_DEVICE /dev/null)
+    if (NOT DEFINED HAS_LIB64)
+        if (EXISTS /usr/lib64)
+            set (HAS_LIB64 TRUE)
+        else ()
+            set (HAS_LIB64 FALSE)
+        endif ()
+        set (HAS_LIB64 ${HAS_LIB64} CACHE INTERNAL "Multilib capability")
+    endif ()
+    # Test if it is a userspace bash on Windows host system
+    if (NOT DEFINED BASH_ON_WINDOWS)
+        execute_process (COMMAND grep -cq Microsoft /proc/version RESULT_VARIABLE GREP_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+        if (GREP_EXIT_CODE EQUAL 0)
+            set (BASH_ON_WINDOWS TRUE)
+        endif ()
+        set (BASH_ON_WINDOWS ${BASH_ON_WINDOWS} CACHE INTERNAL "Bash on Ubuntu on Windows")
+    endif ()
+    if ("$ENV{USE_CCACHE}" AND NOT DEFINED CCACHE_VERSION)
+        execute_process (COMMAND ccache --version COMMAND head -1 RESULT_VARIABLE CCACHE_EXIT_CODE OUTPUT_VARIABLE CCACHE_VERSION ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+        string (REGEX MATCH "[^ .]+\\.[^.]+\\.[^ ]+" CCACHE_VERSION "${CCACHE_VERSION}")    # Stringify as it could be empty when an error has occurred
+        if (CCACHE_EXIT_CODE EQUAL 0)
+           set (CCACHE_VERSION ${CCACHE_VERSION} CACHE INTERNAL "ccache version")
+       endif ()
+    endif ()
+    # Temporary workaround - test if PCH could be enabled when using Clang compiler toolchain
+    if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
+        # Turn off PCH when building on macOS host with ccache 3.3.1+ (the last known bad version) and when targeting Android platform
+        if ((APPLE AND NOT CCACHE_VERSION VERSION_LESS 3.3.1) OR ANDROID)
+            set (URHO3D_PCH FALSE CACHE INTERNAL "" FORCE)
+        endif ()
+    endif ()
+endif ()

+ 6 - 8
Source/Engine/Revision.h → CMake/Modules/CheckUrho3DLibrary.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2008-2014 the Urho3D project.
+// Copyright (c) 2008-2016 the Urho3D project.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -20,14 +20,12 @@
 // THE SOFTWARE.
 //
 
-#pragma once
+#include <Urho3D/LibraryInfo.h>
+#include <iostream>
 
-#include "Urho3D.h"
+using namespace Urho3D;
 
-namespace Urho3D
+int main(int argc, char* argv[])
 {
-
-/// Return subversion revision number as of the library build time.
-URHO3D_API const char* GetRevision();
-
+    std::cout << GetRevision() << "\n" << GetCompilerDefines();
 }

+ 45 - 0
CMake/Modules/FindDirectFB.cmake

@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Find DirectFB development library
+#
+#  DIRECTFB_FOUND
+#  DIRECTFB_INCLUDE_DIRS
+#  DIRECTFB_LIBRARIES
+#  DIRECTFB_VERSION
+#
+
+find_path (DIRECTFB_INCLUDE_DIRS NAMES directfb.h PATH_SUFFIXES directfb DOC "DirectFB include directory")
+find_library (DIRECTFB_LIBRARIES NAMES directfb DOC "DirectFB library")
+
+if (NOT DIRECTFB_VERSION AND DIRECTFB_INCLUDE_DIRS AND EXISTS ${DIRECTFB_INCLUDE_DIRS}/directfb_version.h)   # Only do this once
+    file (STRINGS ${DIRECTFB_INCLUDE_DIRS}/directfb_version.h DIRECTFB_VERSION REGEX "^.*DIRECTFB_(MAJOR|MINOR|MACRO)_VERSION.+\([^\)]*\).*$")
+    string (REGEX REPLACE "^.*DIRECTFB_MAJOR_VERSION.+\(([^\)]*)\).*$" \\1 DIRECTFB_MAJOR_VERSION "${DIRECTFB_VERSION}")      # Stringify to guard against empty variable
+    string (REGEX REPLACE "^.*DIRECTFB_MINOR_VERSION.+\(([^\)]*)\).*$" \\1 DIRECTFB_MINOR_VERSION "${DIRECTFB_VERSION}")
+    string (REGEX REPLACE "^.*DIRECTFB_MICRO_VERSION.+\(([^\)]*)\).*$" \\1 DIRECTFB_MICRO_VERSION "${DIRECTFB_VERSION}")
+    set (DIRECTFB_VERSION "${DIRECTFB_MAJOR_VERSION}.${DIRECTFB_MINOR_VERSION}.${DIRECTFB_MICRO_VERSION}" CACHE INTERNAL "DirectFB version")
+endif ()
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (DirectFB REQUIRED_VARS DIRECTFB_LIBRARIES DIRECTFB_INCLUDE_DIRS VERSION_VAR DIRECTFB_VERSION FAIL_MESSAGE "Could NOT find DirectFB development library")
+
+mark_as_advanced (DIRECTFB_INCLUDE_DIRS DIRECTFB_LIBRARIES)

+ 239 - 0
CMake/Modules/FindDirectX.cmake

@@ -0,0 +1,239 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# For MSVC compiler, find Microsoft DirectX installation in Windows SDK or in June 2010 DirectX SDK or later
+# For MinGW compiler, assume MinGW not only comes with the necessary headers & libraries but also has the headers & libraries directories in its default search path
+# (use 'echo |$MINGW_PREFIX-gcc -v -E -' and '$MINGW_PREFIX-gcc -print-search-dirs', respectively, to double check)
+# The MinGW headers on Linux host are usually shipped in a development package which should be installed automatically as part of the package dependency by the package manager when installing MinGW
+# (in Debian-based it is 'mingw-w64-dev' and in RedHat-based 'mingw64-headers' for 64-bit; 'mingw-w64-i686-dev' and 'mingw32-headers', respectively, for 32-bit)
+#
+#  DIRECTX_FOUND (TRUE when any of the components is found)
+#  DIRECTX_INCLUDE_DIRS
+#  DIRECTX_LIBRARY_DIRS
+#  HAVE_DIRECTX (Synonym to DIRECTX_FOUND)
+#  USE_WINSDK_DIRECTX (TRUE when using Windows SDK or FALSE when using DirectX SDK; not defined when using MinGW)
+#
+# When corresponding component is being searched for and found:
+#  DirectX_D3D_FOUND (Currently synonym to DirectX_D3D9_FOUND)
+#  DirectX_D3D9_FOUND
+#  DirectX_D3D11_FOUND
+#  DirectX_DInput_FOUND
+#  DirectX_DSound_FOUND
+#  DirectX_XAudio2_FOUND
+#  DirectX_XInput_FOUND
+#
+# When any of the Direct3D components is being searched for and found:
+#  DIRECT3D_LIBRARIES
+#  DIRECT3D_DLL
+#
+# When corresponding header listed below is found:
+#  HAVE_<UPCASE_NAME>_H
+#  HAVE_D3D_H (Currently synonym to HAVE_D3D9_H)
+#
+
+set (DIRECTX_HEADERS d3dcompiler.h d3d9.h d3d11.h ddraw.h dsound.h dinput.h dxgi.h xaudio2.h xinput.h)
+
+# Optional input variables (see corresponding code comments for details):
+#  DIRECTX_INC_SEARCH_PATHS
+#  DIRECTX_LIB_SEARCH_PATHS
+#  DIRECT3D_DLL_REDIST_SEARCH_PATHS
+#
+
+if (CMAKE_CL_64)
+    set (PATH_SUFFIX x64)
+else ()
+    set (PATH_SUFFIX x86)
+endif ()
+set (CMAKE_REQUIRED_INCLUDES_SAVED ${CMAKE_REQUIRED_INCLUDES})
+
+# Version older than VS2012 fallbacks to search for the DirectX SDK
+if (NOT MSVC_VERSION GREATER 1600 OR MINGW)     # MinGW reuses the logic below to check for the existence of DirectX headers and libraries
+    if (MINGW)
+        # Intentionally searching for d3dcompiler(_XX) libraries in this particular order, avoiding unversioned d3dcompiler library so we know exactly which DLL to use
+        set (D3DCOMPILER_NAMES d3dcompiler_47 d3dcompiler_46 d3dcompiler_43 d3dcompiler_42)
+        if (NOT MINGW_SYSROOT)
+            if (DEFINED ENV{MINGW_SYSROOT})
+                file (TO_CMAKE_PATH $ENV{MINGW_SYSROOT} MINGW_SYSROOT)
+            else ()
+                execute_process (COMMAND ${CMAKE_COMMAND} -E echo "#include <_mingw.h>" COMMAND ${CMAKE_C_COMPILER} -E -M - OUTPUT_FILE ${CMAKE_BINARY_DIR}/find_mingw_sysroot_output ERROR_QUIET)
+                file (STRINGS ${CMAKE_BINARY_DIR}/find_mingw_sysroot_output MINGW_SYSROOT REGEX _mingw\\.h)
+                string (REGEX REPLACE "^[^ ]* *(.*)/include.*$" \\1 MINGW_SYSROOT "${MINGW_SYSROOT}")  # Stringify for string replacement
+                string (REPLACE "\\ " " " MINGW_SYSROOT "${MINGW_SYSROOT}")
+                execute_process (COMMAND ${CMAKE_COMMAND} -E remove find_mingw_sysroot_output)
+            endif ()
+            if (NOT EXISTS ${MINGW_SYSROOT})
+                message (FATAL_ERROR "Could not find MinGW system root. "
+                    "Use MINGW_SYSROOT environment variable or build option to specify the location of system root.")
+            endif ()
+            set (MINGW_SYSROOT ${MINGW_SYSROOT} CACHE PATH "Path to MinGW system root (MinGW build only); should only be used when the system root could not be auto-detected" FORCE)
+        endif ()
+        # MinGW Cross-compiling uses CMAKE_FIND_ROOT_PATH while MinGW on Windows host uses CMAKE_PREFIX_PATH
+        if (CMAKE_HOST_WIN32)
+            set (CMAKE_PREFIX_PATH ${MINGW_SYSROOT})
+        endif ()
+        # MinGW does not need search paths as DirectX headers and libraries (when installed) are in its default search path
+        # However, we do not explicitly unset the DIRECTX_INC_SEARCH_PATHS and DIRECTX_LIB_SEARCH_PATHS variables here, so module user could set these two variables externally when for some reasons the DirectX headers and libraries are not installed in MinGW default search path
+    else ()
+        set (D3DCOMPILER_NAMES d3dcompiler)
+        # Module user could also prepopulate the DIRECTX_INC_SEARCH_PATHS and DIRECTX_LIB_SEARCH_PATHS variables externally when the following search paths do not work and the usage of DIRECTX_ROOT and DXSDK_DIR environment variables are not preferable
+        list (APPEND DIRECTX_INC_SEARCH_PATHS
+            "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Include"
+            "C:/Program Files/Microsoft DirectX SDK (June 2010)/Include"
+            $ENV{DIRECTX_ROOT}/Include
+            $ENV{DXSDK_DIR}/Include)
+        list (APPEND DIRECTX_LIB_SEARCH_PATHS
+            "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/${PATH_SUFFIX}"
+            "C:/Program Files/Microsoft DirectX SDK (June 2010)/Lib/${PATH_SUFFIX}"
+            $ENV{DIRECTX_ROOT}/Lib/${PATH_SUFFIX}
+            $ENV{DXSDK_DIR}/Lib/${PATH_SUFFIX})
+        if (NOT CMAKE_CL_64)
+            list (APPEND DIRECTX_LIB_SEARCH_PATHS
+                "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib"
+                "C:/Program Files/Microsoft DirectX SDK (June 2010)/Lib"
+                $ENV{DIRECTX_ROOT}/Lib
+                $ENV{DXSDK_DIR}/Lib)
+        endif ()
+    endif ()
+    find_path (DIRECTX_INCLUDE_DIRS NAMES ${DIRECTX_HEADERS} PATHS ${DIRECTX_INC_SEARCH_PATHS} DOC "DirectX include directory")
+    if (DIRECTX_INCLUDE_DIRS)
+        set (CMAKE_REQUIRED_INCLUDES ${DIRECTX_INCLUDE_DIRS})
+        set (DIRECTX_LIBRARY_DIRS)
+        set (DIRECT3D_LIBRARIES)
+        find_library (DIRECTX_D3DCOMPILER NAMES ${D3DCOMPILER_NAMES} PATHS ${DIRECTX_LIB_SEARCH_PATHS} DOC "DirectX d3dcompiler library")
+        if (DIRECTX_D3DCOMPILER)
+            get_filename_component (NAME ${DIRECTX_D3DCOMPILER} NAME)
+            string (REGEX REPLACE "^.*(d3dcompiler[_0-9]*).*$" \\1 D3DCOMPILER_LIB_NAME ${NAME})
+            if (DirectX_FIND_REQUIRED_D3D11)
+                set (DIRECT3D_LIB_NAMES d3d11 dxgi dxguid)
+            else ()
+                set (DIRECT3D_LIB_NAMES d3d9)
+                if (NOT DirectX_FIND_REQUIRED_D3D AND NOT DirectX_FIND_REQUIRED_D3D9)
+                    # When using OpenGL we still want to reuse the logic below to find the DirectX library directory
+                    set (NO_DIRECT3D_COMPONENTS TRUE)
+                endif ()
+            endif ()
+            foreach (NAME ${D3DCOMPILER_LIB_NAME} ${DIRECT3D_LIB_NAMES})
+                string (REGEX REPLACE _[0-9]+$ "" BASE_NAME ${NAME})
+                string (TOUPPER ${BASE_NAME} UPCASE_NAME)
+                find_library (DIRECTX_${UPCASE_NAME} NAMES ${NAME} PATHS ${DIRECTX_LIB_SEARCH_PATHS} DOC "DirectX ${BASE_NAME} library")
+                if (DIRECTX_${UPCASE_NAME})
+                    get_filename_component (PATH ${DIRECTX_${UPCASE_NAME}} PATH)
+                    list (APPEND DIRECTX_LIBRARY_DIRS ${PATH})      # All the libs should be found in a same place, but just in case
+                    if (NOT NO_DIRECT3D_COMPONENTS)     # Discard the result when Direct3D component is not required
+                        list (APPEND DIRECT3D_LIBRARIES ${NAME})
+                    endif ()
+                else ()
+                    set (MISSING_DIRECT3D_LIB TRUE)
+                endif ()
+                mark_as_advanced (DIRECTX_${UPCASE_NAME})
+            endforeach ()
+            if (NOT MISSING_DIRECT3D_LIB)
+                if (NOT MINGW)
+                    set (USE_WINSDK_DIRECTX FALSE)
+                endif ()
+                set (HAVE_DIRECTX TRUE)
+                if (DirectX_FIND_REQUIRED_D3D11)
+                    set (DirectX_D3D11_FOUND TRUE)
+                elseif (DirectX_FIND_REQUIRED_D3D OR DirectX_FIND_REQUIRED_D3D9)
+                    set (DirectX_D3D9_FOUND TRUE)
+                    set (DirectX_D3D_FOUND TRUE)
+                endif ()
+            endif ()
+        endif ()
+        if (DIRECTX_LIBRARY_DIRS)
+            list (REMOVE_DUPLICATES DIRECTX_LIBRARY_DIRS)
+        endif ()
+    endif ()
+    if (MINGW)
+        set (FAIL_MESSAGE "Could NOT find DirectX using MinGW default search paths")
+    else ()
+        set (FAIL_MESSAGE "Could NOT find DirectX using DirectX SDK default search paths")
+    endif ()
+    mark_as_advanced (DIRECTX_INCLUDE_DIRS)
+endif ()
+
+# Windows SDK can be used on VS2012 and above
+if (MSVC_VERSION GREATER 1600 OR MINGW)     # MinGW reuses the logic below to find the runtime DLL for d3dcompiler library
+    if (MINGW)
+        # Search the corresponding DLL for the found d3dcompiler "import library"
+        set (DIRECT3D_DLL_NAMES ${D3DCOMPILER_LIB_NAME}.dll)
+        # Module user using older MinGW version could also prepopulate the DIRECT3D_DLL_REDIST_SEARCH_PATHS variable externally when the following search paths do not work, especially when older d3dcompiler_43.dll and d3dcompiler_42.dll is expected to be found elsewhere
+    else ()
+        set (DIRECT3D_DLL_NAMES d3dcompiler_47.dll d3dcompiler_46.dll)
+        set (DIRECT3D_DLL_REDIST_SEARCH_PATHS)
+    endif ()
+    foreach (VERSION 10.0 8.1 8.0)
+        list (APPEND DIRECT3D_DLL_REDIST_SEARCH_PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v${VERSION};InstallationFolder]/Redist/D3D/${PATH_SUFFIX}")
+    endforeach()
+    find_file (DIRECT3D_DLL NAMES ${DIRECT3D_DLL_NAMES} PATHS ${DIRECT3D_DLL_REDIST_SEARCH_PATHS} DOC "Direct3D DLL"
+        NO_DEFAULT_PATH)    # Do not use default paths such as the PATH variable, to potentially avoid using a wrong architecture DLL
+    if (DIRECT3D_DLL AND NOT MINGW)
+        set (USE_WINSDK_DIRECTX TRUE)
+        set (HAVE_DIRECTX TRUE)
+        if (DirectX_FIND_REQUIRED_D3D11)
+            set (DIRECT3D_LIBRARIES d3dcompiler d3d11 dxgi dxguid)
+            set (DirectX_D3D11_FOUND TRUE)
+        elseif (DirectX_FIND_REQUIRED_D3D OR DirectX_FIND_REQUIRED_D3D9)
+            set (DIRECT3D_LIBRARIES d3dcompiler d3d9)
+            set (DirectX_D3D9_FOUND TRUE)
+            set (DirectX_D3D_FOUND TRUE)
+        endif ()
+    endif ()
+    mark_as_advanced (DIRECT3D_DLL)
+    # The headers and libraries are in default search paths for both Windows SDK and MinGW, so set the search path variables to empty now
+    set (DIRECTX_INCLUDE_DIRS "")   # Need to be very explicit here because these variables are cached on MinGW, this is one way to reset the variables without losing the cached values
+    set (DIRECTX_LIBRARY_DIRS "")
+    if (NOT DirectX_FIND_REQUIRED_D3D11 AND NOT DirectX_FIND_REQUIRED_D3D AND NOT DirectX_FIND_REQUIRED_D3D9)
+        set (DIRECT3D_DLL "")
+    endif ()
+    if (NOT MINGW)
+        set (FAIL_MESSAGE "Could NOT find DirectX using Windows SDK search paths")
+    endif ()
+endif ()
+
+# For now take shortcut for the other DirectX components by just checking on the headers and not the libraries
+include (CheckIncludeFiles)
+include (CheckIncludeFileCXX)
+foreach (NAME ${DIRECTX_HEADERS})
+    string (REPLACE . _ BASE_NAME ${NAME})
+    string (TOUPPER ${BASE_NAME} UPCASE_NAME)
+    if (NAME STREQUAL xinput.h)
+        # Workaround an issue in finding xinput.h using check_include_file() as it depends on windows.h but not included it by itself in WinSDK
+        check_include_files (windows.h\;${NAME} HAVE_${UPCASE_NAME})
+    else ()
+        check_include_file_cxx (${NAME} HAVE_${UPCASE_NAME})
+    endif ()
+endforeach ()
+if (HAVE_D3D9_H)
+    set (HAVE_D3D_H TRUE)
+endif ()
+foreach (COMPONENT DInput DSound XAudio2 XInput)
+    string (TOUPPER ${COMPONENT} UPCASE_NAME)
+    if (HAVE_${UPCASE_NAME}_H)
+        set (DirectX_${COMPONENT}_FOUND TRUE)
+        set (HAVE_DIRECTX TRUE)
+    endif ()
+endforeach ()
+set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVED})
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (DirectX REQUIRED_VARS HAVE_DIRECTX HANDLE_COMPONENTS FAIL_MESSAGE ${FAIL_MESSAGE})

+ 36 - 0
CMake/Modules/FindEsound.cmake

@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Find Esound development library
+#
+#  ESOUND_FOUND
+#  ESOUND_INCLUDE_DIRS
+#  ESOUND_LIBRARIES
+#
+
+find_path (ESOUND_INCLUDE_DIRS NAMES esd.h DOC "Esound include directory")
+find_library (ESOUND_LIBRARIES NAMES esd DOC "Esound library")
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (Esound REQUIRED_VARS ESOUND_LIBRARIES ESOUND_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Esound development library")
+
+mark_as_advanced (ESOUND_INCLUDE_DIRS ESOUND_LIBRARIES)

+ 45 - 0
CMake/Modules/FindFusionSound.cmake

@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Find FusionSound development library
+#
+#  FUSIONSOUND_FOUND
+#  FUSIONSOUND_INCLUDE_DIRS
+#  FUSIONSOUND_LIBRARIES
+#  FUSIONSOUND_VERSION
+#
+
+find_path (FUSIONSOUND_INCLUDE_DIRS NAMES fusionsound/fusionsound.h DOC "FusionSound include directory")
+find_library (FUSIONSOUND_LIBRARIES NAMES fusionsound DOC "FusionSound library")
+
+if (NOT FUSIONSOUND_VERSION AND FUSIONSOUND_INCLUDE_DIRS AND EXISTS ${FUSIONSOUND_INCLUDE_DIRS}/fusionsound/fusionsound_version.h)   # Only do this once
+    file (STRINGS ${FUSIONSOUND_INCLUDE_DIRS}/fusionsound/fusionsound_version.h FUSIONSOUND_VERSION REGEX "^.*FUSIONSOUND_(MAJOR|MINOR|MACRO)_VERSION.+\([^\)]*\).*$")
+    string (REGEX REPLACE "^.*FUSIONSOUND_MAJOR_VERSION.+\(([^\)]*)\).*$" \\1 FUSIONSOUND_MAJOR_VERSION "${FUSIONSOUND_VERSION}")      # Stringify to guard against empty variable
+    string (REGEX REPLACE "^.*FUSIONSOUND_MINOR_VERSION.+\(([^\)]*)\).*$" \\1 FUSIONSOUND_MINOR_VERSION "${FUSIONSOUND_VERSION}")
+    string (REGEX REPLACE "^.*FUSIONSOUND_MICRO_VERSION.+\(([^\)]*)\).*$" \\1 FUSIONSOUND_MICRO_VERSION "${FUSIONSOUND_VERSION}")
+    set (FUSIONSOUND_VERSION "${FUSIONSOUND_MAJOR_VERSION}.${FUSIONSOUND_MINOR_VERSION}.${FUSIONSOUND_MICRO_VERSION}" CACHE INTERNAL "FusionSound version")
+endif ()
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (FusionSound REQUIRED_VARS FUSIONSOUND_LIBRARIES FUSIONSOUND_INCLUDE_DIRS VERSION_VAR FUSIONSOUND_VERSION FAIL_MESSAGE "Could NOT find FusionSound development library")
+
+mark_as_advanced (FUSIONSOUND_INCLUDE_DIRS FUSIONSOUND_LIBRARIES)

+ 46 - 0
CMake/Modules/FindMir.cmake

@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2008-2016 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Find Mir display server
+#
+#  MIR_FOUND
+#  MIR_INCLUDE_DIRS
+#  MIR_CLIENT
+#  MIR_COMMON
+#  EGL
+#  XKB
+#
+
+find_path (MIR_CLIENT_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h PATH_SUFFIXES mirclient DOC "Mir client include directory")
+find_path (MIR_COMMON_INCLUDE_DIR NAMES mir_toolkit/common.h PATH_SUFFIXES mircommon DOC "Mir common include directory")
+find_library (MIR_CLIENT NAMES mirclient DOC "Mir client library")
+find_library (MIR_COMMON NAMES mircommon DOC "Mir common library")
+find_library (EGL NAMES EGL DOC "EGL library")
+find_library (XKB NAMES xkbcommon DOC "Xkb common library")
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (Mir REQUIRED_VARS MIR_CLIENT MIR_COMMON EGL XKB MIR_CLIENT_INCLUDE_DIR MIR_COMMON_INCLUDE_DIR FAIL_MESSAGE "Could NOT find Mir display server")
+if (MIR_FOUND)
+    set (MIR_INCLUDE_DIRS ${MIR_CLIENT_INCLUDE_DIR} ${MIR_COMMON_INCLUDE_DIR})
+endif ()
+
+mark_as_advanced (MIR_CLIENT_INCLUDE_DIR MIR_COMMON_INCLUDE_DIR MIR_CLIENT MIR_COMMON EGL XKB)

Some files were not shown because too many files changed in this diff