diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-05-15 16:26:57 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-05-15 16:26:57 -0700 |
commit | 798e635cf912d778f08f8107d6d59fcd11b20082 (patch) | |
tree | b4627e55014a017c02d952c92feda76d745415ee /src/library_sdl.js | |
parent | 3afb3d53d70c6d9a3e84e488cfa986b8cd7b2733 (diff) |
support for reading files synchronously
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r-- | src/library_sdl.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 648f0014..ca477a1b 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -57,6 +57,8 @@ mergeInto(Library, { return 0; // success }, + SDL_WasInit: function() { return 0 }, // TODO + SDL_GetVideoInfo: function() { // %struct.SDL_VideoInfo = type { i32, i32, %struct.SDL_PixelFormat*, i32, i32 } - 5 fields of quantum size var ret = _malloc(5*QUANTUM_SIZE); @@ -176,7 +178,7 @@ mergeInto(Library, { IMG_Load: function(filename) { filename = Pointer_stringify(filename); var format = filename.split('.').slice(-1)[0]; - var data = Browser.syncLoad(filename); + var data = readBinary(filename); var raw = Browser.decodeImage(data, format); var surf = SDL.makeSurface(raw.width, raw.height, 0); // XXX Extremely inefficient! |