diff options
-rw-r--r-- | src/library.js | 6 | ||||
-rw-r--r-- | src/library_openal.js | 17 | ||||
-rw-r--r-- | src/parseTools.js | 9 |
3 files changed, 18 insertions, 14 deletions
diff --git a/src/library.js b/src/library.js index 3c9bcb10..352977c9 100644 --- a/src/library.js +++ b/src/library.js @@ -4273,6 +4273,12 @@ LibraryManager.library = { __cxa_guard_release: function() {}, __cxa_guard_abort: function() {}, +#if USE_TYPED_ARRAYS != 2 + _ZTVN10__cxxabiv119__pointer_type_infoE: [0], // is a pointer + _ZTVN10__cxxabiv117__class_type_infoE: [1], // no inherited classes + _ZTVN10__cxxabiv120__si_class_type_infoE: [2], // yes inherited classes +#endif + // Exceptions __cxa_allocate_exception: function(size) { return _malloc(size); diff --git a/src/library_openal.js b/src/library_openal.js index dea986f3..e8a2e223 100644 --- a/src/library_openal.js +++ b/src/library_openal.js @@ -8,12 +8,6 @@ var LibraryOpenAL = { QUEUE_INTERVAL: 25, QUEUE_LOOKAHEAD: 100, - getCurrentTime: function(context) { - // currentTime is frozen during execution, use performance timers to - // emulate the current time at call time - return (window['performance']['now']() - context.startTime) / 1000.0; - }, - updateSources: function(context) { for (var i = 0; i < context.src.length; i++) { AL.updateSource(context.src[i]); @@ -28,7 +22,7 @@ var LibraryOpenAL = { return; } - var currentTime = AL.getCurrentTime(AL.currentContext); + var currentTime = AL.currentContext.ctx.currentTime; var startTime = src.bufferPosition; for (var i = src.buffersPlayed; i < src.queue.length; i++) { @@ -79,7 +73,7 @@ var LibraryOpenAL = { if (src.state !== 0x1013 /* AL_PAUSED */) { src.state = 0x1012 /* AL_PLAYING */; // Reset our position. - src.bufferPosition = AL.getCurrentTime(AL.currentContext); + src.bufferPosition = AL.currentContext.ctx.currentTime; src.buffersPlayed = 0; #if OPENAL_DEBUG console.log('setSourceState resetting and playing source ' + idx); @@ -87,7 +81,7 @@ var LibraryOpenAL = { } else { src.state = 0x1012 /* AL_PLAYING */; // Use the current offset from src.bufferPosition to resume at the correct point. - src.bufferPosition = AL.getCurrentTime(AL.currentContext) - src.bufferPosition; + src.bufferPosition = AL.currentContext.ctx.currentTime - src.bufferPosition; #if OPENAL_DEBUG console.log('setSourceState resuming source ' + idx + ' at ' + src.bufferPosition.toFixed(4)); #endif @@ -98,7 +92,7 @@ var LibraryOpenAL = { if (src.state === 0x1012 /* AL_PLAYING */) { src.state = 0x1013 /* AL_PAUSED */; // Store off the current offset to restore with on resume. - src.bufferPosition = AL.getCurrentTime(AL.currentContext) - src.bufferPosition; + src.bufferPosition = AL.currentContext.ctx.currentTime - src.bufferPosition; AL.stopSourceQueue(src); #if OPENAL_DEBUG console.log('setSourceState pausing source ' + idx + ' at ' + src.bufferPosition.toFixed(4)); @@ -212,8 +206,7 @@ var LibraryOpenAL = { err: 0, src: [], buf: [], - interval: setInterval(function() { AL.updateSources(context); }, AL.QUEUE_INTERVAL), - startTime: window['performance']['now']() + interval: setInterval(function() { AL.updateSources(context); }, AL.QUEUE_INTERVAL) }; AL.contexts.push(context); return AL.contexts.length; diff --git a/src/parseTools.js b/src/parseTools.js index 66354dca..90c5acab 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -35,8 +35,13 @@ function preprocess(text) { var op = parts[2]; var value = parts[3]; if (op) { - assert(op === '==') - showStack.push(ident in this && this[ident] == value); + if (op === '==') { + showStack.push(ident in this && this[ident] == value); + } else if (op === '!=') { + showStack.push(!(ident in this && this[ident] == value)); + } else { + error('unsupported preprecessor op ' + op); + } } else { showStack.push(ident in this && this[ident] > 0); } |