2019-01-04 13:14:32 +00:00
|
|
|
(function() {
|
|
|
|
var wasm;
|
|
|
|
const __exports = {};
|
|
|
|
|
|
|
|
|
|
|
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
|
|
|
|
|
|
let cachegetUint8Memory = null;
|
|
|
|
function getUint8Memory() {
|
|
|
|
if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) {
|
|
|
|
cachegetUint8Memory = new Uint8Array(wasm.memory.buffer);
|
|
|
|
}
|
|
|
|
return cachegetUint8Memory;
|
|
|
|
}
|
|
|
|
|
|
|
|
let WASM_VECTOR_LEN = 0;
|
|
|
|
|
|
|
|
function passStringToWasm(arg) {
|
|
|
|
|
|
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
|
|
const ptr = wasm.__wbindgen_malloc(buf.length);
|
|
|
|
getUint8Memory().set(buf, ptr);
|
|
|
|
WASM_VECTOR_LEN = buf.length;
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @param {string} arg0
|
2019-01-12 22:07:30 +00:00
|
|
|
* @returns {State}
|
2019-01-04 13:14:32 +00:00
|
|
|
*/
|
2019-01-12 22:07:30 +00:00
|
|
|
__exports.new_webgl_gui = function(arg0) {
|
2019-01-04 13:14:32 +00:00
|
|
|
const ptr0 = passStringToWasm(arg0);
|
|
|
|
const len0 = WASM_VECTOR_LEN;
|
|
|
|
try {
|
2019-01-12 22:07:30 +00:00
|
|
|
return State.__wrap(wasm.new_webgl_gui(ptr0, len0));
|
2019-01-04 13:14:32 +00:00
|
|
|
|
|
|
|
} finally {
|
|
|
|
wasm.__wbindgen_free(ptr0, len0 * 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2019-01-12 22:07:30 +00:00
|
|
|
* @param {State} arg0
|
2019-01-04 13:14:32 +00:00
|
|
|
* @param {string} arg1
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2019-01-12 22:07:30 +00:00
|
|
|
__exports.run_gui = function(arg0, arg1) {
|
2019-01-04 13:14:32 +00:00
|
|
|
const ptr1 = passStringToWasm(arg1);
|
|
|
|
const len1 = WASM_VECTOR_LEN;
|
|
|
|
try {
|
2019-01-12 22:07:30 +00:00
|
|
|
return wasm.run_gui(arg0.ptr, ptr1, len1);
|
2019-01-04 13:14:32 +00:00
|
|
|
|
|
|
|
} finally {
|
|
|
|
wasm.__wbindgen_free(ptr1, len1 * 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const heap = new Array(32);
|
|
|
|
|
|
|
|
heap.fill(undefined);
|
|
|
|
|
|
|
|
heap.push(undefined, null, true, false);
|
|
|
|
|
|
|
|
function getObject(idx) { return heap[idx]; }
|
|
|
|
|
2019-01-05 14:28:07 +00:00
|
|
|
let cachedTextDecoder = new TextDecoder('utf-8');
|
|
|
|
|
|
|
|
function getStringFromWasm(ptr, len) {
|
|
|
|
return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));
|
|
|
|
}
|
|
|
|
|
2019-01-04 13:14:32 +00:00
|
|
|
let heap_next = heap.length;
|
|
|
|
|
|
|
|
function addHeapObject(obj) {
|
|
|
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
|
|
const idx = heap_next;
|
|
|
|
heap_next = heap[idx];
|
|
|
|
|
|
|
|
heap[idx] = obj;
|
|
|
|
return idx;
|
|
|
|
}
|
|
|
|
|
|
|
|
function isLikeNone(x) {
|
|
|
|
return x === undefined || x === null;
|
|
|
|
}
|
|
|
|
|
|
|
|
__exports.__widl_f_get_element_by_id_Document = function(arg0, arg1, arg2) {
|
|
|
|
let varg1 = getStringFromWasm(arg1, arg2);
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).getElementById(varg1);
|
2019-01-04 13:14:32 +00:00
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_instanceof_HTMLCanvasElement = function(idx) {
|
|
|
|
return getObject(idx) instanceof HTMLCanvasElement ? 1 : 0;
|
|
|
|
};
|
|
|
|
|
2019-01-05 14:28:07 +00:00
|
|
|
let cachegetUint32Memory = null;
|
|
|
|
function getUint32Memory() {
|
|
|
|
if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) {
|
|
|
|
cachegetUint32Memory = new Uint32Array(wasm.memory.buffer);
|
|
|
|
}
|
|
|
|
return cachegetUint32Memory;
|
|
|
|
}
|
|
|
|
|
2019-01-04 13:14:32 +00:00
|
|
|
__exports.__widl_f_get_context_HTMLCanvasElement = function(arg0, arg1, arg2, exnptr) {
|
|
|
|
let varg1 = getStringFromWasm(arg1, arg2);
|
|
|
|
try {
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).getContext(varg1);
|
2019-01-04 13:14:32 +00:00
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
const view = getUint32Memory();
|
|
|
|
view[exnptr / 4] = 1;
|
|
|
|
view[exnptr / 4 + 1] = addHeapObject(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_width_HTMLCanvasElement = function(arg0) {
|
2019-01-17 23:34:01 +00:00
|
|
|
return getObject(arg0).width;
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_height_HTMLCanvasElement = function(arg0) {
|
2019-01-17 23:34:01 +00:00
|
|
|
return getObject(arg0).height;
|
2019-01-12 22:07:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_now_Performance = function(arg0) {
|
2019-01-17 23:34:01 +00:00
|
|
|
return getObject(arg0).now();
|
2019-01-12 22:07:30 +00:00
|
|
|
};
|
|
|
|
|
2019-01-04 13:14:32 +00:00
|
|
|
__exports.__widl_instanceof_WebGLRenderingContext = function(idx) {
|
|
|
|
return getObject(idx) instanceof WebGLRenderingContext ? 1 : 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_buffer_data_with_array_buffer_view_WebGLRenderingContext = function(arg0, arg1, arg2, arg3) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).bufferData(arg1, getObject(arg2), arg3);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
2019-01-05 14:28:07 +00:00
|
|
|
function getArrayU8FromWasm(ptr, len) {
|
|
|
|
return getUint8Memory().subarray(ptr / 1, ptr / 1 + len);
|
|
|
|
}
|
|
|
|
|
|
|
|
__exports.__widl_f_tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array_WebGLRenderingContext = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, exnptr) {
|
|
|
|
let varg9 = arg9 == 0 ? undefined : getArrayU8FromWasm(arg9, arg10);
|
|
|
|
try {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).texImage2D(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, varg9);
|
2019-01-05 14:28:07 +00:00
|
|
|
} catch (e) {
|
|
|
|
const view = getUint32Memory();
|
|
|
|
view[exnptr / 4] = 1;
|
|
|
|
view[exnptr / 4 + 1] = addHeapObject(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_active_texture_WebGLRenderingContext = function(arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).activeTexture(arg1);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_attach_shader_WebGLRenderingContext = function(arg0, arg1, arg2) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).attachShader(getObject(arg1), getObject(arg2));
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_bind_buffer_WebGLRenderingContext = function(arg0, arg1, arg2) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).bindBuffer(arg1, getObject(arg2));
|
2019-01-05 14:28:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_bind_texture_WebGLRenderingContext = function(arg0, arg1, arg2) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).bindTexture(arg1, getObject(arg2));
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_blend_func_WebGLRenderingContext = function(arg0, arg1, arg2) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).blendFunc(arg1, arg2);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_clear_WebGLRenderingContext = function(arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).clear(arg1);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_clear_color_WebGLRenderingContext = function(arg0, arg1, arg2, arg3, arg4) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).clearColor(arg1, arg2, arg3, arg4);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_compile_shader_WebGLRenderingContext = function(arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).compileShader(getObject(arg1));
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_create_buffer_WebGLRenderingContext = function(arg0) {
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).createBuffer();
|
2019-01-04 13:14:32 +00:00
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_create_program_WebGLRenderingContext = function(arg0) {
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).createProgram();
|
2019-01-04 13:14:32 +00:00
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_create_shader_WebGLRenderingContext = function(arg0, arg1) {
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).createShader(arg1);
|
2019-01-04 13:14:32 +00:00
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-01-05 14:28:07 +00:00
|
|
|
__exports.__widl_f_create_texture_WebGLRenderingContext = function(arg0) {
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).createTexture();
|
2019-01-05 14:28:07 +00:00
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-01-04 13:14:32 +00:00
|
|
|
__exports.__widl_f_draw_elements_with_i32_WebGLRenderingContext = function(arg0, arg1, arg2, arg3, arg4) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).drawElements(arg1, arg2, arg3, arg4);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_enable_WebGLRenderingContext = function(arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).enable(arg1);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_enable_vertex_attrib_array_WebGLRenderingContext = function(arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).enableVertexAttribArray(arg1);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_get_attrib_location_WebGLRenderingContext = function(arg0, arg1, arg2, arg3) {
|
|
|
|
let varg2 = getStringFromWasm(arg2, arg3);
|
2019-01-17 23:34:01 +00:00
|
|
|
return getObject(arg0).getAttribLocation(getObject(arg1), varg2);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_get_program_info_log_WebGLRenderingContext = function(ret, arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).getProgramInfoLog(getObject(arg1));
|
2019-01-04 13:14:32 +00:00
|
|
|
const retptr = isLikeNone(val) ? [0, 0] : passStringToWasm(val);
|
|
|
|
const retlen = WASM_VECTOR_LEN;
|
|
|
|
const mem = getUint32Memory();
|
|
|
|
mem[ret / 4] = retptr;
|
|
|
|
mem[ret / 4 + 1] = retlen;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_get_program_parameter_WebGLRenderingContext = function(arg0, arg1, arg2) {
|
2019-01-17 23:34:01 +00:00
|
|
|
return addHeapObject(getObject(arg0).getProgramParameter(getObject(arg1), arg2));
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_get_shader_info_log_WebGLRenderingContext = function(ret, arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).getShaderInfoLog(getObject(arg1));
|
2019-01-04 13:14:32 +00:00
|
|
|
const retptr = isLikeNone(val) ? [0, 0] : passStringToWasm(val);
|
|
|
|
const retlen = WASM_VECTOR_LEN;
|
|
|
|
const mem = getUint32Memory();
|
|
|
|
mem[ret / 4] = retptr;
|
|
|
|
mem[ret / 4 + 1] = retlen;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_get_shader_parameter_WebGLRenderingContext = function(arg0, arg1, arg2) {
|
2019-01-17 23:34:01 +00:00
|
|
|
return addHeapObject(getObject(arg0).getShaderParameter(getObject(arg1), arg2));
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_get_uniform_location_WebGLRenderingContext = function(arg0, arg1, arg2, arg3) {
|
|
|
|
let varg2 = getStringFromWasm(arg2, arg3);
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
const val = getObject(arg0).getUniformLocation(getObject(arg1), varg2);
|
2019-01-04 13:14:32 +00:00
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_link_program_WebGLRenderingContext = function(arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).linkProgram(getObject(arg1));
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_shader_source_WebGLRenderingContext = function(arg0, arg1, arg2, arg3) {
|
|
|
|
let varg2 = getStringFromWasm(arg2, arg3);
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).shaderSource(getObject(arg1), varg2);
|
2019-01-05 14:28:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_tex_parameteri_WebGLRenderingContext = function(arg0, arg1, arg2, arg3) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).texParameteri(arg1, arg2, arg3);
|
2019-01-05 14:28:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_uniform1i_WebGLRenderingContext = function(arg0, arg1, arg2) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).uniform1i(getObject(arg1), arg2);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_uniform2f_WebGLRenderingContext = function(arg0, arg1, arg2, arg3) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).uniform2f(getObject(arg1), arg2, arg3);
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_use_program_WebGLRenderingContext = function(arg0, arg1) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).useProgram(getObject(arg1));
|
2019-01-04 13:14:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_vertex_attrib_pointer_with_i32_WebGLRenderingContext = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).vertexAttribPointer(arg1, arg2, arg3, arg4 !== 0, arg5, arg6);
|
2019-01-12 22:07:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_viewport_WebGLRenderingContext = function(arg0, arg1, arg2, arg3, arg4) {
|
2019-01-17 23:34:01 +00:00
|
|
|
getObject(arg0).viewport(arg1, arg2, arg3, arg4);
|
2019-01-12 22:07:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_drawing_buffer_width_WebGLRenderingContext = function(arg0) {
|
2019-01-17 23:34:01 +00:00
|
|
|
return getObject(arg0).drawingBufferWidth;
|
2019-01-12 22:07:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_drawing_buffer_height_WebGLRenderingContext = function(arg0) {
|
2019-01-17 23:34:01 +00:00
|
|
|
return getObject(arg0).drawingBufferHeight;
|
2019-01-12 22:07:30 +00:00
|
|
|
};
|
|
|
|
|
2019-01-04 13:14:32 +00:00
|
|
|
__exports.__widl_instanceof_Window = function(idx) {
|
|
|
|
return getObject(idx) instanceof Window ? 1 : 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__widl_f_document_Window = function(arg0) {
|
|
|
|
|
|
|
|
const val = getObject(arg0).document;
|
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-01-12 22:07:30 +00:00
|
|
|
__exports.__widl_f_performance_Window = function(arg0) {
|
|
|
|
|
|
|
|
const val = getObject(arg0).performance;
|
|
|
|
return isLikeNone(val) ? 0 : addHeapObject(val);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_new_1b06d86d496d7b40 = function(arg0) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return addHeapObject(new Float32Array(getObject(arg0)));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_subarray_fe30ee182e9ec716 = function(arg0, arg1, arg2) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return addHeapObject(getObject(arg0).subarray(arg1, arg2));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_newnoargs_a6ad1b52f5989ea9 = function(arg0, arg1) {
|
2019-01-04 13:14:32 +00:00
|
|
|
let varg0 = getStringFromWasm(arg0, arg1);
|
|
|
|
return addHeapObject(new Function(varg0));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_call_720151a19a4c6808 = function(arg0, arg1, exnptr) {
|
2019-01-04 13:14:32 +00:00
|
|
|
try {
|
|
|
|
return addHeapObject(getObject(arg0).call(getObject(arg1)));
|
|
|
|
} catch (e) {
|
|
|
|
const view = getUint32Memory();
|
|
|
|
view[exnptr / 4] = 1;
|
|
|
|
view[exnptr / 4 + 1] = addHeapObject(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_new_e9ac55ad4b35397d = function(arg0) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return addHeapObject(new Int16Array(getObject(arg0)));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_subarray_930aeb4c907055d1 = function(arg0, arg1, arg2) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return addHeapObject(getObject(arg0).subarray(arg1, arg2));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_new_d90640b4228ff695 = function(arg0) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return addHeapObject(new Uint8Array(getObject(arg0)));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_subarray_ba3c433705738bca = function(arg0, arg1, arg2) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return addHeapObject(getObject(arg0).subarray(arg1, arg2));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_new_1c85449424e3413d = function(arg0) {
|
2019-01-05 14:28:07 +00:00
|
|
|
return addHeapObject(new Uint16Array(getObject(arg0)));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_subarray_08927d6d29836298 = function(arg0, arg1, arg2) {
|
2019-01-05 14:28:07 +00:00
|
|
|
return addHeapObject(getObject(arg0).subarray(arg1, arg2));
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_instanceof_Memory_7db9a3f810fae661 = function(idx) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return getObject(idx) instanceof WebAssembly.Memory ? 1 : 0;
|
|
|
|
};
|
|
|
|
|
2019-01-17 23:34:01 +00:00
|
|
|
__exports.__wbg_buffer_0346d756c794d630 = function(arg0) {
|
2019-01-04 13:14:32 +00:00
|
|
|
return addHeapObject(getObject(arg0).buffer);
|
|
|
|
};
|
|
|
|
|
2019-01-12 22:07:30 +00:00
|
|
|
function freeState(ptr) {
|
2019-01-04 13:14:32 +00:00
|
|
|
|
2019-01-12 22:07:30 +00:00
|
|
|
wasm.__wbg_state_free(ptr);
|
2019-01-04 13:14:32 +00:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
*/
|
2019-01-12 22:07:30 +00:00
|
|
|
class State {
|
2019-01-04 13:14:32 +00:00
|
|
|
|
|
|
|
static __wrap(ptr) {
|
2019-01-12 22:07:30 +00:00
|
|
|
const obj = Object.create(State.prototype);
|
2019-01-04 13:14:32 +00:00
|
|
|
obj.ptr = ptr;
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
free() {
|
|
|
|
const ptr = this.ptr;
|
|
|
|
this.ptr = 0;
|
2019-01-12 22:07:30 +00:00
|
|
|
freeState(ptr);
|
2019-01-04 13:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2019-01-12 22:07:30 +00:00
|
|
|
__exports.State = State;
|
2019-01-04 13:14:32 +00:00
|
|
|
|
|
|
|
__exports.__wbindgen_object_clone_ref = function(idx) {
|
|
|
|
return addHeapObject(getObject(idx));
|
|
|
|
};
|
|
|
|
|
|
|
|
function dropObject(idx) {
|
|
|
|
if (idx < 36) return;
|
|
|
|
heap[idx] = heap_next;
|
|
|
|
heap_next = idx;
|
|
|
|
}
|
|
|
|
|
|
|
|
__exports.__wbindgen_object_drop_ref = function(i) { dropObject(i); };
|
|
|
|
|
|
|
|
__exports.__wbindgen_string_new = function(p, l) {
|
|
|
|
return addHeapObject(getStringFromWasm(p, l));
|
|
|
|
};
|
|
|
|
|
2019-01-05 14:28:07 +00:00
|
|
|
__exports.__wbindgen_number_get = function(n, invalid) {
|
|
|
|
let obj = getObject(n);
|
|
|
|
if (typeof(obj) === 'number') return obj;
|
|
|
|
getUint8Memory()[invalid] = 1;
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__wbindgen_is_null = function(idx) {
|
|
|
|
return getObject(idx) === null ? 1 : 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__wbindgen_is_undefined = function(idx) {
|
|
|
|
return getObject(idx) === undefined ? 1 : 0;
|
|
|
|
};
|
|
|
|
|
2019-01-04 13:14:32 +00:00
|
|
|
__exports.__wbindgen_boolean_get = function(i) {
|
|
|
|
let v = getObject(i);
|
|
|
|
if (typeof(v) === 'boolean') {
|
|
|
|
return v ? 1 : 0;
|
|
|
|
} else {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-01-05 14:28:07 +00:00
|
|
|
__exports.__wbindgen_is_symbol = function(i) {
|
|
|
|
return typeof(getObject(i)) === 'symbol' ? 1 : 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
__exports.__wbindgen_string_get = function(i, len_ptr) {
|
|
|
|
let obj = getObject(i);
|
|
|
|
if (typeof(obj) !== 'string') return 0;
|
|
|
|
const ptr = passStringToWasm(obj);
|
|
|
|
getUint32Memory()[len_ptr / 4] = WASM_VECTOR_LEN;
|
|
|
|
return ptr;
|
|
|
|
};
|
|
|
|
|
2019-01-04 13:14:32 +00:00
|
|
|
__exports.__wbindgen_memory = function() { return addHeapObject(wasm.memory); };
|
|
|
|
|
|
|
|
function takeObject(idx) {
|
|
|
|
const ret = getObject(idx);
|
|
|
|
dropObject(idx);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
__exports.__wbindgen_rethrow = function(idx) { throw takeObject(idx); };
|
|
|
|
|
|
|
|
__exports.__wbindgen_throw = function(ptr, len) {
|
|
|
|
throw new Error(getStringFromWasm(ptr, len));
|
|
|
|
};
|
|
|
|
|
|
|
|
function init(path_or_module) {
|
|
|
|
let instantiation;
|
2019-01-12 22:07:30 +00:00
|
|
|
const imports = { './emigui_wasm': __exports };
|
2019-01-04 13:14:32 +00:00
|
|
|
if (path_or_module instanceof WebAssembly.Module) {
|
|
|
|
instantiation = WebAssembly.instantiate(path_or_module, imports)
|
|
|
|
.then(instance => {
|
|
|
|
return { instance, module: path_or_module }
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
const data = fetch(path_or_module);
|
|
|
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
|
|
instantiation = WebAssembly.instantiateStreaming(data, imports);
|
|
|
|
} else {
|
|
|
|
instantiation = data
|
|
|
|
.then(response => response.arrayBuffer())
|
|
|
|
.then(buffer => WebAssembly.instantiate(buffer, imports));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return instantiation.then(({instance}) => {
|
|
|
|
wasm = init.wasm = instance.exports;
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
self.wasm_bindgen = Object.assign(init, __exports);
|
|
|
|
})();
|