Skip to content

Commit

Permalink
emscripten: fix problems with latest versions
Browse files Browse the repository at this point in the history
 #changelog #emscripten
  • Loading branch information
arturoc committed Jun 26, 2019
1 parent 8e70657 commit c070afc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ var LibraryHTML5Audio = {
// Fix up for prefixing
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var context = new AudioContext();

// Fix issue with chrome autoplay policy
document.addEventListener('mousedown', function cb(event) {
context.resume();
event.currentTarget.removeEventListener(event.type, cb);
});

var id = AUDIO.lastContextID++;
AUDIO.contexts[id] = context;
var fft = context.createAnalyser();
Expand Down Expand Up @@ -74,7 +74,7 @@ var LibraryHTML5Audio = {

html5audio_sound_load: function(context_id, url){
var request = new XMLHttpRequest();
request.open('GET', Pointer_stringify(url), true);
request.open('GET', UTF8ToString(url), true);
request.responseType = 'arraybuffer';

var id = AUDIO.lastSoundID++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ var LibraryHTML5Video = {

html5video_player_load__deps: ['$GL'],
html5video_player_load: function(id,src){
console.log(Pointer_stringify(src));
VIDEO.players[id].src = Pointer_stringify(src);
console.log(UTF8ToString(src));
VIDEO.players[id].src = UTF8ToString(src);
var texId = GL.getNewId(GL.textures);
var texture = GLctx.createTexture();
texture.name = texId;
Expand All @@ -124,7 +124,7 @@ var LibraryHTML5Video = {
},

html5video_player_set_pixel_format: function(id, format){
VIDEO.players[id].pixelFormat = Pointer_stringify(format);
VIDEO.players[id].pixelFormat = UTF8ToString(format);
},

html5video_player_update__deps: ['$GL'],
Expand Down Expand Up @@ -223,7 +223,7 @@ var LibraryHTML5Video = {
var grabber_id = VIDEO.getNewGrabberId();
VIDEO.grabbers[grabber_id] = video;
return grabber_id;

},

html5video_grabber_init__deps: ['$GL'],
Expand Down Expand Up @@ -290,7 +290,7 @@ var LibraryHTML5Video = {
},

html5video_grabber_set_pixel_format: function(id, format){
VIDEO.grabbers[id].pixelFormat = Pointer_stringify(format);
VIDEO.grabbers[id].pixelFormat = UTF8ToString(format);
},

html5video_grabber_update__deps: ['$GL'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ else
PLATFORM_LDFLAGS += --shell-file $(OF_LIBS_PATH)/openFrameworksCompiled/project/emscripten/template.html
endif

PLATFORM_OPTIMIZATION_LDFLAGS_RELEASE = -O3 -s OUTLINING_LIMIT=100000 -s TOTAL_MEMORY=$(PLATFORM_EMSCRIPTEN_TOTAL_MEMORY) --memory-init-file 1
PLATFORM_OPTIMIZATION_LDFLAGS_RELEASE = -O3 -s TOTAL_MEMORY=$(PLATFORM_EMSCRIPTEN_TOTAL_MEMORY) --memory-init-file 1

PLATFORM_OPTIMIZATION_LDFLAGS_DEBUG = -g3 -s TOTAL_MEMORY=134217728 --memory-init-file 1 -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=2

Expand All @@ -120,7 +120,7 @@ PLATFORM_OPTIMIZATION_LDFLAGS_DEBUG = -g3 -s TOTAL_MEMORY=134217728 --memory-ini
################################################################################

# RELEASE Debugging options (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)
PLATFORM_OPTIMIZATION_CFLAGS_RELEASE = -O3 -s OUTLINING_LIMIT=100000
PLATFORM_OPTIMIZATION_CFLAGS_RELEASE = -O3

# DEBUG Debugging options (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)
PLATFORM_OPTIMIZATION_CFLAGS_DEBUG = -g3 -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=2
Expand Down

0 comments on commit c070afc

Please sign in to comment.