Results 1 to 1 of 1

Thread: how to fix your library_openal.js for emscripten 1.37.21

  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,083 Times in 753 Posts

    how to fix your library_openal.js for emscripten 1.37.21

    I would love to use the latest emscripten version, but their current library_openal.js is fucked up. They have largely rewritten it and ended up recalculating stuff in JavaScript with lots of Math.sqrt(...)

    The result of that is that it makes libwebgame unplayable, the frame rate is like 20fps + lots of strange sound bugs. The Performance Profiler in Chrome shows like 20ms per frame in that shitty sound function full of matrix recalculations and Math.sqrt(...)

    The old library_openal.js didn't work out-of-house though too (which might be the reason why the rewrote it, no clue), but I figured this setter/getter bug out, just a bit annoying to fix it for each emscripten installation:



    Around line 653, patch the switch code with this:

    PHP Code:
        switch (param) {
            case 
    0x1004 /* AL_POSITION  */src.position  = [v1v2v3]; break;
            case 
    0x1005 /* AL_DIRECTION */src.direction = [v1v2v3]; break;
            case 
    0x1006 /* AL_VELOCITY  */src.velocity  = [v1v2v3]; break;
            default:
    #if OPENAL_DEBUG
                
    console.log("alSource3f with param " param " not implemented yet");
    #endif
                
    AL.currentContext.err 0xA002 /* AL_INVALID_ENUM */;
                break;
        } 
    timescale 0.01

  2. The Following User Says Thank You to kung foo man For This Useful Post:

    kubislav23 (19th May 2018)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •