Skip to content

Commit da0d314

Browse files
committed
Fix Android build
1 parent 309c4d9 commit da0d314

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

Apps/Playground/Scripts/experience.js

+4
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ CreateBoxAsync(scene).then(function () {
6161
//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/RiggedFigure/glTF/RiggedFigure.gltf").then(function () {
6262
//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMan/glTF/CesiumMan.gltf").then(function () {
6363
//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/ClearCoatTest/glTF/ClearCoatTest.gltf").then(function () {
64+
//BABYLON.SceneLoader.AppendAsync("file:///C:/Users/garyhsu/Downloads/alien/alien.gltf").then(function () {
6465
BABYLON.Tools.Log("Loaded");
6566

67+
//scene.animationGroups[0].goToFrame(5 * scene.animationGroups[0].targetedAnimations[0].animation.framePerSecond);
68+
//scene.animationGroups[0].pause();
69+
6670
// This creates and positions a free camera (non-mesh)
6771
scene.createDefaultCamera(true, true, true);
6872
scene.activeCamera.alpha += Math.PI;

Polyfills/Window/Source/TimeoutDispatcher.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@ namespace Babylon::Polyfills::Internal
1414
}
1515
}
1616

17-
struct TimeoutDispatcher::Timeout
18-
{
19-
TimeoutId id;
20-
21-
// Make this non-shared when JsRuntime::Dispatch supports it.
22-
std::shared_ptr<Napi::FunctionReference> function;
23-
24-
TimePoint time;
25-
26-
Timeout(TimeoutId id, std::shared_ptr<Napi::FunctionReference> function, TimePoint time)
27-
: id{id}
28-
, function{std::move(function)}
29-
, time{time}
30-
{
31-
}
32-
33-
Timeout(const Timeout&) = delete;
34-
Timeout(Timeout&&) = delete;
35-
};
36-
3717
TimeoutDispatcher::TimeoutDispatcher(Babylon::JsRuntime& runtime)
3818
: m_runtimeScheduler{runtime}
3919
, m_thread{std::thread{&TimeoutDispatcher::ThreadFunction, this}}

Polyfills/Window/Source/TimeoutDispatcher.h

+22-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313

1414
namespace Babylon::Polyfills::Internal
1515
{
16+
using TimeoutId = int32_t;
17+
1618
class TimeoutDispatcher
1719
{
18-
using TimeoutId = int32_t;
19-
struct Timeout;
20-
2120
public:
2221
TimeoutDispatcher(Babylon::JsRuntime& runtime);
2322
~TimeoutDispatcher();
@@ -28,6 +27,26 @@ namespace Babylon::Polyfills::Internal
2827
private:
2928
using TimePoint = std::chrono::time_point<std::chrono::steady_clock, std::chrono::microseconds>;
3029

30+
struct Timeout
31+
{
32+
TimeoutId id;
33+
34+
// Make this non-shared when JsRuntime::Dispatch supports it.
35+
std::shared_ptr<Napi::FunctionReference> function;
36+
37+
TimePoint time;
38+
39+
Timeout(TimeoutId id, std::shared_ptr<Napi::FunctionReference> function, TimePoint time)
40+
: id{id}
41+
, function{std::move(function)}
42+
, time{time}
43+
{
44+
}
45+
46+
Timeout(const Timeout&) = delete;
47+
Timeout(Timeout&&) = delete;
48+
};
49+
3150
TimeoutId NextTimeoutId();
3251
void ThreadFunction();
3352
void CallFunction(std::shared_ptr<Napi::FunctionReference> function);

Polyfills/Window/Source/Window.h

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include <Babylon/JsRuntimeScheduler.h>
44
#include "TimeoutDispatcher.h"
5-
#include <optional>
65

76
namespace Babylon::Polyfills::Internal
87
{

0 commit comments

Comments
 (0)