aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 1cd99534..f8d252fb 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1116,7 +1116,7 @@ var LibrarySDL = {
SDL.audio.bufferSize = totalSamples*2; // hardcoded 16-bit audio
SDL.audio.buffer = _malloc(SDL.audio.bufferSize);
SDL.audio.caller = function() {
- FUNCTION_TABLE[SDL.audio.callback](SDL.audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize);
+ Runtime.dynCall('viii', SDL.audio.callback, [SDL.audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize]);
SDL.audio.pushAudio(SDL.audio.buffer, SDL.audio.bufferSize);
};
// Mozilla Audio API. TODO: Other audio APIs
@@ -1278,7 +1278,7 @@ var LibrarySDL = {
channelInfo.audio = audio = audio.cloneNode(true);
if (SDL.channelFinished) {
audio['onended'] = function() { // TODO: cache these
- Runtime.getFuncWrapper(SDL.channelFinished)(channel);
+ Runtime.getFuncWrapper(SDL.channelFinished, 'vi')(channel);
}
}
// Either play the element, or load the dynamic data into it
@@ -1349,7 +1349,7 @@ var LibrarySDL = {
info.audio = null;
}
if (SDL.channelFinished) {
- Runtime.getFuncWrapper(SDL.channelFinished)(channel);
+ Runtime.getFuncWrapper(SDL.channelFinished, 'vi')(channel);
}
return 0;
},
@@ -1408,7 +1408,7 @@ var LibrarySDL = {
audio.pause();
SDL.music.audio = null;
if (SDL.hookMusicFinished) {
- FUNCTION_TABLE[SDL.hookMusicFinished]();
+ Runtime.dynCall('v', SDL.hookMusicFinished);
}
return 0;
},
@@ -1439,6 +1439,10 @@ var LibrarySDL = {
return id;
},
+ TTF_CloseFont: function(font) {
+ SDL.fonts[font] = null;
+ },
+
TTF_RenderText_Solid: function(font, text, color) {
// XXX the font and color are ignored
text = Pointer_stringify(text) || ' '; // if given an empty string, still return a valid surface
@@ -1557,7 +1561,7 @@ var LibrarySDL = {
SDL_AddTimer: function(interval, callback, param) {
return window.setTimeout(function() {
- FUNCTION_TABLE[callback](interval, param);
+ Runtime.dynCall('ii', callback, [interval, param]);
}, interval);
},
SDL_RemoveTimer: function(id) {