From 232d457188ce7efce8f32670473a4524276b488b Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Thu, 09 Jul 2015 19:19:46 +0000
Subject: [PATCH] sync with changes in ASMJS Demo
---
client/library/library_humble.js | 11 ++++++-----
client/library/humble_api.h | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/client/library/humble_api.h b/client/library/humble_api.h
index 23fd71b..cfd611b 100644
--- a/client/library/humble_api.h
+++ b/client/library/humble_api.h
@@ -12,7 +12,7 @@
/**
* Trigger a FS.syncfs call on the emscripten Filesystem
*/
- void humble_sync();
+ void humble_syncfs();
/**
* This method is 100% compatible to emscripten_async_wget_data.
diff --git a/client/library/library_humble.js b/client/library/library_humble.js
index de578d9..b2e7676 100644
--- a/client/library/library_humble.js
+++ b/client/library/library_humble.js
@@ -182,8 +182,8 @@
humble_init: function() {
// Dummy function to pull in the rest of the functions
},
- humble_sync__deps: ['$FS', '$CLOUDFS','$HUMBLE_API'],
- humble_sync: function() {
+ humble_syncfs__deps: ['$FS', '$CLOUDFS','$HUMBLE_API'],
+ humble_syncfs: function() {
FS.syncfs(function (err) {
console.log('File Sync');
});
@@ -216,15 +216,17 @@
}
});
},
+ humble_get_player_size__deps: ['$HUMBLE_API'],
humble_get_player_size: function(w, h) {
var ret = {width: 0, height: 0, locked: false};
if (HUMBLE_API.options.playerSize) {
ret = HUMBLE_API.options.playerSize();
}
- if (w) {{{ makeSetValue('w', '0', 'ret.width', 'i32') }}};
- if (h) {{{ makeSetValue('h', '0', 'ret.height', 'i32') }}};
+ if (w && ret.width > 0) {{{ makeSetValue('w', '0', 'ret.width', 'i32') }}};
+ if (h && ret.height > 0) {{{ makeSetValue('h', '0', 'ret.height', 'i32') }}};
return ret.locked ? 1 : 0;
},
+ humble_demo_ended__deps: ['$HUMBLE_API'],
humble_demo_ended: function() {
if (HUMBLE_API.options.demoEndedCallback) {
return HUMBLE_API.options.demoEndedCallback.call(HUMBLE_API);
@@ -232,5 +234,4 @@
}
};
-autoAddDeps(LibraryHUMBLE, '$HUMBLE_API');
mergeInto(LibraryManager.library, LibraryHUMBLE);
--
Gitblit v1.9.3