aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library.js34
-rw-r--r--src/library_gl.js7
-rw-r--r--src/library_sdl.js4
3 files changed, 26 insertions, 19 deletions
diff --git a/src/library.js b/src/library.js
index 9e56d42e..ea44f259 100644
--- a/src/library.js
+++ b/src/library.js
@@ -90,18 +90,18 @@ LibraryManager.library = {
#if FS_LOG
var inputPath = path;
function log() {
- print('FS.analyzePath("' + inputPath + '", ' +
- dontResolveLastLink + ', ' +
- linksVisited + ') => {' +
- 'isRoot: ' + ret.isRoot + ', ' +
- 'exists: ' + ret.exists + ', ' +
- 'error: ' + ret.error + ', ' +
- 'name: "' + ret.name + '", ' +
- 'path: "' + ret.path + '", ' +
- 'object: ' + ret.object + ', ' +
- 'parentExists: ' + ret.parentExists + ', ' +
- 'parentPath: "' + ret.parentPath + '", ' +
- 'parentObject: ' + ret.parentObject + '}');
+ Module['print']('FS.analyzePath("' + inputPath + '", ' +
+ dontResolveLastLink + ', ' +
+ linksVisited + ') => {' +
+ 'isRoot: ' + ret.isRoot + ', ' +
+ 'exists: ' + ret.exists + ', ' +
+ 'error: ' + ret.error + ', ' +
+ 'name: "' + ret.name + '", ' +
+ 'path: "' + ret.path + '", ' +
+ 'object: ' + ret.object + ', ' +
+ 'parentExists: ' + ret.parentExists + ', ' +
+ 'parentPath: "' + ret.parentPath + '", ' +
+ 'parentObject: ' + ret.parentObject + '}');
}
#endif
path = FS.absolutePath(path);
@@ -177,11 +177,11 @@ LibraryManager.library = {
// Creates a file system record: file, link, device or folder.
createObject: function(parent, name, properties, canRead, canWrite) {
#if FS_LOG
- print('FS.createObject("' + parent + '", ' +
- '"' + name + '", ' +
- JSON.stringify(properties) + ', ' +
- canRead + ', ' +
- canWrite + ')');
+ Module['print']('FS.createObject("' + parent + '", ' +
+ '"' + name + '", ' +
+ JSON.stringify(properties) + ', ' +
+ canRead + ', ' +
+ canWrite + ')');
#endif
if (!parent) parent = '/';
if (typeof parent === 'string') parent = FS.findObject(parent);
diff --git a/src/library_gl.js b/src/library_gl.js
index 8867a830..72246df3 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1835,6 +1835,8 @@ var LibraryGL = {
glPolygonMode: function(){}, // TODO
+ glAlphaFunc: function(){}, // TODO
+
// ClientState/gl*Pointer
glEnableClientState: function(cap, disable) {
@@ -1964,6 +1966,7 @@ var LibraryGL = {
GL.immediate.matrix.lib.mat4.multiply(GL.immediate.matrix[GL.immediate.currentMatrix],
GL.immediate.matrix.lib.mat4.ortho(left, right, bottom, top_, nearVal, farVal));
},
+ glOrthof: 'glOrtho',
glScaled: function(x, y, z) {
GL.immediate.matrix.lib.mat4.scale(GL.immediate.matrix[GL.immediate.currentMatrix], [x, y, z]);
@@ -2042,8 +2045,8 @@ var LibraryGL = {
// Simple pass-through functions. Starred ones have return values. [X] ones have X in the C name but not in the JS name
[[0, 'shadeModel fogi fogfv getError* finish flush'],
- [1, 'clearDepth clearDepth[f] depthFunc enable disable frontFace cullFace clear enableVertexAttribArray disableVertexAttribArray lineWidth clearStencil depthMask stencilMask checkFramebufferStatus* generateMipmap activeTexture blendEquation polygonOffset hint sampleCoverage isEnabled*'],
- [2, 'blendFunc blendEquationSeparate depthRange depthRange[f] stencilMaskSeparate'],
+ [1, 'clearDepth clearDepth[f] depthFunc enable disable frontFace cullFace clear enableVertexAttribArray disableVertexAttribArray lineWidth clearStencil depthMask stencilMask checkFramebufferStatus* generateMipmap activeTexture blendEquation polygonOffset sampleCoverage isEnabled*'],
+ [2, 'blendFunc blendEquationSeparate depthRange depthRange[f] stencilMaskSeparate hint'],
[3, 'texParameteri texParameterf drawArrays vertexAttrib2f stencilFunc stencilOp'],
[4, 'viewport clearColor scissor vertexAttrib3f colorMask drawElements renderbufferStorage blendFuncSeparate blendColor stencilFuncSeparate stencilOpSeparate'],
[5, 'vertexAttrib4f'],
diff --git a/src/library_sdl.js b/src/library_sdl.js
index d6e205ee..472228c1 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -756,6 +756,10 @@ var LibrarySDL = {
IMG_Load__deps: ['SDL_LockSurface'],
IMG_Load: function(filename) {
filename = FS.standardizePath(Pointer_stringify(filename));
+ if (filename[0] == '/') {
+ // Convert the path to relative
+ filename = filename.substr(1);
+ }
var raw = preloadedImages[filename];
if (!raw) {
Runtime.warnOnce('Cannot find preloaded image ' + filename);