Browse Source

Merge pull request #3 from urho3d/master

Update from master
dragonCASTjosh 9 years ago
parent
commit
948f99bd6f

+ 1 - 0
.appveyor.yml

@@ -33,6 +33,7 @@ environment:
 # 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
+  excluded_sample: PLATFORM=x64 39_CrowdNavigation
 # We cannot afford to have a large matrix on AppVeyor at the moment
   URHO3D_D3D11: 1
   matrix:

+ 43 - 0
.travis.yml

@@ -126,6 +126,49 @@ notifications: {email: {on_success: never, on_failure: change}}
 
 ---
 
+branch: {name: VS-CI, active: yes, appveyor: yes, last_job: 'x64:SHARED'}
+version: '{build}'
+platform: x64
+clone_depth: 50
+environment:
+  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
+  excluded_sample: PLATFORM=x64 01_HelloWorld,02_HelloGUI,03_Sprites,04_StaticScene,05_AnimatingScene,06_SkeletalAnimation,07_Billboards,08_Decals,09_MultipleViewports,10_RenderToTexture,11_Physics,12_PhysicsStressTest,13_Ragdolls,14_SoundEffects,15_Navigation,16_Chat,17_SceneReplication,18_CharacterDemo,19_VehicleDemo,20_HugeObjectCount,21_AngelScriptIntegration,22_LuaIntegration,23_Water,24_Urho2DSprite,25_Urho2DParticle,26_ConsoleInput,27_Urho2DPhysics,28_Urho2DPhysicsRope,29_SoundSynthesis,30_LightAnimation,31_MaterialAnimation,32_Urho2DConstraints,33_Urho2DSpriterAnimation,34_DynamicGeometry,35_SignedDistanceFieldText,36_Urho2DTileMap,37_UIDrag,38_SceneAndUILoad,40_Localization,41_DatabaseDemo
+  verbosity: diagnostic
+# 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:
+  - 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:
+  - 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
+test: off
+artifacts:
+  - path: Build\*.zip
+deploy: off
+
+---
+
 branch: {name: Coverity-Scan, active: no, mandatory: yes}
 language: cpp
 compiler: gcc

File diff suppressed because it is too large
+ 27 - 6
Rakefile


+ 1 - 1
Source/Urho3D/AngelScript/ScriptInstance.h

@@ -170,7 +170,7 @@ private:
     void HandleSceneUpdate(StringHash eventType, VariantMap& eventData);
     /// Handle scene post-update event.
     void HandleScenePostUpdate(StringHash eventType, VariantMap& eventData);
-#ifdef URHO3D_PHYSICS
+#if defined(URHO3D_PHYSICS) || defined(URHO3D_URHO2D)
     /// Handle physics pre-step event.
     void HandlePhysicsPreStep(StringHash eventType, VariantMap& eventData);
     /// Handle physics post-step event.

+ 6 - 1
Source/Urho3D/Engine/Engine.cpp

@@ -331,7 +331,12 @@ bool Engine::Initialize(const VariantMap& parameters)
             }
         }
 
-        if (!autoLoadPathExist)
+        // The following debug message is confusing when user is not aware of the autoload feature
+        // Especially because the autoload feature is enabled by default without user intervention
+        // The following extra conditional check below is to suppress unnecessary debug log entry under such default situation
+        // The cleaner approach is to not enable the autoload by default, i.e. do not use 'Autoload' as default value for 'AutoloadPaths' engine parameter
+        // However, doing so will break the existing applications that rely on this
+        if (!autoLoadPathExist && (autoLoadPaths.Size() > 1 || autoLoadPaths[0] != "Autoload"))
             URHO3D_LOGDEBUGF(
                 "Skipped autoload path '%s' as it does not exist, check the documentation on how to set the 'resource prefix path'",
                 autoLoadPaths[i].CString());

+ 2 - 2
Source/Urho3D/Graphics/Animation.h

@@ -51,7 +51,7 @@ struct AnimationKeyFrame
 };
 
 /// Skeletal animation track, stores keyframes of a single bone.
-struct AnimationTrack
+struct URHO3D_API AnimationTrack
 {
     /// Construct.
     AnimationTrack() :
@@ -69,7 +69,7 @@ struct AnimationTrack
     void RemoveKeyFrame(unsigned index);
     /// Remove all keyframes.
     void RemoveAllKeyFrames();
-    
+
     /// Return keyframe at index, or null if not found.
     AnimationKeyFrame* GetKeyFrame(unsigned index);
     /// Return number of keyframes.

+ 1 - 1
Source/Urho3D/LuaScript/LuaScriptInstance.h

@@ -156,7 +156,7 @@ private:
     void HandleUpdate(StringHash eventType, VariantMap& eventData);
     /// Handle the logic post update event.
     void HandlePostUpdate(StringHash eventType, VariantMap& eventData);
-#ifdef URHO3D_PHYSICS
+#if defined(URHO3D_PHYSICS) || defined(URHO3D_URHO2D)
     /// Handle the physics update event.
     void HandleFixedUpdate(StringHash eventType, VariantMap& eventData);
     /// Handle the physics post update event.

+ 1 - 1
Source/Urho3D/Scene/LogicComponent.h

@@ -89,7 +89,7 @@ private:
     void HandleSceneUpdate(StringHash eventType, VariantMap& eventData);
     /// Handle scene post-update event.
     void HandleScenePostUpdate(StringHash eventType, VariantMap& eventData);
-#ifdef URHO3D_PHYSICS
+#if defined(URHO3D_PHYSICS) || defined(URHO3D_URHO2D)
     /// Handle physics pre-step event.
     void HandlePhysicsPreStep(StringHash eventType, VariantMap& eventData);
     /// Handle physics post-step event.

+ 2 - 12
Source/Urho3D/Urho2D/Renderer2D.cpp

@@ -63,7 +63,6 @@ Renderer2D::Renderer2D(Context* context) :
     Drawable(context, DRAWABLE_GEOMETRY),
     material_(new Material(context)),
     indexBuffer_(new IndexBuffer(context_)),
-    frustum_(0),
     viewMask_(DEFAULT_VIEWMASK)
 {
     material_->SetName("Urho2D");
@@ -273,10 +272,7 @@ bool Renderer2D::CheckVisibility(Drawable2D* drawable) const
         return false;
 
     const BoundingBox& box = drawable->GetWorldBoundingBox();
-    if (frustum_)
-        return frustum_->IsInsideFast(box) != OUTSIDE;
-
-    return frustumBoundingBox_.IsInsideFast(box) != OUTSIDE;
+    return frustum_.IsInsideFast(box) != OUTSIDE;
 }
 
 void Renderer2D::OnWorldBoundingBoxUpdate()
@@ -336,13 +332,7 @@ void Renderer2D::HandleBeginViewUpdate(StringHash eventType, VariantMap& eventDa
     URHO3D_PROFILE(UpdateRenderer2D);
 
     Camera* camera = static_cast<Camera*>(eventData[P_CAMERA].GetPtr());
-    frustum_ = &camera->GetFrustum();
-    if (camera->IsOrthographic() && camera->GetNode()->GetWorldDirection() == Vector3::FORWARD)
-    {
-        // Define bounding box with min and max points
-        frustumBoundingBox_.Define(frustum_->vertices_[2], frustum_->vertices_[4]);
-        frustum_ = 0;
-    }
+    frustum_ = camera->GetFrustum();
     viewMask_ = camera->GetViewMask();
 
     // Check visibility

+ 2 - 3
Source/Urho3D/Urho2D/Renderer2D.h

@@ -23,6 +23,7 @@
 #pragma once
 
 #include "../Graphics/Drawable.h"
+#include "../Math/Frustum.h"
 
 namespace Urho3D
 {
@@ -123,9 +124,7 @@ private:
     /// View batch info.
     HashMap<Camera*, ViewBatchInfo2D> viewBatchInfos_;
     /// Frustum for current frame.
-    const Frustum* frustum_;
-    /// Frustum bounding box for current frame.
-    BoundingBox frustumBoundingBox_;
+    Frustum frustum_;
     /// View mask of current camera for visibility checking.
     unsigned viewMask_;
     /// Cached materials.

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