aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js2
-rw-r--r--src/library_sdl.js11
-rw-r--r--src/relooper/Relooper.cpp2
3 files changed, 12 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 156fd65d..faef88d5 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -328,7 +328,7 @@ function JSify(data, functionsOnly, givenFunctions) {
var js = (index !== null ? '' : item.ident + '=') + constant;
if (js) js += ';';
- if (!ASM_JS && (EXPORT_ALL || (item.ident in EXPORTED_GLOBALS))) {
+ if (!ASM_JS && NAMED_GLOBALS && (EXPORT_ALL || (item.ident in EXPORTED_GLOBALS))) {
js += '\nModule["' + item.ident + '"] = ' + item.ident + ';';
}
if (BUILD_AS_SHARED_LIB == 2 && !item.private_) {
diff --git a/src/library_sdl.js b/src/library_sdl.js
index a131f424..5aaddb3b 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -965,6 +965,13 @@ var LibrarySDL = {
return SDL.makeSurface(width, height, flags, false, 'CreateRGBSurface', rmask, gmask, bmask, amask);
},
+ SDL_CreateRGBSurfaceFrom: function(pixels, width, height, depth, pitch, rmask, gmask, bmask, amask) {
+ // TODO: Actually fill pixel data to created surface.
+ // TODO: Take into account depth and pitch parameters.
+ console.log('TODO: Partially unimplemented SDL_CreateRGBSurfaceFrom called!');
+ return SDL.makeSurface(width, height, 0, false, 'CreateRGBSurfaceFrom', rmask, gmask, bmask, amask);
+ },
+
SDL_DisplayFormatAlpha: function(surf) {
var oldData = SDL.surfaces[surf];
var ret = SDL.makeSurface(oldData.width, oldData.height, oldData.flags, false, 'copy:' + oldData.source);
@@ -1810,7 +1817,7 @@ var LibrarySDL = {
SDL_AddTimer: function(interval, callback, param) {
return window.setTimeout(function() {
- Runtime.dynCall('ii', callback, [interval, param]);
+ Runtime.dynCall('iii', callback, [interval, param]);
}, interval);
},
SDL_RemoveTimer: function(id) {
@@ -1837,9 +1844,9 @@ var LibrarySDL = {
Mix_FadeOutChannel: function() { throw 'Mix_FadeOutChannel' },
Mix_Linked_Version: function() { throw 'Mix_Linked_Version: TODO' },
- SDL_CreateRGBSurfaceFrom: function() { throw 'SDL_CreateRGBSurfaceFrom: TODO' },
SDL_SaveBMP_RW: function() { throw 'SDL_SaveBMP_RW: TODO' },
+ SDL_WM_SetIcon: function() { /* This function would set the application window icon surface, which doesn't apply for web canvases, so a no-op. */ },
SDL_HasRDTSC: function() { return 0; },
SDL_HasMMX: function() { return 0; },
SDL_HasMMXExt: function() { return 0; },
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index 8a6e18b8..7ceeb2f8 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -897,6 +897,7 @@ void Relooper::Calculate(Block *Entry) {
BlockSet Entries;
Entries.insert(Entry);
Root = Analyzer(this).Process(AllBlocks, Entries, NULL);
+ assert(Root);
// Post optimizations
@@ -1091,6 +1092,7 @@ void Relooper::Calculate(Block *Entry) {
void Relooper::Render() {
OutputBuffer = OutputBufferRoot;
+ assert(Root);
Root->Render(false);
}