@sketch-hq/sketch-web-renderer 12.0.1 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/web-renderer/index.js +1 -1
- package/out/web-renderer/ts/utils/WasmModule.d.ts +1 -1
- package/out/web-renderer/wasm/Debug/web-renderer-debug.js +2885 -4128
- package/out/web-renderer/wasm/Debug/web-renderer-debug.mjs +2886 -4126
- package/out/web-renderer/wasm/Release/web-renderer-release.js +4068 -18
- package/out/web-renderer/wasm/Release/web-renderer-release.mjs +4068 -12
- package/out/web-renderer/{web-renderer-debug-bbc5d18c.js → web-renderer-debug-6a730e1e.js} +544 -825
- package/out/web-renderer/web-renderer-debug-ed8aaadf.js +1 -0
- package/out/web-renderer/web-renderer-release-ada2c2b2.js +1 -0
- package/out/web-renderer/{web-renderer-release-60255953.js → web-renderer-release-fd3e6306.js} +480 -787
- package/package.json +4 -3
- package/out/web-renderer/index-eb861739.js +0 -4742
- package/out/web-renderer/index-edb4bfa7.js +0 -1
- package/out/web-renderer/web-renderer-debug-35622728.js +0 -1
- package/out/web-renderer/web-renderer-release-dfe0d59b.js +0 -1
package/out/web-renderer/{web-renderer-release-60255953.js → web-renderer-release-fd3e6306.js}
RENAMED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import 'react';
|
|
3
|
-
|
|
4
|
-
var WebRendererWasmFactory = function () {
|
|
1
|
+
var WebRendererWasmFactory = (() => {
|
|
5
2
|
var _scriptName = import.meta.url;
|
|
6
3
|
return function () {
|
|
7
4
|
var moduleArg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
5
|
var moduleRtn;
|
|
9
6
|
var Module = Object.assign({}, moduleArg);
|
|
10
7
|
var readyPromiseResolve, readyPromiseReject;
|
|
11
|
-
var readyPromise = new Promise(
|
|
8
|
+
var readyPromise = new Promise((resolve, reject) => {
|
|
12
9
|
readyPromiseResolve = resolve;
|
|
13
10
|
readyPromiseReject = reject;
|
|
14
11
|
});
|
|
15
12
|
var moduleOverrides = Object.assign({}, Module);
|
|
16
13
|
var thisProgram = "./this.program";
|
|
17
|
-
var quit_ =
|
|
14
|
+
var quit_ = (status, toThrow) => {
|
|
18
15
|
throw toThrow;
|
|
19
16
|
};
|
|
20
17
|
var scriptDirectory = "";
|
|
@@ -100,9 +97,7 @@ var WebRendererWasmFactory = function () {
|
|
|
100
97
|
throw e;
|
|
101
98
|
}
|
|
102
99
|
var dataURIPrefix = "data:application/octet-stream;base64,";
|
|
103
|
-
var isDataURI =
|
|
104
|
-
return filename.startsWith(dataURIPrefix);
|
|
105
|
-
};
|
|
100
|
+
var isDataURI = filename => filename.startsWith(dataURIPrefix);
|
|
106
101
|
function findWasmBinary() {
|
|
107
102
|
if (Module["locateFile"]) {
|
|
108
103
|
var f = "web-renderer-release.wasm";
|
|
@@ -125,24 +120,18 @@ var WebRendererWasmFactory = function () {
|
|
|
125
120
|
if (typeof fetch == "function") {
|
|
126
121
|
return fetch(binaryFile, {
|
|
127
122
|
credentials: "same-origin"
|
|
128
|
-
}).then(
|
|
123
|
+
}).then(response => {
|
|
129
124
|
if (!response["ok"]) {
|
|
130
125
|
throw "failed to load wasm binary file at '".concat(binaryFile, "'");
|
|
131
126
|
}
|
|
132
127
|
return response["arrayBuffer"]();
|
|
133
|
-
})
|
|
134
|
-
return getBinarySync(binaryFile);
|
|
135
|
-
});
|
|
128
|
+
}).catch(() => getBinarySync(binaryFile));
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
|
-
return Promise.resolve().then(
|
|
139
|
-
return getBinarySync(binaryFile);
|
|
140
|
-
});
|
|
131
|
+
return Promise.resolve().then(() => getBinarySync(binaryFile));
|
|
141
132
|
}
|
|
142
133
|
function instantiateArrayBuffer(binaryFile, imports, receiver) {
|
|
143
|
-
return getBinaryPromise(binaryFile).then(
|
|
144
|
-
return WebAssembly.instantiate(binary, imports);
|
|
145
|
-
}).then(receiver, function (reason) {
|
|
134
|
+
return getBinaryPromise(binaryFile).then(binary => WebAssembly.instantiate(binary, imports)).then(receiver, reason => {
|
|
146
135
|
err("failed to asynchronously prepare wasm: ".concat(reason));
|
|
147
136
|
abort(reason);
|
|
148
137
|
});
|
|
@@ -151,7 +140,7 @@ var WebRendererWasmFactory = function () {
|
|
|
151
140
|
if (!binary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(binaryFile) && typeof fetch == "function") {
|
|
152
141
|
return fetch(binaryFile, {
|
|
153
142
|
credentials: "same-origin"
|
|
154
|
-
}).then(
|
|
143
|
+
}).then(response => {
|
|
155
144
|
var result = WebAssembly.instantiateStreaming(response, imports);
|
|
156
145
|
return result.then(callback, function (reason) {
|
|
157
146
|
err("wasm streaming compile failed: ".concat(reason));
|
|
@@ -191,7 +180,7 @@ var WebRendererWasmFactory = function () {
|
|
|
191
180
|
}
|
|
192
181
|
}
|
|
193
182
|
if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary();
|
|
194
|
-
instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult)
|
|
183
|
+
instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch(readyPromiseReject);
|
|
195
184
|
return {};
|
|
196
185
|
}
|
|
197
186
|
function ExitStatus(status) {
|
|
@@ -199,23 +188,19 @@ var WebRendererWasmFactory = function () {
|
|
|
199
188
|
this.message = "Program terminated with exit(".concat(status, ")");
|
|
200
189
|
this.status = status;
|
|
201
190
|
}
|
|
202
|
-
var callRuntimeCallbacks =
|
|
191
|
+
var callRuntimeCallbacks = callbacks => {
|
|
203
192
|
while (callbacks.length > 0) {
|
|
204
193
|
callbacks.shift()(Module);
|
|
205
194
|
}
|
|
206
195
|
};
|
|
207
196
|
var noExitRuntime = Module["noExitRuntime"] || true;
|
|
208
|
-
var stackRestore =
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var stackSave = function stackSave() {
|
|
212
|
-
return _emscripten_stack_get_current2();
|
|
213
|
-
};
|
|
214
|
-
var __abort_js = function __abort_js() {
|
|
197
|
+
var stackRestore = val => __emscripten_stack_restore(val);
|
|
198
|
+
var stackSave = () => _emscripten_stack_get_current();
|
|
199
|
+
var __abort_js = () => {
|
|
215
200
|
abort("");
|
|
216
201
|
};
|
|
217
202
|
var structRegistrations = {};
|
|
218
|
-
var runDestructors =
|
|
203
|
+
var runDestructors = destructors => {
|
|
219
204
|
while (destructors.length) {
|
|
220
205
|
var ptr = destructors.pop();
|
|
221
206
|
var del = destructors.pop();
|
|
@@ -229,10 +214,10 @@ var WebRendererWasmFactory = function () {
|
|
|
229
214
|
var registeredTypes = {};
|
|
230
215
|
var typeDependencies = {};
|
|
231
216
|
var InternalError;
|
|
232
|
-
var throwInternalError =
|
|
217
|
+
var throwInternalError = message => {
|
|
233
218
|
throw new InternalError(message);
|
|
234
219
|
};
|
|
235
|
-
var whenDependentTypesAreResolved =
|
|
220
|
+
var whenDependentTypesAreResolved = (myTypes, dependentTypes, getTypeConverters) => {
|
|
236
221
|
myTypes.forEach(function (type) {
|
|
237
222
|
typeDependencies[type] = dependentTypes;
|
|
238
223
|
});
|
|
@@ -248,7 +233,7 @@ var WebRendererWasmFactory = function () {
|
|
|
248
233
|
var typeConverters = new Array(dependentTypes.length);
|
|
249
234
|
var unregisteredTypes = [];
|
|
250
235
|
var registered = 0;
|
|
251
|
-
dependentTypes.forEach(
|
|
236
|
+
dependentTypes.forEach((dt, i) => {
|
|
252
237
|
if (registeredTypes.hasOwnProperty(dt)) {
|
|
253
238
|
typeConverters[i] = registeredTypes[dt];
|
|
254
239
|
} else {
|
|
@@ -256,7 +241,7 @@ var WebRendererWasmFactory = function () {
|
|
|
256
241
|
if (!awaitingDependencies.hasOwnProperty(dt)) {
|
|
257
242
|
awaitingDependencies[dt] = [];
|
|
258
243
|
}
|
|
259
|
-
awaitingDependencies[dt].push(
|
|
244
|
+
awaitingDependencies[dt].push(() => {
|
|
260
245
|
typeConverters[i] = registeredTypes[dt];
|
|
261
246
|
++registered;
|
|
262
247
|
if (registered === unregisteredTypes.length) {
|
|
@@ -269,20 +254,16 @@ var WebRendererWasmFactory = function () {
|
|
|
269
254
|
onComplete(typeConverters);
|
|
270
255
|
}
|
|
271
256
|
};
|
|
272
|
-
var __embind_finalize_value_object =
|
|
257
|
+
var __embind_finalize_value_object = structType => {
|
|
273
258
|
var reg = structRegistrations[structType];
|
|
274
259
|
delete structRegistrations[structType];
|
|
275
260
|
var rawConstructor = reg.rawConstructor;
|
|
276
261
|
var rawDestructor = reg.rawDestructor;
|
|
277
262
|
var fieldRecords = reg.fields;
|
|
278
|
-
var fieldTypes = fieldRecords.map(
|
|
279
|
-
|
|
280
|
-
}).concat(fieldRecords.map(function (field) {
|
|
281
|
-
return field.setterArgumentType;
|
|
282
|
-
}));
|
|
283
|
-
whenDependentTypesAreResolved([structType], fieldTypes, function (fieldTypes) {
|
|
263
|
+
var fieldTypes = fieldRecords.map(field => field.getterReturnType).concat(fieldRecords.map(field => field.setterArgumentType));
|
|
264
|
+
whenDependentTypesAreResolved([structType], fieldTypes, fieldTypes => {
|
|
284
265
|
var fields = {};
|
|
285
|
-
fieldRecords.forEach(
|
|
266
|
+
fieldRecords.forEach((field, i) => {
|
|
286
267
|
var fieldName = field.fieldName;
|
|
287
268
|
var getterReturnType = fieldTypes[i];
|
|
288
269
|
var getter = field.getter;
|
|
@@ -291,10 +272,8 @@ var WebRendererWasmFactory = function () {
|
|
|
291
272
|
var setter = field.setter;
|
|
292
273
|
var setterContext = field.setterContext;
|
|
293
274
|
fields[fieldName] = {
|
|
294
|
-
read:
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
write: function write(ptr, o) {
|
|
275
|
+
read: ptr => getterReturnType["fromWireType"](getter(getterContext, ptr)),
|
|
276
|
+
write: (ptr, o) => {
|
|
298
277
|
var destructors = [];
|
|
299
278
|
setter(setterContext, ptr, setterArgumentType["toWireType"](destructors, o));
|
|
300
279
|
runDestructors(destructors);
|
|
@@ -303,7 +282,7 @@ var WebRendererWasmFactory = function () {
|
|
|
303
282
|
});
|
|
304
283
|
return [{
|
|
305
284
|
name: reg.name,
|
|
306
|
-
"fromWireType":
|
|
285
|
+
"fromWireType": ptr => {
|
|
307
286
|
var rv = {};
|
|
308
287
|
for (var i in fields) {
|
|
309
288
|
rv[i] = fields[i].read(ptr);
|
|
@@ -311,7 +290,7 @@ var WebRendererWasmFactory = function () {
|
|
|
311
290
|
rawDestructor(ptr);
|
|
312
291
|
return rv;
|
|
313
292
|
},
|
|
314
|
-
"toWireType":
|
|
293
|
+
"toWireType": (destructors, o) => {
|
|
315
294
|
for (var fieldName in fields) {
|
|
316
295
|
if (!(fieldName in o)) {
|
|
317
296
|
throw new TypeError("Missing field: \"".concat(fieldName, "\""));
|
|
@@ -332,18 +311,18 @@ var WebRendererWasmFactory = function () {
|
|
|
332
311
|
}];
|
|
333
312
|
});
|
|
334
313
|
};
|
|
335
|
-
var embindRepr =
|
|
314
|
+
var embindRepr = v => {
|
|
336
315
|
if (v === null) {
|
|
337
316
|
return "null";
|
|
338
317
|
}
|
|
339
|
-
var t =
|
|
318
|
+
var t = typeof v;
|
|
340
319
|
if (t === "object" || t === "array" || t === "function") {
|
|
341
320
|
return v.toString();
|
|
342
321
|
} else {
|
|
343
322
|
return "" + v;
|
|
344
323
|
}
|
|
345
324
|
};
|
|
346
|
-
var embind_init_charCodes =
|
|
325
|
+
var embind_init_charCodes = () => {
|
|
347
326
|
var codes = new Array(256);
|
|
348
327
|
for (var i = 0; i < 256; ++i) {
|
|
349
328
|
codes[i] = String.fromCharCode(i);
|
|
@@ -351,7 +330,7 @@ var WebRendererWasmFactory = function () {
|
|
|
351
330
|
embind_charCodes = codes;
|
|
352
331
|
};
|
|
353
332
|
var embind_charCodes;
|
|
354
|
-
var readLatin1String =
|
|
333
|
+
var readLatin1String = ptr => {
|
|
355
334
|
var ret = "";
|
|
356
335
|
var c = ptr;
|
|
357
336
|
while (HEAPU8[c]) {
|
|
@@ -360,7 +339,7 @@ var WebRendererWasmFactory = function () {
|
|
|
360
339
|
return ret;
|
|
361
340
|
};
|
|
362
341
|
var BindingError;
|
|
363
|
-
var throwBindingError =
|
|
342
|
+
var throwBindingError = message => {
|
|
364
343
|
throw new BindingError(message);
|
|
365
344
|
};
|
|
366
345
|
function sharedRegisterType(rawType, registeredInstance) {
|
|
@@ -381,9 +360,7 @@ var WebRendererWasmFactory = function () {
|
|
|
381
360
|
if (awaitingDependencies.hasOwnProperty(rawType)) {
|
|
382
361
|
var callbacks = awaitingDependencies[rawType];
|
|
383
362
|
delete awaitingDependencies[rawType];
|
|
384
|
-
callbacks.forEach(
|
|
385
|
-
return cb();
|
|
386
|
-
});
|
|
363
|
+
callbacks.forEach(cb => cb());
|
|
387
364
|
}
|
|
388
365
|
}
|
|
389
366
|
function registerType(rawType, registeredInstance) {
|
|
@@ -393,44 +370,26 @@ var WebRendererWasmFactory = function () {
|
|
|
393
370
|
}
|
|
394
371
|
return sharedRegisterType(rawType, registeredInstance, options);
|
|
395
372
|
}
|
|
396
|
-
var integerReadValueFromPointer =
|
|
373
|
+
var integerReadValueFromPointer = (name, width, signed) => {
|
|
397
374
|
switch (width) {
|
|
398
375
|
case 1:
|
|
399
|
-
return signed ?
|
|
400
|
-
return HEAP8[pointer];
|
|
401
|
-
} : function (pointer) {
|
|
402
|
-
return HEAPU8[pointer];
|
|
403
|
-
};
|
|
376
|
+
return signed ? pointer => HEAP8[pointer] : pointer => HEAPU8[pointer];
|
|
404
377
|
case 2:
|
|
405
|
-
return signed ?
|
|
406
|
-
return HEAP16[pointer >> 1];
|
|
407
|
-
} : function (pointer) {
|
|
408
|
-
return HEAPU16[pointer >> 1];
|
|
409
|
-
};
|
|
378
|
+
return signed ? pointer => HEAP16[pointer >> 1] : pointer => HEAPU16[pointer >> 1];
|
|
410
379
|
case 4:
|
|
411
|
-
return signed ?
|
|
412
|
-
return HEAP32[pointer >> 2];
|
|
413
|
-
} : function (pointer) {
|
|
414
|
-
return HEAPU32[pointer >> 2];
|
|
415
|
-
};
|
|
380
|
+
return signed ? pointer => HEAP32[pointer >> 2] : pointer => HEAPU32[pointer >> 2];
|
|
416
381
|
case 8:
|
|
417
|
-
return signed ?
|
|
418
|
-
return HEAP64[pointer >> 3];
|
|
419
|
-
} : function (pointer) {
|
|
420
|
-
return HEAPU64[pointer >> 3];
|
|
421
|
-
};
|
|
382
|
+
return signed ? pointer => HEAP64[pointer >> 3] : pointer => HEAPU64[pointer >> 3];
|
|
422
383
|
default:
|
|
423
384
|
throw new TypeError("invalid integer width (".concat(width, "): ").concat(name));
|
|
424
385
|
}
|
|
425
386
|
};
|
|
426
|
-
var __embind_register_bigint =
|
|
387
|
+
var __embind_register_bigint = (primitiveType, name, size, minRange, maxRange) => {
|
|
427
388
|
name = readLatin1String(name);
|
|
428
389
|
var isUnsignedType = name.indexOf("u") != -1;
|
|
429
390
|
registerType(primitiveType, {
|
|
430
391
|
name: name,
|
|
431
|
-
"fromWireType":
|
|
432
|
-
return value;
|
|
433
|
-
},
|
|
392
|
+
"fromWireType": value => value,
|
|
434
393
|
"toWireType": function toWireType(destructors, value) {
|
|
435
394
|
if (typeof value != "bigint" && typeof value != "number") {
|
|
436
395
|
throw new TypeError("Cannot convert \"".concat(embindRepr(value), "\" to ").concat(this.name));
|
|
@@ -446,7 +405,7 @@ var WebRendererWasmFactory = function () {
|
|
|
446
405
|
});
|
|
447
406
|
};
|
|
448
407
|
var GenericWireTypeSize = 8;
|
|
449
|
-
var __embind_register_bool =
|
|
408
|
+
var __embind_register_bool = (rawType, name, trueValue, falseValue) => {
|
|
450
409
|
name = readLatin1String(name);
|
|
451
410
|
registerType(rawType, {
|
|
452
411
|
name: name,
|
|
@@ -463,57 +422,53 @@ var WebRendererWasmFactory = function () {
|
|
|
463
422
|
destructorFunction: null
|
|
464
423
|
});
|
|
465
424
|
};
|
|
466
|
-
var shallowCopyInternalPointer =
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
};
|
|
477
|
-
var throwInstanceAlreadyDeleted = function throwInstanceAlreadyDeleted(obj) {
|
|
425
|
+
var shallowCopyInternalPointer = o => ({
|
|
426
|
+
count: o.count,
|
|
427
|
+
deleteScheduled: o.deleteScheduled,
|
|
428
|
+
preservePointerOnDelete: o.preservePointerOnDelete,
|
|
429
|
+
ptr: o.ptr,
|
|
430
|
+
ptrType: o.ptrType,
|
|
431
|
+
smartPtr: o.smartPtr,
|
|
432
|
+
smartPtrType: o.smartPtrType
|
|
433
|
+
});
|
|
434
|
+
var throwInstanceAlreadyDeleted = obj => {
|
|
478
435
|
function getInstanceTypeName(handle) {
|
|
479
436
|
return handle.$$.ptrType.registeredClass.name;
|
|
480
437
|
}
|
|
481
438
|
throwBindingError(getInstanceTypeName(obj) + " instance already deleted");
|
|
482
439
|
};
|
|
483
440
|
var finalizationRegistry = false;
|
|
484
|
-
var detachFinalizer =
|
|
485
|
-
var runDestructor =
|
|
441
|
+
var detachFinalizer = handle => {};
|
|
442
|
+
var runDestructor = $$ => {
|
|
486
443
|
if ($$.smartPtr) {
|
|
487
444
|
$$.smartPtrType.rawDestructor($$.smartPtr);
|
|
488
445
|
} else {
|
|
489
446
|
$$.ptrType.registeredClass.rawDestructor($$.ptr);
|
|
490
447
|
}
|
|
491
448
|
};
|
|
492
|
-
var releaseClassHandle =
|
|
449
|
+
var releaseClassHandle = $$ => {
|
|
493
450
|
$$.count.value -= 1;
|
|
494
451
|
var toDelete = 0 === $$.count.value;
|
|
495
452
|
if (toDelete) {
|
|
496
453
|
runDestructor($$);
|
|
497
454
|
}
|
|
498
455
|
};
|
|
499
|
-
var
|
|
456
|
+
var downcastPointer = (ptr, ptrClass, desiredClass) => {
|
|
500
457
|
if (ptrClass === desiredClass) {
|
|
501
458
|
return ptr;
|
|
502
459
|
}
|
|
503
460
|
if (undefined === desiredClass.baseClass) {
|
|
504
461
|
return null;
|
|
505
462
|
}
|
|
506
|
-
var rv =
|
|
463
|
+
var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass);
|
|
507
464
|
if (rv === null) {
|
|
508
465
|
return null;
|
|
509
466
|
}
|
|
510
467
|
return desiredClass.downcast(rv);
|
|
511
468
|
};
|
|
512
469
|
var registeredPointers = {};
|
|
513
|
-
var getInheritedInstanceCount =
|
|
514
|
-
|
|
515
|
-
};
|
|
516
|
-
var getLiveInheritedInstances = function getLiveInheritedInstances() {
|
|
470
|
+
var getInheritedInstanceCount = () => Object.keys(registeredInstances).length;
|
|
471
|
+
var getLiveInheritedInstances = () => {
|
|
517
472
|
var rv = [];
|
|
518
473
|
for (var k in registeredInstances) {
|
|
519
474
|
if (registeredInstances.hasOwnProperty(k)) {
|
|
@@ -523,7 +478,7 @@ var WebRendererWasmFactory = function () {
|
|
|
523
478
|
return rv;
|
|
524
479
|
};
|
|
525
480
|
var deletionQueue = [];
|
|
526
|
-
var flushPendingDeletes =
|
|
481
|
+
var flushPendingDeletes = () => {
|
|
527
482
|
while (deletionQueue.length) {
|
|
528
483
|
var obj = deletionQueue.pop();
|
|
529
484
|
obj.$$.deleteScheduled = false;
|
|
@@ -531,20 +486,20 @@ var WebRendererWasmFactory = function () {
|
|
|
531
486
|
}
|
|
532
487
|
};
|
|
533
488
|
var delayFunction;
|
|
534
|
-
var setDelayFunction =
|
|
489
|
+
var setDelayFunction = fn => {
|
|
535
490
|
delayFunction = fn;
|
|
536
491
|
if (deletionQueue.length && delayFunction) {
|
|
537
492
|
delayFunction(flushPendingDeletes);
|
|
538
493
|
}
|
|
539
494
|
};
|
|
540
|
-
var init_embind =
|
|
495
|
+
var init_embind = () => {
|
|
541
496
|
Module["getInheritedInstanceCount"] = getInheritedInstanceCount;
|
|
542
497
|
Module["getLiveInheritedInstances"] = getLiveInheritedInstances;
|
|
543
498
|
Module["flushPendingDeletes"] = flushPendingDeletes;
|
|
544
499
|
Module["setDelayFunction"] = setDelayFunction;
|
|
545
500
|
};
|
|
546
501
|
var registeredInstances = {};
|
|
547
|
-
var getBasestPointer =
|
|
502
|
+
var getBasestPointer = (class_, ptr) => {
|
|
548
503
|
if (ptr === undefined) {
|
|
549
504
|
throwBindingError("ptr should not be undefined");
|
|
550
505
|
}
|
|
@@ -554,11 +509,11 @@ var WebRendererWasmFactory = function () {
|
|
|
554
509
|
}
|
|
555
510
|
return ptr;
|
|
556
511
|
};
|
|
557
|
-
var getInheritedInstance =
|
|
512
|
+
var getInheritedInstance = (class_, ptr) => {
|
|
558
513
|
ptr = getBasestPointer(class_, ptr);
|
|
559
514
|
return registeredInstances[ptr];
|
|
560
515
|
};
|
|
561
|
-
var makeClassHandle =
|
|
516
|
+
var makeClassHandle = (prototype, record) => {
|
|
562
517
|
if (!record.ptrType || !record.ptr) {
|
|
563
518
|
throwInternalError("makeClassHandle requires ptr and ptrType");
|
|
564
519
|
}
|
|
@@ -570,7 +525,7 @@ var WebRendererWasmFactory = function () {
|
|
|
570
525
|
record.count = {
|
|
571
526
|
value: 1
|
|
572
527
|
};
|
|
573
|
-
return
|
|
528
|
+
return attachFinalizer(Object.create(prototype, {
|
|
574
529
|
$$: {
|
|
575
530
|
value: record,
|
|
576
531
|
writable: true
|
|
@@ -621,7 +576,7 @@ var WebRendererWasmFactory = function () {
|
|
|
621
576
|
} else {
|
|
622
577
|
toType = registeredPointerRecord.pointerType;
|
|
623
578
|
}
|
|
624
|
-
var dp =
|
|
579
|
+
var dp = downcastPointer(rawPointer, this.registeredClass, toType.registeredClass);
|
|
625
580
|
if (dp === null) {
|
|
626
581
|
return makeDefaultHandle.call(this);
|
|
627
582
|
}
|
|
@@ -639,17 +594,15 @@ var WebRendererWasmFactory = function () {
|
|
|
639
594
|
});
|
|
640
595
|
}
|
|
641
596
|
}
|
|
642
|
-
var
|
|
597
|
+
var attachFinalizer = handle => {
|
|
643
598
|
if ("undefined" === typeof FinalizationRegistry) {
|
|
644
|
-
|
|
645
|
-
return handle;
|
|
646
|
-
};
|
|
599
|
+
attachFinalizer = handle => handle;
|
|
647
600
|
return handle;
|
|
648
601
|
}
|
|
649
|
-
finalizationRegistry = new FinalizationRegistry(
|
|
602
|
+
finalizationRegistry = new FinalizationRegistry(info => {
|
|
650
603
|
releaseClassHandle(info.$$);
|
|
651
604
|
});
|
|
652
|
-
|
|
605
|
+
attachFinalizer = handle => {
|
|
653
606
|
var $$ = handle.$$;
|
|
654
607
|
var hasSmartPtr = !!$$.smartPtr;
|
|
655
608
|
if (hasSmartPtr) {
|
|
@@ -660,14 +613,12 @@ var WebRendererWasmFactory = function () {
|
|
|
660
613
|
}
|
|
661
614
|
return handle;
|
|
662
615
|
};
|
|
663
|
-
detachFinalizer =
|
|
664
|
-
|
|
665
|
-
};
|
|
666
|
-
return _attachFinalizer(handle);
|
|
616
|
+
detachFinalizer = handle => finalizationRegistry.unregister(handle);
|
|
617
|
+
return attachFinalizer(handle);
|
|
667
618
|
};
|
|
668
|
-
var init_ClassHandle =
|
|
619
|
+
var init_ClassHandle = () => {
|
|
669
620
|
Object.assign(ClassHandle.prototype, {
|
|
670
|
-
"isAliasOf"
|
|
621
|
+
"isAliasOf"(other) {
|
|
671
622
|
if (!(this instanceof ClassHandle)) {
|
|
672
623
|
return false;
|
|
673
624
|
}
|
|
@@ -689,7 +640,7 @@ var WebRendererWasmFactory = function () {
|
|
|
689
640
|
}
|
|
690
641
|
return leftClass === rightClass && left === right;
|
|
691
642
|
},
|
|
692
|
-
"clone"
|
|
643
|
+
"clone"() {
|
|
693
644
|
if (!this.$$.ptr) {
|
|
694
645
|
throwInstanceAlreadyDeleted(this);
|
|
695
646
|
}
|
|
@@ -697,7 +648,7 @@ var WebRendererWasmFactory = function () {
|
|
|
697
648
|
this.$$.count.value += 1;
|
|
698
649
|
return this;
|
|
699
650
|
} else {
|
|
700
|
-
var clone =
|
|
651
|
+
var clone = attachFinalizer(Object.create(Object.getPrototypeOf(this), {
|
|
701
652
|
$$: {
|
|
702
653
|
value: shallowCopyInternalPointer(this.$$)
|
|
703
654
|
}
|
|
@@ -707,7 +658,7 @@ var WebRendererWasmFactory = function () {
|
|
|
707
658
|
return clone;
|
|
708
659
|
}
|
|
709
660
|
},
|
|
710
|
-
"delete"
|
|
661
|
+
"delete"() {
|
|
711
662
|
if (!this.$$.ptr) {
|
|
712
663
|
throwInstanceAlreadyDeleted(this);
|
|
713
664
|
}
|
|
@@ -721,10 +672,10 @@ var WebRendererWasmFactory = function () {
|
|
|
721
672
|
this.$$.ptr = undefined;
|
|
722
673
|
}
|
|
723
674
|
},
|
|
724
|
-
"isDeleted"
|
|
675
|
+
"isDeleted"() {
|
|
725
676
|
return !this.$$.ptr;
|
|
726
677
|
},
|
|
727
|
-
"deleteLater"
|
|
678
|
+
"deleteLater"() {
|
|
728
679
|
if (!this.$$.ptr) {
|
|
729
680
|
throwInstanceAlreadyDeleted(this);
|
|
730
681
|
}
|
|
@@ -741,12 +692,10 @@ var WebRendererWasmFactory = function () {
|
|
|
741
692
|
});
|
|
742
693
|
};
|
|
743
694
|
function ClassHandle() {}
|
|
744
|
-
var createNamedFunction =
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
};
|
|
749
|
-
var ensureOverloadTable = function ensureOverloadTable(proto, methodName, humanName) {
|
|
695
|
+
var createNamedFunction = (name, body) => Object.defineProperty(body, "name", {
|
|
696
|
+
value: name
|
|
697
|
+
});
|
|
698
|
+
var ensureOverloadTable = (proto, methodName, humanName) => {
|
|
750
699
|
if (undefined === proto[methodName].overloadTable) {
|
|
751
700
|
var prevFunc = proto[methodName];
|
|
752
701
|
proto[methodName] = function () {
|
|
@@ -762,7 +711,7 @@ var WebRendererWasmFactory = function () {
|
|
|
762
711
|
proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
|
|
763
712
|
}
|
|
764
713
|
};
|
|
765
|
-
var exposePublicSymbol =
|
|
714
|
+
var exposePublicSymbol = (name, value, numArguments) => {
|
|
766
715
|
if (Module.hasOwnProperty(name)) {
|
|
767
716
|
if (undefined === numArguments || undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments]) {
|
|
768
717
|
throwBindingError("Cannot register public name '".concat(name, "' twice"));
|
|
@@ -781,7 +730,7 @@ var WebRendererWasmFactory = function () {
|
|
|
781
730
|
};
|
|
782
731
|
var char_0 = 48;
|
|
783
732
|
var char_9 = 57;
|
|
784
|
-
var makeLegalFunctionName =
|
|
733
|
+
var makeLegalFunctionName = name => {
|
|
785
734
|
if (undefined === name) {
|
|
786
735
|
return "_unknown";
|
|
787
736
|
}
|
|
@@ -803,7 +752,7 @@ var WebRendererWasmFactory = function () {
|
|
|
803
752
|
this.downcast = downcast;
|
|
804
753
|
this.pureVirtualFunctions = [];
|
|
805
754
|
}
|
|
806
|
-
var upcastPointer =
|
|
755
|
+
var upcastPointer = (ptr, ptrClass, desiredClass) => {
|
|
807
756
|
while (ptrClass !== desiredClass) {
|
|
808
757
|
if (!ptrClass.upcast) {
|
|
809
758
|
throwBindingError("Expected null or instance of ".concat(desiredClass.name, ", got an instance of ").concat(ptrClass.name));
|
|
@@ -877,9 +826,7 @@ var WebRendererWasmFactory = function () {
|
|
|
877
826
|
ptr = handle.$$.smartPtr;
|
|
878
827
|
} else {
|
|
879
828
|
var clonedHandle = handle["clone"]();
|
|
880
|
-
ptr = this.rawShare(ptr, Emval.toHandle(
|
|
881
|
-
return clonedHandle["delete"]();
|
|
882
|
-
}));
|
|
829
|
+
ptr = this.rawShare(ptr, Emval.toHandle(() => clonedHandle["delete"]()));
|
|
883
830
|
if (destructors !== null) {
|
|
884
831
|
destructors.push(this.rawDestructor, ptr);
|
|
885
832
|
}
|
|
@@ -911,15 +858,15 @@ var WebRendererWasmFactory = function () {
|
|
|
911
858
|
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
912
859
|
return ptr;
|
|
913
860
|
}
|
|
914
|
-
var init_RegisteredPointer =
|
|
861
|
+
var init_RegisteredPointer = () => {
|
|
915
862
|
Object.assign(RegisteredPointer.prototype, {
|
|
916
|
-
getPointee
|
|
863
|
+
getPointee(ptr) {
|
|
917
864
|
if (this.rawGetPointee) {
|
|
918
865
|
ptr = this.rawGetPointee(ptr);
|
|
919
866
|
}
|
|
920
867
|
return ptr;
|
|
921
868
|
},
|
|
922
|
-
destructor
|
|
869
|
+
destructor(ptr) {
|
|
923
870
|
var _this$rawDestructor;
|
|
924
871
|
(_this$rawDestructor = this.rawDestructor) === null || _this$rawDestructor === void 0 || _this$rawDestructor.call(this, ptr);
|
|
925
872
|
},
|
|
@@ -952,7 +899,7 @@ var WebRendererWasmFactory = function () {
|
|
|
952
899
|
this["toWireType"] = genericPointerToWireType;
|
|
953
900
|
}
|
|
954
901
|
}
|
|
955
|
-
var replacePublicSymbol =
|
|
902
|
+
var replacePublicSymbol = (name, value, numArguments) => {
|
|
956
903
|
if (!Module.hasOwnProperty(name)) {
|
|
957
904
|
throwInternalError("Replacing nonexistent public symbol");
|
|
958
905
|
}
|
|
@@ -965,7 +912,7 @@ var WebRendererWasmFactory = function () {
|
|
|
965
912
|
};
|
|
966
913
|
var wasmTableMirror = [];
|
|
967
914
|
var wasmTable;
|
|
968
|
-
var getWasmTableEntry =
|
|
915
|
+
var getWasmTableEntry = funcPtr => {
|
|
969
916
|
var func = wasmTableMirror[funcPtr];
|
|
970
917
|
if (!func) {
|
|
971
918
|
if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1;
|
|
@@ -973,7 +920,7 @@ var WebRendererWasmFactory = function () {
|
|
|
973
920
|
}
|
|
974
921
|
return func;
|
|
975
922
|
};
|
|
976
|
-
var embind__requireFunction =
|
|
923
|
+
var embind__requireFunction = (signature, rawFunction) => {
|
|
977
924
|
signature = readLatin1String(signature);
|
|
978
925
|
function makeDynCaller() {
|
|
979
926
|
return getWasmTableEntry(rawFunction);
|
|
@@ -984,7 +931,7 @@ var WebRendererWasmFactory = function () {
|
|
|
984
931
|
}
|
|
985
932
|
return fp;
|
|
986
933
|
};
|
|
987
|
-
var extendError =
|
|
934
|
+
var extendError = (baseErrorType, errorName) => {
|
|
988
935
|
var errorClass = createNamedFunction(errorName, function (message) {
|
|
989
936
|
this.name = errorName;
|
|
990
937
|
this.message = message;
|
|
@@ -1005,13 +952,13 @@ var WebRendererWasmFactory = function () {
|
|
|
1005
952
|
return errorClass;
|
|
1006
953
|
};
|
|
1007
954
|
var UnboundTypeError;
|
|
1008
|
-
var getTypeName =
|
|
1009
|
-
var ptr =
|
|
955
|
+
var getTypeName = type => {
|
|
956
|
+
var ptr = ___getTypeName(type);
|
|
1010
957
|
var rv = readLatin1String(ptr);
|
|
1011
958
|
_free(ptr);
|
|
1012
959
|
return rv;
|
|
1013
960
|
};
|
|
1014
|
-
var throwUnboundTypeError =
|
|
961
|
+
var throwUnboundTypeError = (message, types) => {
|
|
1015
962
|
var unboundTypes = [];
|
|
1016
963
|
var seen = {};
|
|
1017
964
|
function visit(type) {
|
|
@@ -1031,7 +978,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1031
978
|
types.forEach(visit);
|
|
1032
979
|
throw new UnboundTypeError("".concat(message, ": ") + unboundTypes.map(getTypeName).join([", "]));
|
|
1033
980
|
};
|
|
1034
|
-
var __embind_register_class =
|
|
981
|
+
var __embind_register_class = (rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name, destructorSignature, rawDestructor) => {
|
|
1035
982
|
name = readLatin1String(name);
|
|
1036
983
|
getActualType = embind__requireFunction(getActualTypeSignature, getActualType);
|
|
1037
984
|
upcast && (upcast = embind__requireFunction(upcastSignature, upcast));
|
|
@@ -1041,7 +988,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1041
988
|
exposePublicSymbol(legalFunctionName, function () {
|
|
1042
989
|
throwUnboundTypeError("Cannot construct ".concat(name, " due to unbound types"), [baseClassRawType]);
|
|
1043
990
|
});
|
|
1044
|
-
whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [],
|
|
991
|
+
whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [], base => {
|
|
1045
992
|
base = base[0];
|
|
1046
993
|
var baseClass;
|
|
1047
994
|
var basePrototype;
|
|
@@ -1100,7 +1047,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1100
1047
|
}
|
|
1101
1048
|
function newFunc(constructor, argumentList) {
|
|
1102
1049
|
if (!(constructor instanceof Function)) {
|
|
1103
|
-
throw new TypeError("new_ called with constructor type ".concat(
|
|
1050
|
+
throw new TypeError("new_ called with constructor type ".concat(typeof constructor, " which is not a function"));
|
|
1104
1051
|
}
|
|
1105
1052
|
var dummy = createNamedFunction(constructor.name || "unknownFunctionName", function () {});
|
|
1106
1053
|
dummy.prototype = constructor.prototype;
|
|
@@ -1170,22 +1117,19 @@ var WebRendererWasmFactory = function () {
|
|
|
1170
1117
|
}
|
|
1171
1118
|
}
|
|
1172
1119
|
}
|
|
1173
|
-
var
|
|
1174
|
-
_createJsInvoker2 = _slicedToArray(_createJsInvoker, 2),
|
|
1175
|
-
args = _createJsInvoker2[0],
|
|
1176
|
-
invokerFnBody = _createJsInvoker2[1];
|
|
1120
|
+
var [args, invokerFnBody] = createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync);
|
|
1177
1121
|
args.push(invokerFnBody);
|
|
1178
|
-
var invokerFn = newFunc(Function, args)
|
|
1122
|
+
var invokerFn = newFunc(Function, args)(...closureArgs);
|
|
1179
1123
|
return createNamedFunction(humanName, invokerFn);
|
|
1180
1124
|
}
|
|
1181
|
-
var heap32VectorToArray =
|
|
1125
|
+
var heap32VectorToArray = (count, firstElement) => {
|
|
1182
1126
|
var array = [];
|
|
1183
1127
|
for (var i = 0; i < count; i++) {
|
|
1184
1128
|
array.push(HEAPU32[firstElement + i * 4 >> 2]);
|
|
1185
1129
|
}
|
|
1186
1130
|
return array;
|
|
1187
1131
|
};
|
|
1188
|
-
var getFunctionName =
|
|
1132
|
+
var getFunctionName = signature => {
|
|
1189
1133
|
signature = signature.trim();
|
|
1190
1134
|
var argsIndex = signature.indexOf("(");
|
|
1191
1135
|
if (argsIndex !== -1) {
|
|
@@ -1194,12 +1138,12 @@ var WebRendererWasmFactory = function () {
|
|
|
1194
1138
|
return signature;
|
|
1195
1139
|
}
|
|
1196
1140
|
};
|
|
1197
|
-
var __embind_register_class_class_function =
|
|
1141
|
+
var __embind_register_class_class_function = (rawClassType, methodName, argCount, rawArgTypesAddr, invokerSignature, rawInvoker, fn, isAsync) => {
|
|
1198
1142
|
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
1199
1143
|
methodName = readLatin1String(methodName);
|
|
1200
1144
|
methodName = getFunctionName(methodName);
|
|
1201
1145
|
rawInvoker = embind__requireFunction(invokerSignature, rawInvoker);
|
|
1202
|
-
whenDependentTypesAreResolved([], [rawClassType],
|
|
1146
|
+
whenDependentTypesAreResolved([], [rawClassType], classType => {
|
|
1203
1147
|
classType = classType[0];
|
|
1204
1148
|
var humanName = "".concat(classType.name, ".").concat(methodName);
|
|
1205
1149
|
function unboundTypesHandler() {
|
|
@@ -1216,7 +1160,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1216
1160
|
ensureOverloadTable(proto, methodName, humanName);
|
|
1217
1161
|
proto[methodName].overloadTable[argCount - 1] = unboundTypesHandler;
|
|
1218
1162
|
}
|
|
1219
|
-
whenDependentTypesAreResolved([], rawArgTypes,
|
|
1163
|
+
whenDependentTypesAreResolved([], rawArgTypes, argTypes => {
|
|
1220
1164
|
var invokerArgsArray = [argTypes[0], null].concat(argTypes.slice(1));
|
|
1221
1165
|
var func = craftInvokerFunction(humanName, invokerArgsArray, null, rawInvoker, fn, isAsync);
|
|
1222
1166
|
if (undefined === proto[methodName].overloadTable) {
|
|
@@ -1226,19 +1170,10 @@ var WebRendererWasmFactory = function () {
|
|
|
1226
1170
|
proto[methodName].overloadTable[argCount - 1] = func;
|
|
1227
1171
|
}
|
|
1228
1172
|
if (classType.registeredClass.__derivedClasses) {
|
|
1229
|
-
var
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1233
|
-
var derivedClass = _step.value;
|
|
1234
|
-
if (!derivedClass.constructor.hasOwnProperty(methodName)) {
|
|
1235
|
-
derivedClass.constructor[methodName] = func;
|
|
1236
|
-
}
|
|
1173
|
+
for (var derivedClass of classType.registeredClass.__derivedClasses) {
|
|
1174
|
+
if (!derivedClass.constructor.hasOwnProperty(methodName)) {
|
|
1175
|
+
derivedClass.constructor[methodName] = func;
|
|
1237
1176
|
}
|
|
1238
|
-
} catch (err) {
|
|
1239
|
-
_iterator.e(err);
|
|
1240
|
-
} finally {
|
|
1241
|
-
_iterator.f();
|
|
1242
1177
|
}
|
|
1243
1178
|
}
|
|
1244
1179
|
return [];
|
|
@@ -1246,10 +1181,10 @@ var WebRendererWasmFactory = function () {
|
|
|
1246
1181
|
return [];
|
|
1247
1182
|
});
|
|
1248
1183
|
};
|
|
1249
|
-
var __embind_register_class_constructor =
|
|
1184
|
+
var __embind_register_class_constructor = (rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) => {
|
|
1250
1185
|
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
1251
1186
|
invoker = embind__requireFunction(invokerSignature, invoker);
|
|
1252
|
-
whenDependentTypesAreResolved([], [rawClassType],
|
|
1187
|
+
whenDependentTypesAreResolved([], [rawClassType], classType => {
|
|
1253
1188
|
classType = classType[0];
|
|
1254
1189
|
var humanName = "constructor ".concat(classType.name);
|
|
1255
1190
|
if (undefined === classType.registeredClass.constructor_body) {
|
|
@@ -1258,10 +1193,10 @@ var WebRendererWasmFactory = function () {
|
|
|
1258
1193
|
if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) {
|
|
1259
1194
|
throw new BindingError("Cannot register multiple constructors with identical number of parameters (".concat(argCount - 1, ") for class '").concat(classType.name, "'! Overload resolution is currently only performed using the parameter count, not actual type info!"));
|
|
1260
1195
|
}
|
|
1261
|
-
classType.registeredClass.constructor_body[argCount - 1] =
|
|
1196
|
+
classType.registeredClass.constructor_body[argCount - 1] = () => {
|
|
1262
1197
|
throwUnboundTypeError("Cannot construct ".concat(classType.name, " due to unbound types"), rawArgTypes);
|
|
1263
1198
|
};
|
|
1264
|
-
whenDependentTypesAreResolved([], rawArgTypes,
|
|
1199
|
+
whenDependentTypesAreResolved([], rawArgTypes, argTypes => {
|
|
1265
1200
|
argTypes.splice(1, 0, null);
|
|
1266
1201
|
classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor);
|
|
1267
1202
|
return [];
|
|
@@ -1269,12 +1204,12 @@ var WebRendererWasmFactory = function () {
|
|
|
1269
1204
|
return [];
|
|
1270
1205
|
});
|
|
1271
1206
|
};
|
|
1272
|
-
var __embind_register_class_function =
|
|
1207
|
+
var __embind_register_class_function = (rawClassType, methodName, argCount, rawArgTypesAddr, invokerSignature, rawInvoker, context, isPureVirtual, isAsync) => {
|
|
1273
1208
|
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
1274
1209
|
methodName = readLatin1String(methodName);
|
|
1275
1210
|
methodName = getFunctionName(methodName);
|
|
1276
1211
|
rawInvoker = embind__requireFunction(invokerSignature, rawInvoker);
|
|
1277
|
-
whenDependentTypesAreResolved([], [rawClassType],
|
|
1212
|
+
whenDependentTypesAreResolved([], [rawClassType], classType => {
|
|
1278
1213
|
classType = classType[0];
|
|
1279
1214
|
var humanName = "".concat(classType.name, ".").concat(methodName);
|
|
1280
1215
|
if (methodName.startsWith("@@")) {
|
|
@@ -1296,7 +1231,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1296
1231
|
ensureOverloadTable(proto, methodName, humanName);
|
|
1297
1232
|
proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler;
|
|
1298
1233
|
}
|
|
1299
|
-
whenDependentTypesAreResolved([], rawArgTypes,
|
|
1234
|
+
whenDependentTypesAreResolved([], rawArgTypes, argTypes => {
|
|
1300
1235
|
var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context, isAsync);
|
|
1301
1236
|
if (undefined === proto[methodName].overloadTable) {
|
|
1302
1237
|
memberFunction.argCount = argCount - 2;
|
|
@@ -1309,7 +1244,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1309
1244
|
return [];
|
|
1310
1245
|
});
|
|
1311
1246
|
};
|
|
1312
|
-
var validateThis =
|
|
1247
|
+
var validateThis = (this_, classType, humanName) => {
|
|
1313
1248
|
if (!(this_ instanceof Object)) {
|
|
1314
1249
|
throwBindingError("".concat(humanName, " with invalid \"this\": ").concat(this_));
|
|
1315
1250
|
}
|
|
@@ -1321,33 +1256,29 @@ var WebRendererWasmFactory = function () {
|
|
|
1321
1256
|
}
|
|
1322
1257
|
return upcastPointer(this_.$$.ptr, this_.$$.ptrType.registeredClass, classType.registeredClass);
|
|
1323
1258
|
};
|
|
1324
|
-
var __embind_register_class_property =
|
|
1259
|
+
var __embind_register_class_property = (classType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) => {
|
|
1325
1260
|
fieldName = readLatin1String(fieldName);
|
|
1326
1261
|
getter = embind__requireFunction(getterSignature, getter);
|
|
1327
|
-
whenDependentTypesAreResolved([], [classType],
|
|
1262
|
+
whenDependentTypesAreResolved([], [classType], classType => {
|
|
1328
1263
|
classType = classType[0];
|
|
1329
1264
|
var humanName = "".concat(classType.name, ".").concat(fieldName);
|
|
1330
1265
|
var desc = {
|
|
1331
|
-
get
|
|
1266
|
+
get() {
|
|
1332
1267
|
throwUnboundTypeError("Cannot access ".concat(humanName, " due to unbound types"), [getterReturnType, setterArgumentType]);
|
|
1333
1268
|
},
|
|
1334
1269
|
enumerable: true,
|
|
1335
1270
|
configurable: true
|
|
1336
1271
|
};
|
|
1337
1272
|
if (setter) {
|
|
1338
|
-
desc.set =
|
|
1339
|
-
return throwUnboundTypeError("Cannot access ".concat(humanName, " due to unbound types"), [getterReturnType, setterArgumentType]);
|
|
1340
|
-
};
|
|
1273
|
+
desc.set = () => throwUnboundTypeError("Cannot access ".concat(humanName, " due to unbound types"), [getterReturnType, setterArgumentType]);
|
|
1341
1274
|
} else {
|
|
1342
|
-
desc.set =
|
|
1343
|
-
return throwBindingError(humanName + " is a read-only property");
|
|
1344
|
-
};
|
|
1275
|
+
desc.set = v => throwBindingError(humanName + " is a read-only property");
|
|
1345
1276
|
}
|
|
1346
1277
|
Object.defineProperty(classType.registeredClass.instancePrototype, fieldName, desc);
|
|
1347
|
-
whenDependentTypesAreResolved([], setter ? [getterReturnType, setterArgumentType] : [getterReturnType],
|
|
1278
|
+
whenDependentTypesAreResolved([], setter ? [getterReturnType, setterArgumentType] : [getterReturnType], types => {
|
|
1348
1279
|
var getterReturnType = types[0];
|
|
1349
1280
|
var desc = {
|
|
1350
|
-
get
|
|
1281
|
+
get() {
|
|
1351
1282
|
var ptr = validateThis(this, classType, humanName + " getter");
|
|
1352
1283
|
return getterReturnType["fromWireType"](getter(getterContext, ptr));
|
|
1353
1284
|
},
|
|
@@ -1371,27 +1302,25 @@ var WebRendererWasmFactory = function () {
|
|
|
1371
1302
|
};
|
|
1372
1303
|
var emval_freelist = [];
|
|
1373
1304
|
var emval_handles = [];
|
|
1374
|
-
var __emval_decref =
|
|
1305
|
+
var __emval_decref = handle => {
|
|
1375
1306
|
if (handle > 9 && 0 === --emval_handles[handle + 1]) {
|
|
1376
1307
|
emval_handles[handle] = undefined;
|
|
1377
1308
|
emval_freelist.push(handle);
|
|
1378
1309
|
}
|
|
1379
1310
|
};
|
|
1380
|
-
var count_emval_handles =
|
|
1381
|
-
|
|
1382
|
-
};
|
|
1383
|
-
var init_emval = function init_emval() {
|
|
1311
|
+
var count_emval_handles = () => emval_handles.length / 2 - 5 - emval_freelist.length;
|
|
1312
|
+
var init_emval = () => {
|
|
1384
1313
|
emval_handles.push(0, 1, undefined, 1, null, 1, true, 1, false, 1);
|
|
1385
1314
|
Module["count_emval_handles"] = count_emval_handles;
|
|
1386
1315
|
};
|
|
1387
1316
|
var Emval = {
|
|
1388
|
-
toValue:
|
|
1317
|
+
toValue: handle => {
|
|
1389
1318
|
if (!handle) {
|
|
1390
1319
|
throwBindingError("Cannot use deleted val. handle = " + handle);
|
|
1391
1320
|
}
|
|
1392
1321
|
return emval_handles[handle];
|
|
1393
1322
|
},
|
|
1394
|
-
toHandle:
|
|
1323
|
+
toHandle: value => {
|
|
1395
1324
|
switch (value) {
|
|
1396
1325
|
case undefined:
|
|
1397
1326
|
return 2;
|
|
@@ -1413,22 +1342,18 @@ var WebRendererWasmFactory = function () {
|
|
|
1413
1342
|
};
|
|
1414
1343
|
var EmValType = {
|
|
1415
1344
|
name: "emscripten::val",
|
|
1416
|
-
"fromWireType":
|
|
1345
|
+
"fromWireType": handle => {
|
|
1417
1346
|
var rv = Emval.toValue(handle);
|
|
1418
1347
|
__emval_decref(handle);
|
|
1419
1348
|
return rv;
|
|
1420
1349
|
},
|
|
1421
|
-
"toWireType":
|
|
1422
|
-
return Emval.toHandle(value);
|
|
1423
|
-
},
|
|
1350
|
+
"toWireType": (destructors, value) => Emval.toHandle(value),
|
|
1424
1351
|
"argPackAdvance": GenericWireTypeSize,
|
|
1425
1352
|
"readValueFromPointer": readPointer,
|
|
1426
1353
|
destructorFunction: null
|
|
1427
1354
|
};
|
|
1428
|
-
var __embind_register_emval =
|
|
1429
|
-
|
|
1430
|
-
};
|
|
1431
|
-
var enumReadValueFromPointer = function enumReadValueFromPointer(name, width, signed) {
|
|
1355
|
+
var __embind_register_emval = rawType => registerType(rawType, EmValType);
|
|
1356
|
+
var enumReadValueFromPointer = (name, width, signed) => {
|
|
1432
1357
|
switch (width) {
|
|
1433
1358
|
case 1:
|
|
1434
1359
|
return signed ? function (pointer) {
|
|
@@ -1452,7 +1377,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1452
1377
|
throw new TypeError("invalid integer width (".concat(width, "): ").concat(name));
|
|
1453
1378
|
}
|
|
1454
1379
|
};
|
|
1455
|
-
var __embind_register_enum =
|
|
1380
|
+
var __embind_register_enum = (rawType, name, size, isSigned) => {
|
|
1456
1381
|
name = readLatin1String(name);
|
|
1457
1382
|
function ctor() {}
|
|
1458
1383
|
ctor.values = {};
|
|
@@ -1462,23 +1387,21 @@ var WebRendererWasmFactory = function () {
|
|
|
1462
1387
|
"fromWireType": function fromWireType(c) {
|
|
1463
1388
|
return this.constructor.values[c];
|
|
1464
1389
|
},
|
|
1465
|
-
"toWireType":
|
|
1466
|
-
return c.value;
|
|
1467
|
-
},
|
|
1390
|
+
"toWireType": (destructors, c) => c.value,
|
|
1468
1391
|
"argPackAdvance": GenericWireTypeSize,
|
|
1469
1392
|
"readValueFromPointer": enumReadValueFromPointer(name, size, isSigned),
|
|
1470
1393
|
destructorFunction: null
|
|
1471
1394
|
});
|
|
1472
1395
|
exposePublicSymbol(name, ctor);
|
|
1473
1396
|
};
|
|
1474
|
-
var requireRegisteredType =
|
|
1397
|
+
var requireRegisteredType = (rawType, humanName) => {
|
|
1475
1398
|
var impl = registeredTypes[rawType];
|
|
1476
1399
|
if (undefined === impl) {
|
|
1477
1400
|
throwBindingError("".concat(humanName, " has unknown type ").concat(getTypeName(rawType)));
|
|
1478
1401
|
}
|
|
1479
1402
|
return impl;
|
|
1480
1403
|
};
|
|
1481
|
-
var __embind_register_enum_value =
|
|
1404
|
+
var __embind_register_enum_value = (rawEnumType, name, enumValue) => {
|
|
1482
1405
|
var enumType = requireRegisteredType(rawEnumType, "enum");
|
|
1483
1406
|
name = readLatin1String(name);
|
|
1484
1407
|
var Enum = enumType.constructor;
|
|
@@ -1493,7 +1416,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1493
1416
|
Enum.values[enumValue] = Value;
|
|
1494
1417
|
Enum[name] = Value;
|
|
1495
1418
|
};
|
|
1496
|
-
var floatReadValueFromPointer =
|
|
1419
|
+
var floatReadValueFromPointer = (name, width) => {
|
|
1497
1420
|
switch (width) {
|
|
1498
1421
|
case 4:
|
|
1499
1422
|
return function (pointer) {
|
|
@@ -1507,34 +1430,26 @@ var WebRendererWasmFactory = function () {
|
|
|
1507
1430
|
throw new TypeError("invalid float width (".concat(width, "): ").concat(name));
|
|
1508
1431
|
}
|
|
1509
1432
|
};
|
|
1510
|
-
var __embind_register_float =
|
|
1433
|
+
var __embind_register_float = (rawType, name, size) => {
|
|
1511
1434
|
name = readLatin1String(name);
|
|
1512
1435
|
registerType(rawType, {
|
|
1513
1436
|
name: name,
|
|
1514
|
-
"fromWireType":
|
|
1515
|
-
|
|
1516
|
-
},
|
|
1517
|
-
"toWireType": function toWireType(destructors, value) {
|
|
1518
|
-
return value;
|
|
1519
|
-
},
|
|
1437
|
+
"fromWireType": value => value,
|
|
1438
|
+
"toWireType": (destructors, value) => value,
|
|
1520
1439
|
"argPackAdvance": GenericWireTypeSize,
|
|
1521
1440
|
"readValueFromPointer": floatReadValueFromPointer(name, size),
|
|
1522
1441
|
destructorFunction: null
|
|
1523
1442
|
});
|
|
1524
1443
|
};
|
|
1525
|
-
var __embind_register_integer =
|
|
1444
|
+
var __embind_register_integer = (primitiveType, name, size, minRange, maxRange) => {
|
|
1526
1445
|
name = readLatin1String(name);
|
|
1527
|
-
var fromWireType =
|
|
1528
|
-
return value;
|
|
1529
|
-
};
|
|
1446
|
+
var fromWireType = value => value;
|
|
1530
1447
|
if (minRange === 0) {
|
|
1531
1448
|
var bitshift = 32 - 8 * size;
|
|
1532
|
-
fromWireType =
|
|
1533
|
-
return value << bitshift >>> bitshift;
|
|
1534
|
-
};
|
|
1449
|
+
fromWireType = value => value << bitshift >>> bitshift;
|
|
1535
1450
|
}
|
|
1536
1451
|
var isUnsignedType = name.includes("unsigned");
|
|
1537
|
-
var checkAssertions =
|
|
1452
|
+
var checkAssertions = (value, toTypeName) => {};
|
|
1538
1453
|
var toWireType;
|
|
1539
1454
|
if (isUnsignedType) {
|
|
1540
1455
|
toWireType = function toWireType(destructors, value) {
|
|
@@ -1556,7 +1471,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1556
1471
|
destructorFunction: null
|
|
1557
1472
|
});
|
|
1558
1473
|
};
|
|
1559
|
-
var __embind_register_memory_view =
|
|
1474
|
+
var __embind_register_memory_view = (rawType, dataTypeIndex, name) => {
|
|
1560
1475
|
var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array];
|
|
1561
1476
|
var TA = typeMapping[dataTypeIndex];
|
|
1562
1477
|
function decodeMemoryView(handle) {
|
|
@@ -1574,22 +1489,22 @@ var WebRendererWasmFactory = function () {
|
|
|
1574
1489
|
ignoreDuplicateRegistrations: true
|
|
1575
1490
|
});
|
|
1576
1491
|
};
|
|
1577
|
-
var __embind_register_optional =
|
|
1492
|
+
var __embind_register_optional = (rawOptionalType, rawType) => {
|
|
1578
1493
|
__embind_register_emval(rawOptionalType);
|
|
1579
1494
|
};
|
|
1580
|
-
var __embind_register_smart_ptr =
|
|
1495
|
+
var __embind_register_smart_ptr = (rawType, rawPointeeType, name, sharingPolicy, getPointeeSignature, rawGetPointee, constructorSignature, rawConstructor, shareSignature, rawShare, destructorSignature, rawDestructor) => {
|
|
1581
1496
|
name = readLatin1String(name);
|
|
1582
1497
|
rawGetPointee = embind__requireFunction(getPointeeSignature, rawGetPointee);
|
|
1583
1498
|
rawConstructor = embind__requireFunction(constructorSignature, rawConstructor);
|
|
1584
1499
|
rawShare = embind__requireFunction(shareSignature, rawShare);
|
|
1585
1500
|
rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
|
|
1586
|
-
whenDependentTypesAreResolved([rawType], [rawPointeeType],
|
|
1501
|
+
whenDependentTypesAreResolved([rawType], [rawPointeeType], pointeeType => {
|
|
1587
1502
|
pointeeType = pointeeType[0];
|
|
1588
1503
|
var registeredPointer = new RegisteredPointer(name, pointeeType.registeredClass, false, false, true, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor);
|
|
1589
1504
|
return [registeredPointer];
|
|
1590
1505
|
});
|
|
1591
1506
|
};
|
|
1592
|
-
var stringToUTF8Array =
|
|
1507
|
+
var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
|
|
1593
1508
|
if (!(maxBytesToWrite > 0)) return 0;
|
|
1594
1509
|
var startIdx = outIdx;
|
|
1595
1510
|
var endIdx = outIdx + maxBytesToWrite - 1;
|
|
@@ -1622,10 +1537,8 @@ var WebRendererWasmFactory = function () {
|
|
|
1622
1537
|
heap[outIdx] = 0;
|
|
1623
1538
|
return outIdx - startIdx;
|
|
1624
1539
|
};
|
|
1625
|
-
var stringToUTF8 =
|
|
1626
|
-
|
|
1627
|
-
};
|
|
1628
|
-
var lengthBytesUTF8 = function lengthBytesUTF8(str) {
|
|
1540
|
+
var stringToUTF8 = (str, outPtr, maxBytesToWrite) => stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
1541
|
+
var lengthBytesUTF8 = str => {
|
|
1629
1542
|
var len = 0;
|
|
1630
1543
|
for (var i = 0; i < str.length; ++i) {
|
|
1631
1544
|
var c = str.charCodeAt(i);
|
|
@@ -1643,7 +1556,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1643
1556
|
return len;
|
|
1644
1557
|
};
|
|
1645
1558
|
var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined;
|
|
1646
|
-
var UTF8ArrayToString =
|
|
1559
|
+
var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
|
|
1647
1560
|
var endIdx = idx + maxBytesToRead;
|
|
1648
1561
|
var endPtr = idx;
|
|
1649
1562
|
while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
|
|
@@ -1677,15 +1590,13 @@ var WebRendererWasmFactory = function () {
|
|
|
1677
1590
|
}
|
|
1678
1591
|
return str;
|
|
1679
1592
|
};
|
|
1680
|
-
var UTF8ToString =
|
|
1681
|
-
|
|
1682
|
-
};
|
|
1683
|
-
var __embind_register_std_string = function __embind_register_std_string(rawType, name) {
|
|
1593
|
+
var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
|
|
1594
|
+
var __embind_register_std_string = (rawType, name) => {
|
|
1684
1595
|
name = readLatin1String(name);
|
|
1685
1596
|
var stdStringIsUTF8 = name === "std::string";
|
|
1686
1597
|
registerType(rawType, {
|
|
1687
1598
|
name: name,
|
|
1688
|
-
"fromWireType"
|
|
1599
|
+
"fromWireType"(value) {
|
|
1689
1600
|
var length = HEAPU32[value >> 2];
|
|
1690
1601
|
var payload = value + 4;
|
|
1691
1602
|
var str;
|
|
@@ -1715,7 +1626,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1715
1626
|
_free(value);
|
|
1716
1627
|
return str;
|
|
1717
1628
|
},
|
|
1718
|
-
"toWireType"
|
|
1629
|
+
"toWireType"(destructors, value) {
|
|
1719
1630
|
if (value instanceof ArrayBuffer) {
|
|
1720
1631
|
value = new Uint8Array(value);
|
|
1721
1632
|
}
|
|
@@ -1757,13 +1668,13 @@ var WebRendererWasmFactory = function () {
|
|
|
1757
1668
|
},
|
|
1758
1669
|
"argPackAdvance": GenericWireTypeSize,
|
|
1759
1670
|
"readValueFromPointer": readPointer,
|
|
1760
|
-
destructorFunction
|
|
1671
|
+
destructorFunction(ptr) {
|
|
1761
1672
|
_free(ptr);
|
|
1762
1673
|
}
|
|
1763
1674
|
});
|
|
1764
1675
|
};
|
|
1765
1676
|
var UTF16Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf-16le") : undefined;
|
|
1766
|
-
var UTF16ToString =
|
|
1677
|
+
var UTF16ToString = (ptr, maxBytesToRead) => {
|
|
1767
1678
|
var endPtr = ptr;
|
|
1768
1679
|
var idx = endPtr >> 1;
|
|
1769
1680
|
var maxIdx = idx + maxBytesToRead / 2;
|
|
@@ -1778,7 +1689,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1778
1689
|
}
|
|
1779
1690
|
return str;
|
|
1780
1691
|
};
|
|
1781
|
-
var stringToUTF16 =
|
|
1692
|
+
var stringToUTF16 = (str, outPtr, maxBytesToWrite) => {
|
|
1782
1693
|
var _maxBytesToWrite;
|
|
1783
1694
|
(_maxBytesToWrite = maxBytesToWrite) !== null && _maxBytesToWrite !== void 0 ? _maxBytesToWrite : maxBytesToWrite = 2147483647;
|
|
1784
1695
|
if (maxBytesToWrite < 2) return 0;
|
|
@@ -1793,10 +1704,8 @@ var WebRendererWasmFactory = function () {
|
|
|
1793
1704
|
HEAP16[outPtr >> 1] = 0;
|
|
1794
1705
|
return outPtr - startPtr;
|
|
1795
1706
|
};
|
|
1796
|
-
var lengthBytesUTF16 =
|
|
1797
|
-
|
|
1798
|
-
};
|
|
1799
|
-
var UTF32ToString = function UTF32ToString(ptr, maxBytesToRead) {
|
|
1707
|
+
var lengthBytesUTF16 = str => str.length * 2;
|
|
1708
|
+
var UTF32ToString = (ptr, maxBytesToRead) => {
|
|
1800
1709
|
var i = 0;
|
|
1801
1710
|
var str = "";
|
|
1802
1711
|
while (!(i >= maxBytesToRead / 4)) {
|
|
@@ -1812,7 +1721,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1812
1721
|
}
|
|
1813
1722
|
return str;
|
|
1814
1723
|
};
|
|
1815
|
-
var stringToUTF32 =
|
|
1724
|
+
var stringToUTF32 = (str, outPtr, maxBytesToWrite) => {
|
|
1816
1725
|
var _maxBytesToWrite2;
|
|
1817
1726
|
(_maxBytesToWrite2 = maxBytesToWrite) !== null && _maxBytesToWrite2 !== void 0 ? _maxBytesToWrite2 : maxBytesToWrite = 2147483647;
|
|
1818
1727
|
if (maxBytesToWrite < 4) return 0;
|
|
@@ -1831,7 +1740,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1831
1740
|
HEAP32[outPtr >> 2] = 0;
|
|
1832
1741
|
return outPtr - startPtr;
|
|
1833
1742
|
};
|
|
1834
|
-
var lengthBytesUTF32 =
|
|
1743
|
+
var lengthBytesUTF32 = str => {
|
|
1835
1744
|
var len = 0;
|
|
1836
1745
|
for (var i = 0; i < str.length; ++i) {
|
|
1837
1746
|
var codeUnit = str.charCodeAt(i);
|
|
@@ -1840,27 +1749,23 @@ var WebRendererWasmFactory = function () {
|
|
|
1840
1749
|
}
|
|
1841
1750
|
return len;
|
|
1842
1751
|
};
|
|
1843
|
-
var __embind_register_std_wstring =
|
|
1752
|
+
var __embind_register_std_wstring = (rawType, charSize, name) => {
|
|
1844
1753
|
name = readLatin1String(name);
|
|
1845
1754
|
var decodeString, encodeString, readCharAt, lengthBytesUTF;
|
|
1846
1755
|
if (charSize === 2) {
|
|
1847
1756
|
decodeString = UTF16ToString;
|
|
1848
1757
|
encodeString = stringToUTF16;
|
|
1849
1758
|
lengthBytesUTF = lengthBytesUTF16;
|
|
1850
|
-
readCharAt =
|
|
1851
|
-
return HEAPU16[pointer >> 1];
|
|
1852
|
-
};
|
|
1759
|
+
readCharAt = pointer => HEAPU16[pointer >> 1];
|
|
1853
1760
|
} else if (charSize === 4) {
|
|
1854
1761
|
decodeString = UTF32ToString;
|
|
1855
1762
|
encodeString = stringToUTF32;
|
|
1856
1763
|
lengthBytesUTF = lengthBytesUTF32;
|
|
1857
|
-
readCharAt =
|
|
1858
|
-
return HEAPU32[pointer >> 2];
|
|
1859
|
-
};
|
|
1764
|
+
readCharAt = pointer => HEAPU32[pointer >> 2];
|
|
1860
1765
|
}
|
|
1861
1766
|
registerType(rawType, {
|
|
1862
1767
|
name: name,
|
|
1863
|
-
"fromWireType":
|
|
1768
|
+
"fromWireType": value => {
|
|
1864
1769
|
var length = HEAPU32[value >> 2];
|
|
1865
1770
|
var str;
|
|
1866
1771
|
var decodeStartPtr = value + 4;
|
|
@@ -1881,7 +1786,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1881
1786
|
_free(value);
|
|
1882
1787
|
return str;
|
|
1883
1788
|
},
|
|
1884
|
-
"toWireType":
|
|
1789
|
+
"toWireType": (destructors, value) => {
|
|
1885
1790
|
if (!(typeof value == "string")) {
|
|
1886
1791
|
throwBindingError("Cannot pass non-string to C++ string type ".concat(name));
|
|
1887
1792
|
}
|
|
@@ -1896,12 +1801,12 @@ var WebRendererWasmFactory = function () {
|
|
|
1896
1801
|
},
|
|
1897
1802
|
"argPackAdvance": GenericWireTypeSize,
|
|
1898
1803
|
"readValueFromPointer": readPointer,
|
|
1899
|
-
destructorFunction
|
|
1804
|
+
destructorFunction(ptr) {
|
|
1900
1805
|
_free(ptr);
|
|
1901
1806
|
}
|
|
1902
1807
|
});
|
|
1903
1808
|
};
|
|
1904
|
-
var __embind_register_value_object =
|
|
1809
|
+
var __embind_register_value_object = (rawType, name, constructorSignature, rawConstructor, destructorSignature, rawDestructor) => {
|
|
1905
1810
|
structRegistrations[rawType] = {
|
|
1906
1811
|
name: readLatin1String(name),
|
|
1907
1812
|
rawConstructor: embind__requireFunction(constructorSignature, rawConstructor),
|
|
@@ -1909,7 +1814,7 @@ var WebRendererWasmFactory = function () {
|
|
|
1909
1814
|
fields: []
|
|
1910
1815
|
};
|
|
1911
1816
|
};
|
|
1912
|
-
var __embind_register_value_object_field =
|
|
1817
|
+
var __embind_register_value_object_field = (structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) => {
|
|
1913
1818
|
structRegistrations[structType].fields.push({
|
|
1914
1819
|
fieldName: readLatin1String(fieldName),
|
|
1915
1820
|
getterReturnType: getterReturnType,
|
|
@@ -1920,28 +1825,22 @@ var WebRendererWasmFactory = function () {
|
|
|
1920
1825
|
setterContext: setterContext
|
|
1921
1826
|
});
|
|
1922
1827
|
};
|
|
1923
|
-
var __embind_register_void =
|
|
1828
|
+
var __embind_register_void = (rawType, name) => {
|
|
1924
1829
|
name = readLatin1String(name);
|
|
1925
1830
|
registerType(rawType, {
|
|
1926
1831
|
isVoid: true,
|
|
1927
1832
|
name: name,
|
|
1928
1833
|
"argPackAdvance": 0,
|
|
1929
|
-
"fromWireType":
|
|
1930
|
-
|
|
1931
|
-
},
|
|
1932
|
-
"toWireType": function toWireType(destructors, o) {
|
|
1933
|
-
return undefined;
|
|
1934
|
-
}
|
|
1834
|
+
"fromWireType": () => undefined,
|
|
1835
|
+
"toWireType": (destructors, o) => undefined
|
|
1935
1836
|
});
|
|
1936
1837
|
};
|
|
1937
1838
|
var nowIsMonotonic = 1;
|
|
1938
|
-
var __emscripten_get_now_is_monotonic =
|
|
1939
|
-
|
|
1940
|
-
};
|
|
1941
|
-
var __emscripten_throw_longjmp = function __emscripten_throw_longjmp() {
|
|
1839
|
+
var __emscripten_get_now_is_monotonic = () => nowIsMonotonic;
|
|
1840
|
+
var __emscripten_throw_longjmp = () => {
|
|
1942
1841
|
throw Infinity;
|
|
1943
1842
|
};
|
|
1944
|
-
var emval_returnValue =
|
|
1843
|
+
var emval_returnValue = (returnType, destructorsRef, handle) => {
|
|
1945
1844
|
var destructors = [];
|
|
1946
1845
|
var result = returnType["toWireType"](destructors, handle);
|
|
1947
1846
|
if (destructors.length) {
|
|
@@ -1949,40 +1848,40 @@ var WebRendererWasmFactory = function () {
|
|
|
1949
1848
|
}
|
|
1950
1849
|
return result;
|
|
1951
1850
|
};
|
|
1952
|
-
var __emval_as =
|
|
1851
|
+
var __emval_as = (handle, returnType, destructorsRef) => {
|
|
1953
1852
|
handle = Emval.toValue(handle);
|
|
1954
1853
|
returnType = requireRegisteredType(returnType, "emval::as");
|
|
1955
1854
|
return emval_returnValue(returnType, destructorsRef, handle);
|
|
1956
1855
|
};
|
|
1957
1856
|
var emval_methodCallers = [];
|
|
1958
|
-
var __emval_call =
|
|
1857
|
+
var __emval_call = (caller, handle, destructorsRef, args) => {
|
|
1959
1858
|
caller = emval_methodCallers[caller];
|
|
1960
1859
|
handle = Emval.toValue(handle);
|
|
1961
1860
|
return caller(null, handle, destructorsRef, args);
|
|
1962
1861
|
};
|
|
1963
1862
|
var emval_symbols = {};
|
|
1964
|
-
var getStringOrSymbol =
|
|
1863
|
+
var getStringOrSymbol = address => {
|
|
1965
1864
|
var symbol = emval_symbols[address];
|
|
1966
1865
|
if (symbol === undefined) {
|
|
1967
1866
|
return readLatin1String(address);
|
|
1968
1867
|
}
|
|
1969
1868
|
return symbol;
|
|
1970
1869
|
};
|
|
1971
|
-
var __emval_call_method =
|
|
1870
|
+
var __emval_call_method = (caller, objHandle, methodName, destructorsRef, args) => {
|
|
1972
1871
|
caller = emval_methodCallers[caller];
|
|
1973
1872
|
objHandle = Emval.toValue(objHandle);
|
|
1974
1873
|
methodName = getStringOrSymbol(methodName);
|
|
1975
1874
|
return caller(objHandle, objHandle[methodName], destructorsRef, args);
|
|
1976
1875
|
};
|
|
1977
|
-
var emval_get_global =
|
|
1978
|
-
if (
|
|
1876
|
+
var emval_get_global = () => {
|
|
1877
|
+
if (typeof globalThis == "object") {
|
|
1979
1878
|
return globalThis;
|
|
1980
1879
|
}
|
|
1981
1880
|
return function () {
|
|
1982
1881
|
return Function;
|
|
1983
1882
|
}()("return this")();
|
|
1984
1883
|
};
|
|
1985
|
-
var __emval_get_global =
|
|
1884
|
+
var __emval_get_global = name => {
|
|
1986
1885
|
if (name === 0) {
|
|
1987
1886
|
return Emval.toHandle(emval_get_global());
|
|
1988
1887
|
} else {
|
|
@@ -1990,19 +1889,19 @@ var WebRendererWasmFactory = function () {
|
|
|
1990
1889
|
return Emval.toHandle(emval_get_global()[name]);
|
|
1991
1890
|
}
|
|
1992
1891
|
};
|
|
1993
|
-
var emval_addMethodCaller =
|
|
1892
|
+
var emval_addMethodCaller = caller => {
|
|
1994
1893
|
var id = emval_methodCallers.length;
|
|
1995
1894
|
emval_methodCallers.push(caller);
|
|
1996
1895
|
return id;
|
|
1997
1896
|
};
|
|
1998
|
-
var emval_lookupTypes =
|
|
1897
|
+
var emval_lookupTypes = (argCount, argTypes) => {
|
|
1999
1898
|
var a = new Array(argCount);
|
|
2000
1899
|
for (var i = 0; i < argCount; ++i) {
|
|
2001
1900
|
a[i] = requireRegisteredType(HEAPU32[argTypes + i * 4 >> 2], "parameter " + i);
|
|
2002
1901
|
}
|
|
2003
1902
|
return a;
|
|
2004
1903
|
};
|
|
2005
|
-
var __emval_get_method_caller =
|
|
1904
|
+
var __emval_get_method_caller = (argCount, argTypes, kind) => {
|
|
2006
1905
|
var types = emval_lookupTypes(argCount, argTypes);
|
|
2007
1906
|
var retType = types.shift();
|
|
2008
1907
|
argCount--;
|
|
@@ -2030,47 +1929,39 @@ var WebRendererWasmFactory = function () {
|
|
|
2030
1929
|
}
|
|
2031
1930
|
functionBody += "};\n";
|
|
2032
1931
|
params.push(functionBody);
|
|
2033
|
-
var invokerFunction = newFunc(Function, params)
|
|
2034
|
-
var functionName = "methodCaller<(".concat(types.map(
|
|
2035
|
-
return t.name;
|
|
2036
|
-
}).join(", "), ") => ").concat(retType.name, ">");
|
|
1932
|
+
var invokerFunction = newFunc(Function, params)(...args);
|
|
1933
|
+
var functionName = "methodCaller<(".concat(types.map(t => t.name).join(", "), ") => ").concat(retType.name, ">");
|
|
2037
1934
|
return emval_addMethodCaller(createNamedFunction(functionName, invokerFunction));
|
|
2038
1935
|
};
|
|
2039
|
-
var __emval_get_module_property =
|
|
1936
|
+
var __emval_get_module_property = name => {
|
|
2040
1937
|
name = getStringOrSymbol(name);
|
|
2041
1938
|
return Emval.toHandle(Module[name]);
|
|
2042
1939
|
};
|
|
2043
|
-
var __emval_get_property =
|
|
1940
|
+
var __emval_get_property = (handle, key) => {
|
|
2044
1941
|
handle = Emval.toValue(handle);
|
|
2045
1942
|
key = Emval.toValue(key);
|
|
2046
1943
|
return Emval.toHandle(handle[key]);
|
|
2047
1944
|
};
|
|
2048
|
-
var __emval_incref =
|
|
1945
|
+
var __emval_incref = handle => {
|
|
2049
1946
|
if (handle > 9) {
|
|
2050
1947
|
emval_handles[handle + 1] += 1;
|
|
2051
1948
|
}
|
|
2052
1949
|
};
|
|
2053
|
-
var __emval_new_array =
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
var __emval_new_cstring = function __emval_new_cstring(v) {
|
|
2057
|
-
return Emval.toHandle(getStringOrSymbol(v));
|
|
2058
|
-
};
|
|
2059
|
-
var __emval_run_destructors = function __emval_run_destructors(handle) {
|
|
1950
|
+
var __emval_new_array = () => Emval.toHandle([]);
|
|
1951
|
+
var __emval_new_cstring = v => Emval.toHandle(getStringOrSymbol(v));
|
|
1952
|
+
var __emval_run_destructors = handle => {
|
|
2060
1953
|
var destructors = Emval.toValue(handle);
|
|
2061
1954
|
runDestructors(destructors);
|
|
2062
1955
|
__emval_decref(handle);
|
|
2063
1956
|
};
|
|
2064
|
-
var __emval_take_value =
|
|
1957
|
+
var __emval_take_value = (type, arg) => {
|
|
2065
1958
|
type = requireRegisteredType(type, "_emval_take_value");
|
|
2066
1959
|
var v = type["readValueFromPointer"](arg);
|
|
2067
1960
|
return Emval.toHandle(v);
|
|
2068
1961
|
};
|
|
2069
1962
|
var MAX_INT53 = 9007199254740992;
|
|
2070
1963
|
var MIN_INT53 = -9007199254740992;
|
|
2071
|
-
var bigintToI53Checked =
|
|
2072
|
-
return num < MIN_INT53 || num > MAX_INT53 ? NaN : Number(num);
|
|
2073
|
-
};
|
|
1964
|
+
var bigintToI53Checked = num => num < MIN_INT53 || num > MAX_INT53 ? NaN : Number(num);
|
|
2074
1965
|
function __gmtime_js(time, tmPtr) {
|
|
2075
1966
|
time = bigintToI53Checked(time);
|
|
2076
1967
|
var date = new Date(time * 1e3);
|
|
@@ -2085,7 +1976,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2085
1976
|
var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0;
|
|
2086
1977
|
HEAP32[tmPtr + 28 >> 2] = yday;
|
|
2087
1978
|
}
|
|
2088
|
-
var __tzset_js =
|
|
1979
|
+
var __tzset_js = (timezone, daylight, std_name, dst_name) => {
|
|
2089
1980
|
var currentYear = new Date().getFullYear();
|
|
2090
1981
|
var winter = new Date(currentYear, 0, 1);
|
|
2091
1982
|
var summer = new Date(currentYear, 6, 1);
|
|
@@ -2094,12 +1985,10 @@ var WebRendererWasmFactory = function () {
|
|
|
2094
1985
|
var stdTimezoneOffset = Math.max(winterOffset, summerOffset);
|
|
2095
1986
|
HEAPU32[timezone >> 2] = stdTimezoneOffset * 60;
|
|
2096
1987
|
HEAP32[daylight >> 2] = Number(winterOffset != summerOffset);
|
|
2097
|
-
var extractZone =
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
}).split(" ")[1];
|
|
2102
|
-
};
|
|
1988
|
+
var extractZone = date => date.toLocaleTimeString(undefined, {
|
|
1989
|
+
hour12: false,
|
|
1990
|
+
timeZoneName: "short"
|
|
1991
|
+
}).split(" ")[1];
|
|
2103
1992
|
var winterName = extractZone(winter);
|
|
2104
1993
|
var summerName = extractZone(summer);
|
|
2105
1994
|
if (summerOffset < winterOffset) {
|
|
@@ -2110,25 +1999,13 @@ var WebRendererWasmFactory = function () {
|
|
|
2110
1999
|
stringToUTF8(summerName, std_name, 17);
|
|
2111
2000
|
}
|
|
2112
2001
|
};
|
|
2113
|
-
var _emscripten_cancel_animation_frame =
|
|
2114
|
-
|
|
2115
|
-
};
|
|
2116
|
-
var _emscripten_date_now = function _emscripten_date_now() {
|
|
2117
|
-
return Date.now();
|
|
2118
|
-
};
|
|
2002
|
+
var _emscripten_cancel_animation_frame = id => cancelAnimationFrame(id);
|
|
2003
|
+
var _emscripten_date_now = () => Date.now();
|
|
2119
2004
|
var _emscripten_get_now;
|
|
2120
|
-
_emscripten_get_now =
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
var
|
|
2124
|
-
return requestAnimationFrame(function (timeStamp) {
|
|
2125
|
-
return getWasmTableEntry(cb)(timeStamp, userData);
|
|
2126
|
-
});
|
|
2127
|
-
};
|
|
2128
|
-
var getHeapMax = function getHeapMax() {
|
|
2129
|
-
return 2147483648;
|
|
2130
|
-
};
|
|
2131
|
-
var growMemory = function growMemory(size) {
|
|
2005
|
+
_emscripten_get_now = () => performance.now();
|
|
2006
|
+
var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame(timeStamp => getWasmTableEntry(cb)(timeStamp, userData));
|
|
2007
|
+
var getHeapMax = () => 2147483648;
|
|
2008
|
+
var growMemory = size => {
|
|
2132
2009
|
var b = wasmMemory.buffer;
|
|
2133
2010
|
var pages = (size - b.byteLength + 65535) / 65536;
|
|
2134
2011
|
try {
|
|
@@ -2137,16 +2014,14 @@ var WebRendererWasmFactory = function () {
|
|
|
2137
2014
|
return 1;
|
|
2138
2015
|
} catch (e) {}
|
|
2139
2016
|
};
|
|
2140
|
-
var _emscripten_resize_heap =
|
|
2017
|
+
var _emscripten_resize_heap = requestedSize => {
|
|
2141
2018
|
var oldSize = HEAPU8.length;
|
|
2142
2019
|
requestedSize >>>= 0;
|
|
2143
2020
|
var maxHeapSize = getHeapMax();
|
|
2144
2021
|
if (requestedSize > maxHeapSize) {
|
|
2145
2022
|
return false;
|
|
2146
2023
|
}
|
|
2147
|
-
var alignUp =
|
|
2148
|
-
return x + (multiple - x % multiple) % multiple;
|
|
2149
|
-
};
|
|
2024
|
+
var alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple;
|
|
2150
2025
|
for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
|
|
2151
2026
|
var overGrownHeapSize = oldSize * (1 + .2 / cutDown);
|
|
2152
2027
|
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
|
|
@@ -2158,62 +2033,38 @@ var WebRendererWasmFactory = function () {
|
|
|
2158
2033
|
}
|
|
2159
2034
|
return false;
|
|
2160
2035
|
};
|
|
2161
|
-
var webgl_enable_ANGLE_instanced_arrays =
|
|
2036
|
+
var webgl_enable_ANGLE_instanced_arrays = ctx => {
|
|
2162
2037
|
var ext = ctx.getExtension("ANGLE_instanced_arrays");
|
|
2163
2038
|
if (ext) {
|
|
2164
|
-
ctx["vertexAttribDivisor"] =
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
ctx["drawArraysInstanced"] = function (mode, first, count, primcount) {
|
|
2168
|
-
return ext["drawArraysInstancedANGLE"](mode, first, count, primcount);
|
|
2169
|
-
};
|
|
2170
|
-
ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) {
|
|
2171
|
-
return ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount);
|
|
2172
|
-
};
|
|
2039
|
+
ctx["vertexAttribDivisor"] = (index, divisor) => ext["vertexAttribDivisorANGLE"](index, divisor);
|
|
2040
|
+
ctx["drawArraysInstanced"] = (mode, first, count, primcount) => ext["drawArraysInstancedANGLE"](mode, first, count, primcount);
|
|
2041
|
+
ctx["drawElementsInstanced"] = (mode, count, type, indices, primcount) => ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount);
|
|
2173
2042
|
return 1;
|
|
2174
2043
|
}
|
|
2175
2044
|
};
|
|
2176
|
-
var webgl_enable_OES_vertex_array_object =
|
|
2045
|
+
var webgl_enable_OES_vertex_array_object = ctx => {
|
|
2177
2046
|
var ext = ctx.getExtension("OES_vertex_array_object");
|
|
2178
2047
|
if (ext) {
|
|
2179
|
-
ctx["createVertexArray"] =
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
ctx["
|
|
2183
|
-
return ext["deleteVertexArrayOES"](vao);
|
|
2184
|
-
};
|
|
2185
|
-
ctx["bindVertexArray"] = function (vao) {
|
|
2186
|
-
return ext["bindVertexArrayOES"](vao);
|
|
2187
|
-
};
|
|
2188
|
-
ctx["isVertexArray"] = function (vao) {
|
|
2189
|
-
return ext["isVertexArrayOES"](vao);
|
|
2190
|
-
};
|
|
2048
|
+
ctx["createVertexArray"] = () => ext["createVertexArrayOES"]();
|
|
2049
|
+
ctx["deleteVertexArray"] = vao => ext["deleteVertexArrayOES"](vao);
|
|
2050
|
+
ctx["bindVertexArray"] = vao => ext["bindVertexArrayOES"](vao);
|
|
2051
|
+
ctx["isVertexArray"] = vao => ext["isVertexArrayOES"](vao);
|
|
2191
2052
|
return 1;
|
|
2192
2053
|
}
|
|
2193
2054
|
};
|
|
2194
|
-
var webgl_enable_WEBGL_draw_buffers =
|
|
2055
|
+
var webgl_enable_WEBGL_draw_buffers = ctx => {
|
|
2195
2056
|
var ext = ctx.getExtension("WEBGL_draw_buffers");
|
|
2196
2057
|
if (ext) {
|
|
2197
|
-
ctx["drawBuffers"] =
|
|
2198
|
-
return ext["drawBuffersWEBGL"](n, bufs);
|
|
2199
|
-
};
|
|
2058
|
+
ctx["drawBuffers"] = (n, bufs) => ext["drawBuffersWEBGL"](n, bufs);
|
|
2200
2059
|
return 1;
|
|
2201
2060
|
}
|
|
2202
2061
|
};
|
|
2203
|
-
var webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance =
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
var
|
|
2207
|
-
return !!(ctx.mdibvbi = ctx.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"));
|
|
2208
|
-
};
|
|
2209
|
-
var webgl_enable_WEBGL_multi_draw = function webgl_enable_WEBGL_multi_draw(ctx) {
|
|
2210
|
-
return !!(ctx.multiDrawWebgl = ctx.getExtension("WEBGL_multi_draw"));
|
|
2211
|
-
};
|
|
2212
|
-
var getEmscriptenSupportedExtensions = function getEmscriptenSupportedExtensions(ctx) {
|
|
2062
|
+
var webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance = ctx => !!(ctx.dibvbi = ctx.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"));
|
|
2063
|
+
var webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance = ctx => !!(ctx.mdibvbi = ctx.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"));
|
|
2064
|
+
var webgl_enable_WEBGL_multi_draw = ctx => !!(ctx.multiDrawWebgl = ctx.getExtension("WEBGL_multi_draw"));
|
|
2065
|
+
var getEmscriptenSupportedExtensions = ctx => {
|
|
2213
2066
|
var supportedExtensions = ["ANGLE_instanced_arrays", "EXT_blend_minmax", "EXT_disjoint_timer_query", "EXT_frag_depth", "EXT_shader_texture_lod", "EXT_sRGB", "OES_element_index_uint", "OES_fbo_render_mipmap", "OES_standard_derivatives", "OES_texture_float", "OES_texture_half_float", "OES_texture_half_float_linear", "OES_vertex_array_object", "WEBGL_color_buffer_float", "WEBGL_depth_texture", "WEBGL_draw_buffers", "EXT_color_buffer_float", "EXT_conservative_depth", "EXT_disjoint_timer_query_webgl2", "EXT_texture_norm16", "NV_shader_noperspective_interpolation", "WEBGL_clip_cull_distance", "EXT_color_buffer_half_float", "EXT_depth_clamp", "EXT_float_blend", "EXT_texture_compression_bptc", "EXT_texture_compression_rgtc", "EXT_texture_filter_anisotropic", "KHR_parallel_shader_compile", "OES_texture_float_linear", "WEBGL_blend_func_extended", "WEBGL_compressed_texture_astc", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_etc1", "WEBGL_compressed_texture_s3tc", "WEBGL_compressed_texture_s3tc_srgb", "WEBGL_debug_renderer_info", "WEBGL_debug_shaders", "WEBGL_lose_context", "WEBGL_multi_draw"];
|
|
2214
|
-
return (ctx.getSupportedExtensions() || []).filter(
|
|
2215
|
-
return supportedExtensions.includes(ext);
|
|
2216
|
-
});
|
|
2067
|
+
return (ctx.getSupportedExtensions() || []).filter(ext => supportedExtensions.includes(ext));
|
|
2217
2068
|
};
|
|
2218
2069
|
var GL = {
|
|
2219
2070
|
counter: 1,
|
|
@@ -2233,19 +2084,19 @@ var WebRendererWasmFactory = function () {
|
|
|
2233
2084
|
stringCache: {},
|
|
2234
2085
|
stringiCache: {},
|
|
2235
2086
|
unpackAlignment: 4,
|
|
2236
|
-
recordError:
|
|
2087
|
+
recordError: errorCode => {
|
|
2237
2088
|
if (!GL.lastError) {
|
|
2238
2089
|
GL.lastError = errorCode;
|
|
2239
2090
|
}
|
|
2240
2091
|
},
|
|
2241
|
-
getNewId:
|
|
2092
|
+
getNewId: table => {
|
|
2242
2093
|
var ret = GL.counter++;
|
|
2243
2094
|
for (var i = table.length; i < ret; i++) {
|
|
2244
2095
|
table[i] = null;
|
|
2245
2096
|
}
|
|
2246
2097
|
return ret;
|
|
2247
2098
|
},
|
|
2248
|
-
genObject:
|
|
2099
|
+
genObject: (n, buffers, createFunction, objectTable) => {
|
|
2249
2100
|
for (var i = 0; i < n; i++) {
|
|
2250
2101
|
var buffer = GLctx[createFunction]();
|
|
2251
2102
|
var id = buffer && GL.getNewId(objectTable);
|
|
@@ -2258,7 +2109,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2258
2109
|
HEAP32[buffers + i * 4 >> 2] = id;
|
|
2259
2110
|
}
|
|
2260
2111
|
},
|
|
2261
|
-
getSource:
|
|
2112
|
+
getSource: (shader, count, string, length) => {
|
|
2262
2113
|
var source = "";
|
|
2263
2114
|
for (var i = 0; i < count; ++i) {
|
|
2264
2115
|
var len = length ? HEAPU32[length + i * 4 >> 2] : undefined;
|
|
@@ -2266,13 +2117,13 @@ var WebRendererWasmFactory = function () {
|
|
|
2266
2117
|
}
|
|
2267
2118
|
return source;
|
|
2268
2119
|
},
|
|
2269
|
-
createContext:
|
|
2120
|
+
createContext: (canvas, webGLContextAttributes) => {
|
|
2270
2121
|
if (!canvas.getContextSafariWebGL2Fixed) {
|
|
2271
|
-
|
|
2122
|
+
canvas.getContextSafariWebGL2Fixed = canvas.getContext;
|
|
2123
|
+
function fixedGetContext(ver, attrs) {
|
|
2272
2124
|
var gl = canvas.getContextSafariWebGL2Fixed(ver, attrs);
|
|
2273
2125
|
return ver == "webgl" == gl instanceof WebGLRenderingContext ? gl : null;
|
|
2274
|
-
}
|
|
2275
|
-
canvas.getContextSafariWebGL2Fixed = canvas.getContext;
|
|
2126
|
+
}
|
|
2276
2127
|
canvas.getContext = fixedGetContext;
|
|
2277
2128
|
}
|
|
2278
2129
|
var ctx = webGLContextAttributes.majorVersion > 1 ? canvas.getContext("webgl2", webGLContextAttributes) : canvas.getContext("webgl", webGLContextAttributes);
|
|
@@ -2280,7 +2131,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2280
2131
|
var handle = GL.registerContext(ctx, webGLContextAttributes);
|
|
2281
2132
|
return handle;
|
|
2282
2133
|
},
|
|
2283
|
-
registerContext:
|
|
2134
|
+
registerContext: (ctx, webGLContextAttributes) => {
|
|
2284
2135
|
var handle = GL.getNewId(GL.contexts);
|
|
2285
2136
|
var context = {
|
|
2286
2137
|
handle: handle,
|
|
@@ -2295,20 +2146,18 @@ var WebRendererWasmFactory = function () {
|
|
|
2295
2146
|
}
|
|
2296
2147
|
return handle;
|
|
2297
2148
|
},
|
|
2298
|
-
makeContextCurrent:
|
|
2149
|
+
makeContextCurrent: contextHandle => {
|
|
2299
2150
|
var _GL$currentContext;
|
|
2300
2151
|
GL.currentContext = GL.contexts[contextHandle];
|
|
2301
2152
|
Module.ctx = GLctx = (_GL$currentContext = GL.currentContext) === null || _GL$currentContext === void 0 ? void 0 : _GL$currentContext.GLctx;
|
|
2302
2153
|
return !(contextHandle && !GLctx);
|
|
2303
2154
|
},
|
|
2304
|
-
getContext:
|
|
2305
|
-
|
|
2306
|
-
},
|
|
2307
|
-
deleteContext: function deleteContext(contextHandle) {
|
|
2155
|
+
getContext: contextHandle => GL.contexts[contextHandle],
|
|
2156
|
+
deleteContext: contextHandle => {
|
|
2308
2157
|
if (GL.currentContext === GL.contexts[contextHandle]) {
|
|
2309
2158
|
GL.currentContext = null;
|
|
2310
2159
|
}
|
|
2311
|
-
if (
|
|
2160
|
+
if (typeof JSEvents == "object") {
|
|
2312
2161
|
JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);
|
|
2313
2162
|
}
|
|
2314
2163
|
if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) {
|
|
@@ -2316,7 +2165,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2316
2165
|
}
|
|
2317
2166
|
GL.contexts[contextHandle] = null;
|
|
2318
2167
|
},
|
|
2319
|
-
initExtensions:
|
|
2168
|
+
initExtensions: context => {
|
|
2320
2169
|
context || (context = GL.currentContext);
|
|
2321
2170
|
if (context.initExtensionsDone) return;
|
|
2322
2171
|
context.initExtensionsDone = true;
|
|
@@ -2333,24 +2182,22 @@ var WebRendererWasmFactory = function () {
|
|
|
2333
2182
|
GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query");
|
|
2334
2183
|
}
|
|
2335
2184
|
webgl_enable_WEBGL_multi_draw(GLctx);
|
|
2336
|
-
getEmscriptenSupportedExtensions(GLctx).forEach(
|
|
2185
|
+
getEmscriptenSupportedExtensions(GLctx).forEach(ext => {
|
|
2337
2186
|
if (!ext.includes("lose_context") && !ext.includes("debug")) {
|
|
2338
2187
|
GLctx.getExtension(ext);
|
|
2339
2188
|
}
|
|
2340
2189
|
});
|
|
2341
2190
|
}
|
|
2342
2191
|
};
|
|
2343
|
-
var _emscripten_webgl_make_context_current =
|
|
2192
|
+
var _emscripten_webgl_make_context_current = contextHandle => {
|
|
2344
2193
|
var success = GL.makeContextCurrent(contextHandle);
|
|
2345
2194
|
return success ? 0 : -5;
|
|
2346
2195
|
};
|
|
2347
2196
|
var ENV = {};
|
|
2348
|
-
var getExecutableName =
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
if (!_getEnvStrings.strings) {
|
|
2353
|
-
var lang = ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
|
|
2197
|
+
var getExecutableName = () => thisProgram ;
|
|
2198
|
+
var getEnvStrings = () => {
|
|
2199
|
+
if (!getEnvStrings.strings) {
|
|
2200
|
+
var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
|
|
2354
2201
|
var env = {
|
|
2355
2202
|
"USER": "web_user",
|
|
2356
2203
|
"LOGNAME": "web_user",
|
|
@@ -2367,19 +2214,19 @@ var WebRendererWasmFactory = function () {
|
|
|
2367
2214
|
for (var x in env) {
|
|
2368
2215
|
strings.push("".concat(x, "=").concat(env[x]));
|
|
2369
2216
|
}
|
|
2370
|
-
|
|
2217
|
+
getEnvStrings.strings = strings;
|
|
2371
2218
|
}
|
|
2372
|
-
return
|
|
2219
|
+
return getEnvStrings.strings;
|
|
2373
2220
|
};
|
|
2374
|
-
var stringToAscii =
|
|
2221
|
+
var stringToAscii = (str, buffer) => {
|
|
2375
2222
|
for (var i = 0; i < str.length; ++i) {
|
|
2376
2223
|
HEAP8[buffer++] = str.charCodeAt(i);
|
|
2377
2224
|
}
|
|
2378
2225
|
HEAP8[buffer] = 0;
|
|
2379
2226
|
};
|
|
2380
|
-
var _environ_get =
|
|
2227
|
+
var _environ_get = (__environ, environ_buf) => {
|
|
2381
2228
|
var bufSize = 0;
|
|
2382
|
-
|
|
2229
|
+
getEnvStrings().forEach((string, i) => {
|
|
2383
2230
|
var ptr = environ_buf + bufSize;
|
|
2384
2231
|
HEAPU32[__environ + i * 4 >> 2] = ptr;
|
|
2385
2232
|
stringToAscii(string, ptr);
|
|
@@ -2387,38 +2234,32 @@ var WebRendererWasmFactory = function () {
|
|
|
2387
2234
|
});
|
|
2388
2235
|
return 0;
|
|
2389
2236
|
};
|
|
2390
|
-
var _environ_sizes_get =
|
|
2391
|
-
var strings =
|
|
2237
|
+
var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
|
|
2238
|
+
var strings = getEnvStrings();
|
|
2392
2239
|
HEAPU32[penviron_count >> 2] = strings.length;
|
|
2393
2240
|
var bufSize = 0;
|
|
2394
|
-
strings.forEach(
|
|
2395
|
-
return bufSize += string.length + 1;
|
|
2396
|
-
});
|
|
2241
|
+
strings.forEach(string => bufSize += string.length + 1);
|
|
2397
2242
|
HEAPU32[penviron_buf_size >> 2] = bufSize;
|
|
2398
2243
|
return 0;
|
|
2399
2244
|
};
|
|
2400
2245
|
var runtimeKeepaliveCounter = 0;
|
|
2401
|
-
var keepRuntimeAlive =
|
|
2402
|
-
|
|
2403
|
-
};
|
|
2404
|
-
var _proc_exit = function _proc_exit(code) {
|
|
2246
|
+
var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;
|
|
2247
|
+
var _proc_exit = code => {
|
|
2405
2248
|
if (!keepRuntimeAlive()) {
|
|
2406
2249
|
ABORT = true;
|
|
2407
2250
|
}
|
|
2408
2251
|
quit_(code, new ExitStatus(code));
|
|
2409
2252
|
};
|
|
2410
|
-
var exitJS =
|
|
2253
|
+
var exitJS = (status, implicit) => {
|
|
2411
2254
|
_proc_exit(status);
|
|
2412
2255
|
};
|
|
2413
2256
|
var _exit = exitJS;
|
|
2414
|
-
var _fd_close =
|
|
2415
|
-
return 52;
|
|
2416
|
-
};
|
|
2257
|
+
var _fd_close = fd => 52;
|
|
2417
2258
|
function _fd_seek(fd, offset, whence, newOffset) {
|
|
2418
2259
|
return 70;
|
|
2419
2260
|
}
|
|
2420
2261
|
var printCharBuffers = [null, [], []];
|
|
2421
|
-
var printChar =
|
|
2262
|
+
var printChar = (stream, curr) => {
|
|
2422
2263
|
var buffer = printCharBuffers[stream];
|
|
2423
2264
|
if (curr === 0 || curr === 10) {
|
|
2424
2265
|
(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
|
|
@@ -2427,7 +2268,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2427
2268
|
buffer.push(curr);
|
|
2428
2269
|
}
|
|
2429
2270
|
};
|
|
2430
|
-
var _fd_write =
|
|
2271
|
+
var _fd_write = (fd, iov, iovcnt, pnum) => {
|
|
2431
2272
|
var num = 0;
|
|
2432
2273
|
for (var i = 0; i < iovcnt; i++) {
|
|
2433
2274
|
var ptr = HEAPU32[iov >> 2];
|
|
@@ -2441,16 +2282,14 @@ var WebRendererWasmFactory = function () {
|
|
|
2441
2282
|
HEAPU32[pnum >> 2] = num;
|
|
2442
2283
|
return 0;
|
|
2443
2284
|
};
|
|
2444
|
-
var _glActiveTexture =
|
|
2445
|
-
|
|
2446
|
-
};
|
|
2447
|
-
var _glAttachShader = function _glAttachShader(program, shader) {
|
|
2285
|
+
var _glActiveTexture = x0 => GLctx.activeTexture(x0);
|
|
2286
|
+
var _glAttachShader = (program, shader) => {
|
|
2448
2287
|
GLctx.attachShader(GL.programs[program], GL.shaders[shader]);
|
|
2449
2288
|
};
|
|
2450
|
-
var _glBindAttribLocation =
|
|
2289
|
+
var _glBindAttribLocation = (program, index, name) => {
|
|
2451
2290
|
GLctx.bindAttribLocation(GL.programs[program], index, UTF8ToString(name));
|
|
2452
2291
|
};
|
|
2453
|
-
var _glBindBuffer =
|
|
2292
|
+
var _glBindBuffer = (target, buffer) => {
|
|
2454
2293
|
if (target == 35051) {
|
|
2455
2294
|
GLctx.currentPixelPackBufferBinding = buffer;
|
|
2456
2295
|
} else if (target == 35052) {
|
|
@@ -2458,35 +2297,27 @@ var WebRendererWasmFactory = function () {
|
|
|
2458
2297
|
}
|
|
2459
2298
|
GLctx.bindBuffer(target, GL.buffers[buffer]);
|
|
2460
2299
|
};
|
|
2461
|
-
var _glBindFramebuffer =
|
|
2300
|
+
var _glBindFramebuffer = (target, framebuffer) => {
|
|
2462
2301
|
GLctx.bindFramebuffer(target, GL.framebuffers[framebuffer]);
|
|
2463
2302
|
};
|
|
2464
|
-
var _glBindRenderbuffer =
|
|
2303
|
+
var _glBindRenderbuffer = (target, renderbuffer) => {
|
|
2465
2304
|
GLctx.bindRenderbuffer(target, GL.renderbuffers[renderbuffer]);
|
|
2466
2305
|
};
|
|
2467
|
-
var _glBindSampler =
|
|
2306
|
+
var _glBindSampler = (unit, sampler) => {
|
|
2468
2307
|
GLctx.bindSampler(unit, GL.samplers[sampler]);
|
|
2469
2308
|
};
|
|
2470
|
-
var _glBindTexture =
|
|
2309
|
+
var _glBindTexture = (target, texture) => {
|
|
2471
2310
|
GLctx.bindTexture(target, GL.textures[texture]);
|
|
2472
2311
|
};
|
|
2473
|
-
var _glBindVertexArray =
|
|
2312
|
+
var _glBindVertexArray = vao => {
|
|
2474
2313
|
GLctx.bindVertexArray(GL.vaos[vao]);
|
|
2475
2314
|
};
|
|
2476
2315
|
var _glBindVertexArrayOES = _glBindVertexArray;
|
|
2477
|
-
var _glBlendColor =
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
var
|
|
2481
|
-
|
|
2482
|
-
};
|
|
2483
|
-
var _glBlendFunc = function _glBlendFunc(x0, x1) {
|
|
2484
|
-
return GLctx.blendFunc(x0, x1);
|
|
2485
|
-
};
|
|
2486
|
-
var _glBlitFramebuffer = function _glBlitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) {
|
|
2487
|
-
return GLctx.blitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);
|
|
2488
|
-
};
|
|
2489
|
-
var _glBufferData = function _glBufferData(target, size, data, usage) {
|
|
2316
|
+
var _glBlendColor = (x0, x1, x2, x3) => GLctx.blendColor(x0, x1, x2, x3);
|
|
2317
|
+
var _glBlendEquation = x0 => GLctx.blendEquation(x0);
|
|
2318
|
+
var _glBlendFunc = (x0, x1) => GLctx.blendFunc(x0, x1);
|
|
2319
|
+
var _glBlitFramebuffer = (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) => GLctx.blitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);
|
|
2320
|
+
var _glBufferData = (target, size, data, usage) => {
|
|
2490
2321
|
if (GL.currentContext.version >= 2) {
|
|
2491
2322
|
if (data && size) {
|
|
2492
2323
|
GLctx.bufferData(target, HEAPU8, usage, data, size);
|
|
@@ -2497,36 +2328,28 @@ var WebRendererWasmFactory = function () {
|
|
|
2497
2328
|
}
|
|
2498
2329
|
GLctx.bufferData(target, data ? HEAPU8.subarray(data, data + size) : size, usage);
|
|
2499
2330
|
};
|
|
2500
|
-
var _glBufferSubData =
|
|
2331
|
+
var _glBufferSubData = (target, offset, size, data) => {
|
|
2501
2332
|
if (GL.currentContext.version >= 2) {
|
|
2502
2333
|
size && GLctx.bufferSubData(target, offset, HEAPU8, data, size);
|
|
2503
2334
|
return;
|
|
2504
2335
|
}
|
|
2505
2336
|
GLctx.bufferSubData(target, offset, HEAPU8.subarray(data, data + size));
|
|
2506
2337
|
};
|
|
2507
|
-
var _glCheckFramebufferStatus =
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
var
|
|
2511
|
-
|
|
2512
|
-
};
|
|
2513
|
-
var _glClearColor = function _glClearColor(x0, x1, x2, x3) {
|
|
2514
|
-
return GLctx.clearColor(x0, x1, x2, x3);
|
|
2515
|
-
};
|
|
2516
|
-
var _glClearStencil = function _glClearStencil(x0) {
|
|
2517
|
-
return GLctx.clearStencil(x0);
|
|
2518
|
-
};
|
|
2519
|
-
var _glClientWaitSync = function _glClientWaitSync(sync, flags, timeout) {
|
|
2338
|
+
var _glCheckFramebufferStatus = x0 => GLctx.checkFramebufferStatus(x0);
|
|
2339
|
+
var _glClear = x0 => GLctx.clear(x0);
|
|
2340
|
+
var _glClearColor = (x0, x1, x2, x3) => GLctx.clearColor(x0, x1, x2, x3);
|
|
2341
|
+
var _glClearStencil = x0 => GLctx.clearStencil(x0);
|
|
2342
|
+
var _glClientWaitSync = (sync, flags, timeout) => {
|
|
2520
2343
|
timeout = Number(timeout);
|
|
2521
2344
|
return GLctx.clientWaitSync(GL.syncs[sync], flags, timeout);
|
|
2522
2345
|
};
|
|
2523
|
-
var _glColorMask =
|
|
2346
|
+
var _glColorMask = (red, green, blue, alpha) => {
|
|
2524
2347
|
GLctx.colorMask(!!red, !!green, !!blue, !!alpha);
|
|
2525
2348
|
};
|
|
2526
|
-
var _glCompileShader =
|
|
2349
|
+
var _glCompileShader = shader => {
|
|
2527
2350
|
GLctx.compileShader(GL.shaders[shader]);
|
|
2528
2351
|
};
|
|
2529
|
-
var _glCompressedTexImage2D =
|
|
2352
|
+
var _glCompressedTexImage2D = (target, level, internalFormat, width, height, border, imageSize, data) => {
|
|
2530
2353
|
if (GL.currentContext.version >= 2) {
|
|
2531
2354
|
if (GLctx.currentPixelUnpackBufferBinding || !imageSize) {
|
|
2532
2355
|
GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data);
|
|
@@ -2537,7 +2360,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2537
2360
|
}
|
|
2538
2361
|
GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, data ? HEAPU8.subarray(data, data + imageSize) : null);
|
|
2539
2362
|
};
|
|
2540
|
-
var _glCompressedTexSubImage2D =
|
|
2363
|
+
var _glCompressedTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, imageSize, data) => {
|
|
2541
2364
|
if (GL.currentContext.version >= 2) {
|
|
2542
2365
|
if (GLctx.currentPixelUnpackBufferBinding || !imageSize) {
|
|
2543
2366
|
GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
|
|
@@ -2548,13 +2371,9 @@ var WebRendererWasmFactory = function () {
|
|
|
2548
2371
|
}
|
|
2549
2372
|
GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray(data, data + imageSize) : null);
|
|
2550
2373
|
};
|
|
2551
|
-
var _glCopyBufferSubData =
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
var _glCopyTexSubImage2D = function _glCopyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7) {
|
|
2555
|
-
return GLctx.copyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7);
|
|
2556
|
-
};
|
|
2557
|
-
var _glCreateProgram = function _glCreateProgram() {
|
|
2374
|
+
var _glCopyBufferSubData = (x0, x1, x2, x3, x4) => GLctx.copyBufferSubData(x0, x1, x2, x3, x4);
|
|
2375
|
+
var _glCopyTexSubImage2D = (x0, x1, x2, x3, x4, x5, x6, x7) => GLctx.copyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7);
|
|
2376
|
+
var _glCreateProgram = () => {
|
|
2558
2377
|
var id = GL.getNewId(GL.programs);
|
|
2559
2378
|
var program = GLctx.createProgram();
|
|
2560
2379
|
program.name = id;
|
|
@@ -2563,15 +2382,13 @@ var WebRendererWasmFactory = function () {
|
|
|
2563
2382
|
GL.programs[id] = program;
|
|
2564
2383
|
return id;
|
|
2565
2384
|
};
|
|
2566
|
-
var _glCreateShader =
|
|
2385
|
+
var _glCreateShader = shaderType => {
|
|
2567
2386
|
var id = GL.getNewId(GL.shaders);
|
|
2568
2387
|
GL.shaders[id] = GLctx.createShader(shaderType);
|
|
2569
2388
|
return id;
|
|
2570
2389
|
};
|
|
2571
|
-
var _glCullFace =
|
|
2572
|
-
|
|
2573
|
-
};
|
|
2574
|
-
var _glDeleteBuffers = function _glDeleteBuffers(n, buffers) {
|
|
2390
|
+
var _glCullFace = x0 => GLctx.cullFace(x0);
|
|
2391
|
+
var _glDeleteBuffers = (n, buffers) => {
|
|
2575
2392
|
for (var i = 0; i < n; i++) {
|
|
2576
2393
|
var id = HEAP32[buffers + i * 4 >> 2];
|
|
2577
2394
|
var buffer = GL.buffers[id];
|
|
@@ -2583,7 +2400,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2583
2400
|
if (id == GLctx.currentPixelUnpackBufferBinding) GLctx.currentPixelUnpackBufferBinding = 0;
|
|
2584
2401
|
}
|
|
2585
2402
|
};
|
|
2586
|
-
var _glDeleteFramebuffers =
|
|
2403
|
+
var _glDeleteFramebuffers = (n, framebuffers) => {
|
|
2587
2404
|
for (var i = 0; i < n; ++i) {
|
|
2588
2405
|
var id = HEAP32[framebuffers + i * 4 >> 2];
|
|
2589
2406
|
var framebuffer = GL.framebuffers[id];
|
|
@@ -2593,7 +2410,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2593
2410
|
GL.framebuffers[id] = null;
|
|
2594
2411
|
}
|
|
2595
2412
|
};
|
|
2596
|
-
var _glDeleteProgram =
|
|
2413
|
+
var _glDeleteProgram = id => {
|
|
2597
2414
|
if (!id) return;
|
|
2598
2415
|
var program = GL.programs[id];
|
|
2599
2416
|
if (!program) {
|
|
@@ -2604,7 +2421,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2604
2421
|
program.name = 0;
|
|
2605
2422
|
GL.programs[id] = null;
|
|
2606
2423
|
};
|
|
2607
|
-
var _glDeleteRenderbuffers =
|
|
2424
|
+
var _glDeleteRenderbuffers = (n, renderbuffers) => {
|
|
2608
2425
|
for (var i = 0; i < n; i++) {
|
|
2609
2426
|
var id = HEAP32[renderbuffers + i * 4 >> 2];
|
|
2610
2427
|
var renderbuffer = GL.renderbuffers[id];
|
|
@@ -2614,7 +2431,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2614
2431
|
GL.renderbuffers[id] = null;
|
|
2615
2432
|
}
|
|
2616
2433
|
};
|
|
2617
|
-
var _glDeleteSamplers =
|
|
2434
|
+
var _glDeleteSamplers = (n, samplers) => {
|
|
2618
2435
|
for (var i = 0; i < n; i++) {
|
|
2619
2436
|
var id = HEAP32[samplers + i * 4 >> 2];
|
|
2620
2437
|
var sampler = GL.samplers[id];
|
|
@@ -2624,7 +2441,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2624
2441
|
GL.samplers[id] = null;
|
|
2625
2442
|
}
|
|
2626
2443
|
};
|
|
2627
|
-
var _glDeleteShader =
|
|
2444
|
+
var _glDeleteShader = id => {
|
|
2628
2445
|
if (!id) return;
|
|
2629
2446
|
var shader = GL.shaders[id];
|
|
2630
2447
|
if (!shader) {
|
|
@@ -2634,7 +2451,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2634
2451
|
GLctx.deleteShader(shader);
|
|
2635
2452
|
GL.shaders[id] = null;
|
|
2636
2453
|
};
|
|
2637
|
-
var _glDeleteSync =
|
|
2454
|
+
var _glDeleteSync = id => {
|
|
2638
2455
|
if (!id) return;
|
|
2639
2456
|
var sync = GL.syncs[id];
|
|
2640
2457
|
if (!sync) {
|
|
@@ -2645,7 +2462,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2645
2462
|
sync.name = 0;
|
|
2646
2463
|
GL.syncs[id] = null;
|
|
2647
2464
|
};
|
|
2648
|
-
var _glDeleteTextures =
|
|
2465
|
+
var _glDeleteTextures = (n, textures) => {
|
|
2649
2466
|
for (var i = 0; i < n; i++) {
|
|
2650
2467
|
var id = HEAP32[textures + i * 4 >> 2];
|
|
2651
2468
|
var texture = GL.textures[id];
|
|
@@ -2655,7 +2472,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2655
2472
|
GL.textures[id] = null;
|
|
2656
2473
|
}
|
|
2657
2474
|
};
|
|
2658
|
-
var _glDeleteVertexArrays =
|
|
2475
|
+
var _glDeleteVertexArrays = (n, vaos) => {
|
|
2659
2476
|
for (var i = 0; i < n; i++) {
|
|
2660
2477
|
var id = HEAP32[vaos + i * 4 >> 2];
|
|
2661
2478
|
GLctx.deleteVertexArray(GL.vaos[id]);
|
|
@@ -2663,51 +2480,47 @@ var WebRendererWasmFactory = function () {
|
|
|
2663
2480
|
}
|
|
2664
2481
|
};
|
|
2665
2482
|
var _glDeleteVertexArraysOES = _glDeleteVertexArrays;
|
|
2666
|
-
var _glDepthMask =
|
|
2483
|
+
var _glDepthMask = flag => {
|
|
2667
2484
|
GLctx.depthMask(!!flag);
|
|
2668
2485
|
};
|
|
2669
|
-
var _glDisable =
|
|
2670
|
-
|
|
2671
|
-
};
|
|
2672
|
-
var _glDisableVertexAttribArray = function _glDisableVertexAttribArray(index) {
|
|
2486
|
+
var _glDisable = x0 => GLctx.disable(x0);
|
|
2487
|
+
var _glDisableVertexAttribArray = index => {
|
|
2673
2488
|
GLctx.disableVertexAttribArray(index);
|
|
2674
2489
|
};
|
|
2675
|
-
var _glDrawArrays =
|
|
2490
|
+
var _glDrawArrays = (mode, first, count) => {
|
|
2676
2491
|
GLctx.drawArrays(mode, first, count);
|
|
2677
2492
|
};
|
|
2678
|
-
var _glDrawArraysInstanced =
|
|
2493
|
+
var _glDrawArraysInstanced = (mode, first, count, primcount) => {
|
|
2679
2494
|
GLctx.drawArraysInstanced(mode, first, count, primcount);
|
|
2680
2495
|
};
|
|
2681
|
-
var _glDrawArraysInstancedBaseInstanceWEBGL =
|
|
2496
|
+
var _glDrawArraysInstancedBaseInstanceWEBGL = (mode, first, count, instanceCount, baseInstance) => {
|
|
2682
2497
|
GLctx.dibvbi["drawArraysInstancedBaseInstanceWEBGL"](mode, first, count, instanceCount, baseInstance);
|
|
2683
2498
|
};
|
|
2684
2499
|
var tempFixedLengthArray = [];
|
|
2685
|
-
var _glDrawBuffers =
|
|
2500
|
+
var _glDrawBuffers = (n, bufs) => {
|
|
2686
2501
|
var bufArray = tempFixedLengthArray[n];
|
|
2687
2502
|
for (var i = 0; i < n; i++) {
|
|
2688
2503
|
bufArray[i] = HEAP32[bufs + i * 4 >> 2];
|
|
2689
2504
|
}
|
|
2690
2505
|
GLctx.drawBuffers(bufArray);
|
|
2691
2506
|
};
|
|
2692
|
-
var _glDrawElements =
|
|
2507
|
+
var _glDrawElements = (mode, count, type, indices) => {
|
|
2693
2508
|
GLctx.drawElements(mode, count, type, indices);
|
|
2694
2509
|
};
|
|
2695
|
-
var _glDrawElementsInstanced =
|
|
2510
|
+
var _glDrawElementsInstanced = (mode, count, type, indices, primcount) => {
|
|
2696
2511
|
GLctx.drawElementsInstanced(mode, count, type, indices, primcount);
|
|
2697
2512
|
};
|
|
2698
|
-
var _glDrawElementsInstancedBaseVertexBaseInstanceWEBGL =
|
|
2513
|
+
var _glDrawElementsInstancedBaseVertexBaseInstanceWEBGL = (mode, count, type, offset, instanceCount, baseVertex, baseinstance) => {
|
|
2699
2514
|
GLctx.dibvbi["drawElementsInstancedBaseVertexBaseInstanceWEBGL"](mode, count, type, offset, instanceCount, baseVertex, baseinstance);
|
|
2700
2515
|
};
|
|
2701
|
-
var _glDrawRangeElements =
|
|
2516
|
+
var _glDrawRangeElements = (mode, start, end, count, type, indices) => {
|
|
2702
2517
|
_glDrawElements(mode, count, type, indices);
|
|
2703
2518
|
};
|
|
2704
|
-
var _glEnable =
|
|
2705
|
-
|
|
2706
|
-
};
|
|
2707
|
-
var _glEnableVertexAttribArray = function _glEnableVertexAttribArray(index) {
|
|
2519
|
+
var _glEnable = x0 => GLctx.enable(x0);
|
|
2520
|
+
var _glEnableVertexAttribArray = index => {
|
|
2708
2521
|
GLctx.enableVertexAttribArray(index);
|
|
2709
2522
|
};
|
|
2710
|
-
var _glFenceSync =
|
|
2523
|
+
var _glFenceSync = (condition, flags) => {
|
|
2711
2524
|
var sync = GLctx.fenceSync(condition, flags);
|
|
2712
2525
|
if (sync) {
|
|
2713
2526
|
var id = GL.getNewId(GL.syncs);
|
|
@@ -2717,68 +2530,58 @@ var WebRendererWasmFactory = function () {
|
|
|
2717
2530
|
}
|
|
2718
2531
|
return 0;
|
|
2719
2532
|
};
|
|
2720
|
-
var _glFinish =
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
var _glFlush = function _glFlush() {
|
|
2724
|
-
return GLctx.flush();
|
|
2725
|
-
};
|
|
2726
|
-
var _glFramebufferRenderbuffer = function _glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) {
|
|
2533
|
+
var _glFinish = () => GLctx.finish();
|
|
2534
|
+
var _glFlush = () => GLctx.flush();
|
|
2535
|
+
var _glFramebufferRenderbuffer = (target, attachment, renderbuffertarget, renderbuffer) => {
|
|
2727
2536
|
GLctx.framebufferRenderbuffer(target, attachment, renderbuffertarget, GL.renderbuffers[renderbuffer]);
|
|
2728
2537
|
};
|
|
2729
|
-
var _glFramebufferTexture2D =
|
|
2538
|
+
var _glFramebufferTexture2D = (target, attachment, textarget, texture, level) => {
|
|
2730
2539
|
GLctx.framebufferTexture2D(target, attachment, textarget, GL.textures[texture], level);
|
|
2731
2540
|
};
|
|
2732
|
-
var _glFrontFace =
|
|
2733
|
-
|
|
2734
|
-
};
|
|
2735
|
-
var _glGenBuffers = function _glGenBuffers(n, buffers) {
|
|
2541
|
+
var _glFrontFace = x0 => GLctx.frontFace(x0);
|
|
2542
|
+
var _glGenBuffers = (n, buffers) => {
|
|
2736
2543
|
GL.genObject(n, buffers, "createBuffer", GL.buffers);
|
|
2737
2544
|
};
|
|
2738
|
-
var _glGenFramebuffers =
|
|
2545
|
+
var _glGenFramebuffers = (n, ids) => {
|
|
2739
2546
|
GL.genObject(n, ids, "createFramebuffer", GL.framebuffers);
|
|
2740
2547
|
};
|
|
2741
|
-
var _glGenRenderbuffers =
|
|
2548
|
+
var _glGenRenderbuffers = (n, renderbuffers) => {
|
|
2742
2549
|
GL.genObject(n, renderbuffers, "createRenderbuffer", GL.renderbuffers);
|
|
2743
2550
|
};
|
|
2744
|
-
var _glGenSamplers =
|
|
2551
|
+
var _glGenSamplers = (n, samplers) => {
|
|
2745
2552
|
GL.genObject(n, samplers, "createSampler", GL.samplers);
|
|
2746
2553
|
};
|
|
2747
|
-
var _glGenTextures =
|
|
2554
|
+
var _glGenTextures = (n, textures) => {
|
|
2748
2555
|
GL.genObject(n, textures, "createTexture", GL.textures);
|
|
2749
2556
|
};
|
|
2750
|
-
var _glGenVertexArrays =
|
|
2557
|
+
var _glGenVertexArrays = (n, arrays) => {
|
|
2751
2558
|
GL.genObject(n, arrays, "createVertexArray", GL.vaos);
|
|
2752
2559
|
};
|
|
2753
2560
|
var _glGenVertexArraysOES = _glGenVertexArrays;
|
|
2754
|
-
var _glGenerateMipmap =
|
|
2755
|
-
|
|
2756
|
-
};
|
|
2757
|
-
var _glGetBufferParameteriv = function _glGetBufferParameteriv(target, value, data) {
|
|
2561
|
+
var _glGenerateMipmap = x0 => GLctx.generateMipmap(x0);
|
|
2562
|
+
var _glGetBufferParameteriv = (target, value, data) => {
|
|
2758
2563
|
if (!data) {
|
|
2759
2564
|
GL.recordError(1281);
|
|
2760
2565
|
return;
|
|
2761
2566
|
}
|
|
2762
2567
|
HEAP32[data >> 2] = GLctx.getBufferParameter(target, value);
|
|
2763
2568
|
};
|
|
2764
|
-
var _glGetError =
|
|
2569
|
+
var _glGetError = () => {
|
|
2765
2570
|
var error = GLctx.getError() || GL.lastError;
|
|
2766
2571
|
GL.lastError = 0;
|
|
2767
2572
|
return error;
|
|
2768
2573
|
};
|
|
2769
|
-
var writeI53ToI64 =
|
|
2574
|
+
var writeI53ToI64 = (ptr, num) => {
|
|
2770
2575
|
HEAPU32[ptr >> 2] = num;
|
|
2771
2576
|
var lower = HEAPU32[ptr >> 2];
|
|
2772
2577
|
HEAPU32[ptr + 4 >> 2] = (num - lower) / 4294967296;
|
|
2773
2578
|
};
|
|
2774
2579
|
var webglGetExtensions = function $webglGetExtensions() {
|
|
2775
2580
|
var exts = getEmscriptenSupportedExtensions(GLctx);
|
|
2776
|
-
exts = exts.concat(exts.map(
|
|
2777
|
-
return "GL_" + e;
|
|
2778
|
-
}));
|
|
2581
|
+
exts = exts.concat(exts.map(e => "GL_" + e));
|
|
2779
2582
|
return exts;
|
|
2780
2583
|
};
|
|
2781
|
-
var emscriptenWebGLGet =
|
|
2584
|
+
var emscriptenWebGLGet = (name_, p, type) => {
|
|
2782
2585
|
if (!p) {
|
|
2783
2586
|
GL.recordError(1281);
|
|
2784
2587
|
return;
|
|
@@ -2819,7 +2622,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2819
2622
|
}
|
|
2820
2623
|
if (ret === undefined) {
|
|
2821
2624
|
var result = GLctx.getParameter(name_);
|
|
2822
|
-
switch (
|
|
2625
|
+
switch (typeof result) {
|
|
2823
2626
|
case "number":
|
|
2824
2627
|
ret = result;
|
|
2825
2628
|
break;
|
|
@@ -2888,7 +2691,7 @@ var WebRendererWasmFactory = function () {
|
|
|
2888
2691
|
break;
|
|
2889
2692
|
default:
|
|
2890
2693
|
GL.recordError(1280);
|
|
2891
|
-
err("GL_INVALID_ENUM in glGet".concat(type, "v: Native code calling glGet").concat(type, "v(").concat(name_, ") and it returns ").concat(result, " of type ").concat(
|
|
2694
|
+
err("GL_INVALID_ENUM in glGet".concat(type, "v: Native code calling glGet").concat(type, "v(").concat(name_, ") and it returns ").concat(result, " of type ").concat(typeof result, "!"));
|
|
2892
2695
|
return;
|
|
2893
2696
|
}
|
|
2894
2697
|
}
|
|
@@ -2907,26 +2710,22 @@ var WebRendererWasmFactory = function () {
|
|
|
2907
2710
|
break;
|
|
2908
2711
|
}
|
|
2909
2712
|
};
|
|
2910
|
-
var _glGetFloatv =
|
|
2911
|
-
|
|
2912
|
-
};
|
|
2913
|
-
var _glGetFramebufferAttachmentParameteriv = function _glGetFramebufferAttachmentParameteriv(target, attachment, pname, params) {
|
|
2713
|
+
var _glGetFloatv = (name_, p) => emscriptenWebGLGet(name_, p, 2);
|
|
2714
|
+
var _glGetFramebufferAttachmentParameteriv = (target, attachment, pname, params) => {
|
|
2914
2715
|
var result = GLctx.getFramebufferAttachmentParameter(target, attachment, pname);
|
|
2915
2716
|
if (result instanceof WebGLRenderbuffer || result instanceof WebGLTexture) {
|
|
2916
2717
|
result = result.name | 0;
|
|
2917
2718
|
}
|
|
2918
2719
|
HEAP32[params >> 2] = result;
|
|
2919
2720
|
};
|
|
2920
|
-
var _glGetIntegerv =
|
|
2921
|
-
|
|
2922
|
-
};
|
|
2923
|
-
var _glGetProgramInfoLog = function _glGetProgramInfoLog(program, maxLength, length, infoLog) {
|
|
2721
|
+
var _glGetIntegerv = (name_, p) => emscriptenWebGLGet(name_, p, 0);
|
|
2722
|
+
var _glGetProgramInfoLog = (program, maxLength, length, infoLog) => {
|
|
2924
2723
|
var log = GLctx.getProgramInfoLog(GL.programs[program]);
|
|
2925
2724
|
if (log === null) log = "(unknown error)";
|
|
2926
2725
|
var numBytesWrittenExclNull = maxLength > 0 && infoLog ? stringToUTF8(log, infoLog, maxLength) : 0;
|
|
2927
2726
|
if (length) HEAP32[length >> 2] = numBytesWrittenExclNull;
|
|
2928
2727
|
};
|
|
2929
|
-
var _glGetProgramiv =
|
|
2728
|
+
var _glGetProgramiv = (program, pname, p) => {
|
|
2930
2729
|
if (!p) {
|
|
2931
2730
|
GL.recordError(1281);
|
|
2932
2731
|
return;
|
|
@@ -2965,26 +2764,26 @@ var WebRendererWasmFactory = function () {
|
|
|
2965
2764
|
HEAP32[p >> 2] = GLctx.getProgramParameter(program, pname);
|
|
2966
2765
|
}
|
|
2967
2766
|
};
|
|
2968
|
-
var _glGetRenderbufferParameteriv =
|
|
2767
|
+
var _glGetRenderbufferParameteriv = (target, pname, params) => {
|
|
2969
2768
|
if (!params) {
|
|
2970
2769
|
GL.recordError(1281);
|
|
2971
2770
|
return;
|
|
2972
2771
|
}
|
|
2973
2772
|
HEAP32[params >> 2] = GLctx.getRenderbufferParameter(target, pname);
|
|
2974
2773
|
};
|
|
2975
|
-
var _glGetShaderInfoLog =
|
|
2774
|
+
var _glGetShaderInfoLog = (shader, maxLength, length, infoLog) => {
|
|
2976
2775
|
var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
|
|
2977
2776
|
if (log === null) log = "(unknown error)";
|
|
2978
2777
|
var numBytesWrittenExclNull = maxLength > 0 && infoLog ? stringToUTF8(log, infoLog, maxLength) : 0;
|
|
2979
2778
|
if (length) HEAP32[length >> 2] = numBytesWrittenExclNull;
|
|
2980
2779
|
};
|
|
2981
|
-
var _glGetShaderPrecisionFormat =
|
|
2780
|
+
var _glGetShaderPrecisionFormat = (shaderType, precisionType, range, precision) => {
|
|
2982
2781
|
var result = GLctx.getShaderPrecisionFormat(shaderType, precisionType);
|
|
2983
2782
|
HEAP32[range >> 2] = result.rangeMin;
|
|
2984
2783
|
HEAP32[range + 4 >> 2] = result.rangeMax;
|
|
2985
2784
|
HEAP32[precision >> 2] = result.precision;
|
|
2986
2785
|
};
|
|
2987
|
-
var _glGetShaderiv =
|
|
2786
|
+
var _glGetShaderiv = (shader, pname, p) => {
|
|
2988
2787
|
if (!p) {
|
|
2989
2788
|
GL.recordError(1281);
|
|
2990
2789
|
return;
|
|
@@ -3002,13 +2801,13 @@ var WebRendererWasmFactory = function () {
|
|
|
3002
2801
|
HEAP32[p >> 2] = GLctx.getShaderParameter(GL.shaders[shader], pname);
|
|
3003
2802
|
}
|
|
3004
2803
|
};
|
|
3005
|
-
var stringToNewUTF8 =
|
|
2804
|
+
var stringToNewUTF8 = str => {
|
|
3006
2805
|
var size = lengthBytesUTF8(str) + 1;
|
|
3007
2806
|
var ret = _malloc(size);
|
|
3008
2807
|
if (ret) stringToUTF8(str, ret, size);
|
|
3009
2808
|
return ret;
|
|
3010
2809
|
};
|
|
3011
|
-
var _glGetString =
|
|
2810
|
+
var _glGetString = name_ => {
|
|
3012
2811
|
var ret = GL.stringCache[name_];
|
|
3013
2812
|
if (!ret) {
|
|
3014
2813
|
switch (name_) {
|
|
@@ -3049,7 +2848,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3049
2848
|
}
|
|
3050
2849
|
return ret;
|
|
3051
2850
|
};
|
|
3052
|
-
var _glGetStringi =
|
|
2851
|
+
var _glGetStringi = (name, index) => {
|
|
3053
2852
|
if (GL.currentContext.version < 2) {
|
|
3054
2853
|
GL.recordError(1282);
|
|
3055
2854
|
return 0;
|
|
@@ -3076,13 +2875,9 @@ var WebRendererWasmFactory = function () {
|
|
|
3076
2875
|
return 0;
|
|
3077
2876
|
}
|
|
3078
2877
|
};
|
|
3079
|
-
var jstoi_q =
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
var webglGetLeftBracePos = function webglGetLeftBracePos(name) {
|
|
3083
|
-
return name.slice(-1) == "]" && name.lastIndexOf("[");
|
|
3084
|
-
};
|
|
3085
|
-
var webglPrepareUniformLocationsBeforeFirstUse = function webglPrepareUniformLocationsBeforeFirstUse(program) {
|
|
2878
|
+
var jstoi_q = str => parseInt(str);
|
|
2879
|
+
var webglGetLeftBracePos = name => name.slice(-1) == "]" && name.lastIndexOf("[");
|
|
2880
|
+
var webglPrepareUniformLocationsBeforeFirstUse = program => {
|
|
3086
2881
|
var uniformLocsById = program.uniformLocsById,
|
|
3087
2882
|
uniformSizeAndIdsByName = program.uniformSizeAndIdsByName,
|
|
3088
2883
|
i,
|
|
@@ -3106,7 +2901,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3106
2901
|
}
|
|
3107
2902
|
}
|
|
3108
2903
|
};
|
|
3109
|
-
var _glGetUniformLocation =
|
|
2904
|
+
var _glGetUniformLocation = (program, name) => {
|
|
3110
2905
|
name = UTF8ToString(name);
|
|
3111
2906
|
if (program = GL.programs[program]) {
|
|
3112
2907
|
webglPrepareUniformLocationsBeforeFirstUse(program);
|
|
@@ -3130,53 +2925,47 @@ var WebRendererWasmFactory = function () {
|
|
|
3130
2925
|
}
|
|
3131
2926
|
return -1;
|
|
3132
2927
|
};
|
|
3133
|
-
var _glInvalidateFramebuffer =
|
|
2928
|
+
var _glInvalidateFramebuffer = (target, numAttachments, attachments) => {
|
|
3134
2929
|
var list = tempFixedLengthArray[numAttachments];
|
|
3135
2930
|
for (var i = 0; i < numAttachments; i++) {
|
|
3136
2931
|
list[i] = HEAP32[attachments + i * 4 >> 2];
|
|
3137
2932
|
}
|
|
3138
2933
|
GLctx.invalidateFramebuffer(target, list);
|
|
3139
2934
|
};
|
|
3140
|
-
var _glInvalidateSubFramebuffer =
|
|
2935
|
+
var _glInvalidateSubFramebuffer = (target, numAttachments, attachments, x, y, width, height) => {
|
|
3141
2936
|
var list = tempFixedLengthArray[numAttachments];
|
|
3142
2937
|
for (var i = 0; i < numAttachments; i++) {
|
|
3143
2938
|
list[i] = HEAP32[attachments + i * 4 >> 2];
|
|
3144
2939
|
}
|
|
3145
2940
|
GLctx.invalidateSubFramebuffer(target, list, x, y, width, height);
|
|
3146
2941
|
};
|
|
3147
|
-
var _glIsSync =
|
|
3148
|
-
|
|
3149
|
-
};
|
|
3150
|
-
var _glIsTexture = function _glIsTexture(id) {
|
|
2942
|
+
var _glIsSync = sync => GLctx.isSync(GL.syncs[sync]);
|
|
2943
|
+
var _glIsTexture = id => {
|
|
3151
2944
|
var texture = GL.textures[id];
|
|
3152
2945
|
if (!texture) return 0;
|
|
3153
2946
|
return GLctx.isTexture(texture);
|
|
3154
2947
|
};
|
|
3155
|
-
var _glLineWidth =
|
|
3156
|
-
|
|
3157
|
-
};
|
|
3158
|
-
var _glLinkProgram = function _glLinkProgram(program) {
|
|
2948
|
+
var _glLineWidth = x0 => GLctx.lineWidth(x0);
|
|
2949
|
+
var _glLinkProgram = program => {
|
|
3159
2950
|
program = GL.programs[program];
|
|
3160
2951
|
GLctx.linkProgram(program);
|
|
3161
2952
|
program.uniformLocsById = 0;
|
|
3162
2953
|
program.uniformSizeAndIdsByName = {};
|
|
3163
2954
|
};
|
|
3164
|
-
var _glMultiDrawArraysInstancedBaseInstanceWEBGL =
|
|
2955
|
+
var _glMultiDrawArraysInstancedBaseInstanceWEBGL = (mode, firsts, counts, instanceCounts, baseInstances, drawCount) => {
|
|
3165
2956
|
GLctx.mdibvbi["multiDrawArraysInstancedBaseInstanceWEBGL"](mode, HEAP32, firsts >> 2, HEAP32, counts >> 2, HEAP32, instanceCounts >> 2, HEAPU32, baseInstances >> 2, drawCount);
|
|
3166
2957
|
};
|
|
3167
|
-
var _glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL =
|
|
2958
|
+
var _glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL = (mode, counts, type, offsets, instanceCounts, baseVertices, baseInstances, drawCount) => {
|
|
3168
2959
|
GLctx.mdibvbi["multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL"](mode, HEAP32, counts >> 2, type, HEAP32, offsets >> 2, HEAP32, instanceCounts >> 2, HEAP32, baseVertices >> 2, HEAPU32, baseInstances >> 2, drawCount);
|
|
3169
2960
|
};
|
|
3170
|
-
var _glPixelStorei =
|
|
2961
|
+
var _glPixelStorei = (pname, param) => {
|
|
3171
2962
|
if (pname == 3317) {
|
|
3172
2963
|
GL.unpackAlignment = param;
|
|
3173
2964
|
}
|
|
3174
2965
|
GLctx.pixelStorei(pname, param);
|
|
3175
2966
|
};
|
|
3176
|
-
var _glReadBuffer =
|
|
3177
|
-
|
|
3178
|
-
};
|
|
3179
|
-
var computeUnpackAlignedImageSize = function computeUnpackAlignedImageSize(width, height, sizePerPixel, alignment) {
|
|
2967
|
+
var _glReadBuffer = x0 => GLctx.readBuffer(x0);
|
|
2968
|
+
var computeUnpackAlignedImageSize = (width, height, sizePerPixel, alignment) => {
|
|
3180
2969
|
function roundedToNextMultipleOf(x, y) {
|
|
3181
2970
|
return x + y - 1 & -y;
|
|
3182
2971
|
}
|
|
@@ -3184,7 +2973,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3184
2973
|
var alignedRowSize = roundedToNextMultipleOf(plainRowSize, alignment);
|
|
3185
2974
|
return height * alignedRowSize;
|
|
3186
2975
|
};
|
|
3187
|
-
var colorChannelsInGlTextureFormat =
|
|
2976
|
+
var colorChannelsInGlTextureFormat = format => {
|
|
3188
2977
|
var colorChannels = {
|
|
3189
2978
|
5: 3,
|
|
3190
2979
|
6: 4,
|
|
@@ -3198,7 +2987,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3198
2987
|
};
|
|
3199
2988
|
return colorChannels[format - 6402] || 1;
|
|
3200
2989
|
};
|
|
3201
|
-
var heapObjectForWebGLType =
|
|
2990
|
+
var heapObjectForWebGLType = type => {
|
|
3202
2991
|
type -= 5120;
|
|
3203
2992
|
if (type == 0) return HEAP8;
|
|
3204
2993
|
if (type == 1) return HEAPU8;
|
|
@@ -3208,16 +2997,14 @@ var WebRendererWasmFactory = function () {
|
|
|
3208
2997
|
if (type == 5 || type == 28922 || type == 28520 || type == 30779 || type == 30782) return HEAPU32;
|
|
3209
2998
|
return HEAPU16;
|
|
3210
2999
|
};
|
|
3211
|
-
var toTypedArrayIndex =
|
|
3212
|
-
|
|
3213
|
-
};
|
|
3214
|
-
var emscriptenWebGLGetTexPixelData = function emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat) {
|
|
3000
|
+
var toTypedArrayIndex = (pointer, heap) => pointer >>> 31 - Math.clz32(heap.BYTES_PER_ELEMENT);
|
|
3001
|
+
var emscriptenWebGLGetTexPixelData = (type, format, width, height, pixels, internalFormat) => {
|
|
3215
3002
|
var heap = heapObjectForWebGLType(type);
|
|
3216
3003
|
var sizePerPixel = colorChannelsInGlTextureFormat(format) * heap.BYTES_PER_ELEMENT;
|
|
3217
3004
|
var bytes = computeUnpackAlignedImageSize(width, height, sizePerPixel, GL.unpackAlignment);
|
|
3218
3005
|
return heap.subarray(toTypedArrayIndex(pixels, heap), toTypedArrayIndex(pixels + bytes, heap));
|
|
3219
3006
|
};
|
|
3220
|
-
var _glReadPixels =
|
|
3007
|
+
var _glReadPixels = (x, y, width, height, format, type, pixels) => {
|
|
3221
3008
|
if (GL.currentContext.version >= 2) {
|
|
3222
3009
|
if (GLctx.currentPixelPackBufferBinding) {
|
|
3223
3010
|
GLctx.readPixels(x, y, width, height, format, type, pixels);
|
|
@@ -3235,48 +3022,30 @@ var WebRendererWasmFactory = function () {
|
|
|
3235
3022
|
}
|
|
3236
3023
|
GLctx.readPixels(x, y, width, height, format, type, pixelData);
|
|
3237
3024
|
};
|
|
3238
|
-
var _glRenderbufferStorage =
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
var _glRenderbufferStorageMultisample = function _glRenderbufferStorageMultisample(x0, x1, x2, x3, x4) {
|
|
3242
|
-
return GLctx.renderbufferStorageMultisample(x0, x1, x2, x3, x4);
|
|
3243
|
-
};
|
|
3244
|
-
var _glSamplerParameterf = function _glSamplerParameterf(sampler, pname, param) {
|
|
3025
|
+
var _glRenderbufferStorage = (x0, x1, x2, x3) => GLctx.renderbufferStorage(x0, x1, x2, x3);
|
|
3026
|
+
var _glRenderbufferStorageMultisample = (x0, x1, x2, x3, x4) => GLctx.renderbufferStorageMultisample(x0, x1, x2, x3, x4);
|
|
3027
|
+
var _glSamplerParameterf = (sampler, pname, param) => {
|
|
3245
3028
|
GLctx.samplerParameterf(GL.samplers[sampler], pname, param);
|
|
3246
3029
|
};
|
|
3247
|
-
var _glSamplerParameteri =
|
|
3030
|
+
var _glSamplerParameteri = (sampler, pname, param) => {
|
|
3248
3031
|
GLctx.samplerParameteri(GL.samplers[sampler], pname, param);
|
|
3249
3032
|
};
|
|
3250
|
-
var _glSamplerParameteriv =
|
|
3033
|
+
var _glSamplerParameteriv = (sampler, pname, params) => {
|
|
3251
3034
|
var param = HEAP32[params >> 2];
|
|
3252
3035
|
GLctx.samplerParameteri(GL.samplers[sampler], pname, param);
|
|
3253
3036
|
};
|
|
3254
|
-
var _glScissor =
|
|
3255
|
-
|
|
3256
|
-
};
|
|
3257
|
-
var _glShaderSource = function _glShaderSource(shader, count, string, length) {
|
|
3037
|
+
var _glScissor = (x0, x1, x2, x3) => GLctx.scissor(x0, x1, x2, x3);
|
|
3038
|
+
var _glShaderSource = (shader, count, string, length) => {
|
|
3258
3039
|
var source = GL.getSource(shader, count, string, length);
|
|
3259
3040
|
GLctx.shaderSource(GL.shaders[shader], source);
|
|
3260
3041
|
};
|
|
3261
|
-
var _glStencilFunc =
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
var
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
var
|
|
3268
|
-
return GLctx.stencilMask(x0);
|
|
3269
|
-
};
|
|
3270
|
-
var _glStencilMaskSeparate = function _glStencilMaskSeparate(x0, x1) {
|
|
3271
|
-
return GLctx.stencilMaskSeparate(x0, x1);
|
|
3272
|
-
};
|
|
3273
|
-
var _glStencilOp = function _glStencilOp(x0, x1, x2) {
|
|
3274
|
-
return GLctx.stencilOp(x0, x1, x2);
|
|
3275
|
-
};
|
|
3276
|
-
var _glStencilOpSeparate = function _glStencilOpSeparate(x0, x1, x2, x3) {
|
|
3277
|
-
return GLctx.stencilOpSeparate(x0, x1, x2, x3);
|
|
3278
|
-
};
|
|
3279
|
-
var _glTexImage2D = function _glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels) {
|
|
3042
|
+
var _glStencilFunc = (x0, x1, x2) => GLctx.stencilFunc(x0, x1, x2);
|
|
3043
|
+
var _glStencilFuncSeparate = (x0, x1, x2, x3) => GLctx.stencilFuncSeparate(x0, x1, x2, x3);
|
|
3044
|
+
var _glStencilMask = x0 => GLctx.stencilMask(x0);
|
|
3045
|
+
var _glStencilMaskSeparate = (x0, x1) => GLctx.stencilMaskSeparate(x0, x1);
|
|
3046
|
+
var _glStencilOp = (x0, x1, x2) => GLctx.stencilOp(x0, x1, x2);
|
|
3047
|
+
var _glStencilOpSeparate = (x0, x1, x2, x3) => GLctx.stencilOpSeparate(x0, x1, x2, x3);
|
|
3048
|
+
var _glTexImage2D = (target, level, internalFormat, width, height, border, format, type, pixels) => {
|
|
3280
3049
|
if (GL.currentContext.version >= 2) {
|
|
3281
3050
|
if (GLctx.currentPixelUnpackBufferBinding) {
|
|
3282
3051
|
GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
|
|
@@ -3292,24 +3061,18 @@ var WebRendererWasmFactory = function () {
|
|
|
3292
3061
|
var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels) : null;
|
|
3293
3062
|
GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData);
|
|
3294
3063
|
};
|
|
3295
|
-
var _glTexParameterf =
|
|
3296
|
-
|
|
3297
|
-
};
|
|
3298
|
-
var _glTexParameterfv = function _glTexParameterfv(target, pname, params) {
|
|
3064
|
+
var _glTexParameterf = (x0, x1, x2) => GLctx.texParameterf(x0, x1, x2);
|
|
3065
|
+
var _glTexParameterfv = (target, pname, params) => {
|
|
3299
3066
|
var param = HEAPF32[params >> 2];
|
|
3300
3067
|
GLctx.texParameterf(target, pname, param);
|
|
3301
3068
|
};
|
|
3302
|
-
var _glTexParameteri =
|
|
3303
|
-
|
|
3304
|
-
};
|
|
3305
|
-
var _glTexParameteriv = function _glTexParameteriv(target, pname, params) {
|
|
3069
|
+
var _glTexParameteri = (x0, x1, x2) => GLctx.texParameteri(x0, x1, x2);
|
|
3070
|
+
var _glTexParameteriv = (target, pname, params) => {
|
|
3306
3071
|
var param = HEAP32[params >> 2];
|
|
3307
3072
|
GLctx.texParameteri(target, pname, param);
|
|
3308
3073
|
};
|
|
3309
|
-
var _glTexStorage2D =
|
|
3310
|
-
|
|
3311
|
-
};
|
|
3312
|
-
var _glTexSubImage2D = function _glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels) {
|
|
3074
|
+
var _glTexStorage2D = (x0, x1, x2, x3, x4) => GLctx.texStorage2D(x0, x1, x2, x3, x4);
|
|
3075
|
+
var _glTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, type, pixels) => {
|
|
3313
3076
|
if (GL.currentContext.version >= 2) {
|
|
3314
3077
|
if (GLctx.currentPixelUnpackBufferBinding) {
|
|
3315
3078
|
GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
|
@@ -3324,7 +3087,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3324
3087
|
var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels) : null;
|
|
3325
3088
|
GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixelData);
|
|
3326
3089
|
};
|
|
3327
|
-
var webglGetUniformLocation =
|
|
3090
|
+
var webglGetUniformLocation = location => {
|
|
3328
3091
|
var p = GLctx.currentProgram;
|
|
3329
3092
|
if (p) {
|
|
3330
3093
|
var webglLoc = p.uniformLocsById[location];
|
|
@@ -3336,11 +3099,11 @@ var WebRendererWasmFactory = function () {
|
|
|
3336
3099
|
GL.recordError(1282);
|
|
3337
3100
|
}
|
|
3338
3101
|
};
|
|
3339
|
-
var _glUniform1f =
|
|
3102
|
+
var _glUniform1f = (location, v0) => {
|
|
3340
3103
|
GLctx.uniform1f(webglGetUniformLocation(location), v0);
|
|
3341
3104
|
};
|
|
3342
3105
|
var miniTempWebGLFloatBuffers = [];
|
|
3343
|
-
var _glUniform1fv =
|
|
3106
|
+
var _glUniform1fv = (location, count, value) => {
|
|
3344
3107
|
if (GL.currentContext.version >= 2) {
|
|
3345
3108
|
count && GLctx.uniform1fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count);
|
|
3346
3109
|
return;
|
|
@@ -3355,11 +3118,11 @@ var WebRendererWasmFactory = function () {
|
|
|
3355
3118
|
}
|
|
3356
3119
|
GLctx.uniform1fv(webglGetUniformLocation(location), view);
|
|
3357
3120
|
};
|
|
3358
|
-
var _glUniform1i =
|
|
3121
|
+
var _glUniform1i = (location, v0) => {
|
|
3359
3122
|
GLctx.uniform1i(webglGetUniformLocation(location), v0);
|
|
3360
3123
|
};
|
|
3361
3124
|
var miniTempWebGLIntBuffers = [];
|
|
3362
|
-
var _glUniform1iv =
|
|
3125
|
+
var _glUniform1iv = (location, count, value) => {
|
|
3363
3126
|
if (GL.currentContext.version >= 2) {
|
|
3364
3127
|
count && GLctx.uniform1iv(webglGetUniformLocation(location), HEAP32, value >> 2, count);
|
|
3365
3128
|
return;
|
|
@@ -3374,10 +3137,10 @@ var WebRendererWasmFactory = function () {
|
|
|
3374
3137
|
}
|
|
3375
3138
|
GLctx.uniform1iv(webglGetUniformLocation(location), view);
|
|
3376
3139
|
};
|
|
3377
|
-
var _glUniform2f =
|
|
3140
|
+
var _glUniform2f = (location, v0, v1) => {
|
|
3378
3141
|
GLctx.uniform2f(webglGetUniformLocation(location), v0, v1);
|
|
3379
3142
|
};
|
|
3380
|
-
var _glUniform2fv =
|
|
3143
|
+
var _glUniform2fv = (location, count, value) => {
|
|
3381
3144
|
if (GL.currentContext.version >= 2) {
|
|
3382
3145
|
count && GLctx.uniform2fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count * 2);
|
|
3383
3146
|
return;
|
|
@@ -3393,10 +3156,10 @@ var WebRendererWasmFactory = function () {
|
|
|
3393
3156
|
}
|
|
3394
3157
|
GLctx.uniform2fv(webglGetUniformLocation(location), view);
|
|
3395
3158
|
};
|
|
3396
|
-
var _glUniform2i =
|
|
3159
|
+
var _glUniform2i = (location, v0, v1) => {
|
|
3397
3160
|
GLctx.uniform2i(webglGetUniformLocation(location), v0, v1);
|
|
3398
3161
|
};
|
|
3399
|
-
var _glUniform2iv =
|
|
3162
|
+
var _glUniform2iv = (location, count, value) => {
|
|
3400
3163
|
if (GL.currentContext.version >= 2) {
|
|
3401
3164
|
count && GLctx.uniform2iv(webglGetUniformLocation(location), HEAP32, value >> 2, count * 2);
|
|
3402
3165
|
return;
|
|
@@ -3412,10 +3175,10 @@ var WebRendererWasmFactory = function () {
|
|
|
3412
3175
|
}
|
|
3413
3176
|
GLctx.uniform2iv(webglGetUniformLocation(location), view);
|
|
3414
3177
|
};
|
|
3415
|
-
var _glUniform3f =
|
|
3178
|
+
var _glUniform3f = (location, v0, v1, v2) => {
|
|
3416
3179
|
GLctx.uniform3f(webglGetUniformLocation(location), v0, v1, v2);
|
|
3417
3180
|
};
|
|
3418
|
-
var _glUniform3fv =
|
|
3181
|
+
var _glUniform3fv = (location, count, value) => {
|
|
3419
3182
|
if (GL.currentContext.version >= 2) {
|
|
3420
3183
|
count && GLctx.uniform3fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count * 3);
|
|
3421
3184
|
return;
|
|
@@ -3432,10 +3195,10 @@ var WebRendererWasmFactory = function () {
|
|
|
3432
3195
|
}
|
|
3433
3196
|
GLctx.uniform3fv(webglGetUniformLocation(location), view);
|
|
3434
3197
|
};
|
|
3435
|
-
var _glUniform3i =
|
|
3198
|
+
var _glUniform3i = (location, v0, v1, v2) => {
|
|
3436
3199
|
GLctx.uniform3i(webglGetUniformLocation(location), v0, v1, v2);
|
|
3437
3200
|
};
|
|
3438
|
-
var _glUniform3iv =
|
|
3201
|
+
var _glUniform3iv = (location, count, value) => {
|
|
3439
3202
|
if (GL.currentContext.version >= 2) {
|
|
3440
3203
|
count && GLctx.uniform3iv(webglGetUniformLocation(location), HEAP32, value >> 2, count * 3);
|
|
3441
3204
|
return;
|
|
@@ -3452,10 +3215,10 @@ var WebRendererWasmFactory = function () {
|
|
|
3452
3215
|
}
|
|
3453
3216
|
GLctx.uniform3iv(webglGetUniformLocation(location), view);
|
|
3454
3217
|
};
|
|
3455
|
-
var _glUniform4f =
|
|
3218
|
+
var _glUniform4f = (location, v0, v1, v2, v3) => {
|
|
3456
3219
|
GLctx.uniform4f(webglGetUniformLocation(location), v0, v1, v2, v3);
|
|
3457
3220
|
};
|
|
3458
|
-
var _glUniform4fv =
|
|
3221
|
+
var _glUniform4fv = (location, count, value) => {
|
|
3459
3222
|
if (GL.currentContext.version >= 2) {
|
|
3460
3223
|
count && GLctx.uniform4fv(webglGetUniformLocation(location), HEAPF32, value >> 2, count * 4);
|
|
3461
3224
|
return;
|
|
@@ -3476,10 +3239,10 @@ var WebRendererWasmFactory = function () {
|
|
|
3476
3239
|
}
|
|
3477
3240
|
GLctx.uniform4fv(webglGetUniformLocation(location), view);
|
|
3478
3241
|
};
|
|
3479
|
-
var _glUniform4i =
|
|
3242
|
+
var _glUniform4i = (location, v0, v1, v2, v3) => {
|
|
3480
3243
|
GLctx.uniform4i(webglGetUniformLocation(location), v0, v1, v2, v3);
|
|
3481
3244
|
};
|
|
3482
|
-
var _glUniform4iv =
|
|
3245
|
+
var _glUniform4iv = (location, count, value) => {
|
|
3483
3246
|
if (GL.currentContext.version >= 2) {
|
|
3484
3247
|
count && GLctx.uniform4iv(webglGetUniformLocation(location), HEAP32, value >> 2, count * 4);
|
|
3485
3248
|
return;
|
|
@@ -3497,7 +3260,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3497
3260
|
}
|
|
3498
3261
|
GLctx.uniform4iv(webglGetUniformLocation(location), view);
|
|
3499
3262
|
};
|
|
3500
|
-
var _glUniformMatrix2fv =
|
|
3263
|
+
var _glUniformMatrix2fv = (location, count, transpose, value) => {
|
|
3501
3264
|
if (GL.currentContext.version >= 2) {
|
|
3502
3265
|
count && GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value >> 2, count * 4);
|
|
3503
3266
|
return;
|
|
@@ -3515,7 +3278,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3515
3278
|
}
|
|
3516
3279
|
GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, view);
|
|
3517
3280
|
};
|
|
3518
|
-
var _glUniformMatrix3fv =
|
|
3281
|
+
var _glUniformMatrix3fv = (location, count, transpose, value) => {
|
|
3519
3282
|
if (GL.currentContext.version >= 2) {
|
|
3520
3283
|
count && GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value >> 2, count * 9);
|
|
3521
3284
|
return;
|
|
@@ -3538,7 +3301,7 @@ var WebRendererWasmFactory = function () {
|
|
|
3538
3301
|
}
|
|
3539
3302
|
GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, view);
|
|
3540
3303
|
};
|
|
3541
|
-
var _glUniformMatrix4fv =
|
|
3304
|
+
var _glUniformMatrix4fv = (location, count, transpose, value) => {
|
|
3542
3305
|
if (GL.currentContext.version >= 2) {
|
|
3543
3306
|
count && GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, HEAPF32, value >> 2, count * 16);
|
|
3544
3307
|
return;
|
|
@@ -3571,50 +3334,44 @@ var WebRendererWasmFactory = function () {
|
|
|
3571
3334
|
}
|
|
3572
3335
|
GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, view);
|
|
3573
3336
|
};
|
|
3574
|
-
var _glUseProgram =
|
|
3337
|
+
var _glUseProgram = program => {
|
|
3575
3338
|
program = GL.programs[program];
|
|
3576
3339
|
GLctx.useProgram(program);
|
|
3577
3340
|
GLctx.currentProgram = program;
|
|
3578
3341
|
};
|
|
3579
|
-
var _glVertexAttrib1f =
|
|
3580
|
-
|
|
3581
|
-
};
|
|
3582
|
-
var _glVertexAttrib2fv = function _glVertexAttrib2fv(index, v) {
|
|
3342
|
+
var _glVertexAttrib1f = (x0, x1) => GLctx.vertexAttrib1f(x0, x1);
|
|
3343
|
+
var _glVertexAttrib2fv = (index, v) => {
|
|
3583
3344
|
GLctx.vertexAttrib2f(index, HEAPF32[v >> 2], HEAPF32[v + 4 >> 2]);
|
|
3584
3345
|
};
|
|
3585
|
-
var _glVertexAttrib3fv =
|
|
3346
|
+
var _glVertexAttrib3fv = (index, v) => {
|
|
3586
3347
|
GLctx.vertexAttrib3f(index, HEAPF32[v >> 2], HEAPF32[v + 4 >> 2], HEAPF32[v + 8 >> 2]);
|
|
3587
3348
|
};
|
|
3588
|
-
var _glVertexAttrib4fv =
|
|
3349
|
+
var _glVertexAttrib4fv = (index, v) => {
|
|
3589
3350
|
GLctx.vertexAttrib4f(index, HEAPF32[v >> 2], HEAPF32[v + 4 >> 2], HEAPF32[v + 8 >> 2], HEAPF32[v + 12 >> 2]);
|
|
3590
3351
|
};
|
|
3591
|
-
var _glVertexAttribDivisor =
|
|
3352
|
+
var _glVertexAttribDivisor = (index, divisor) => {
|
|
3592
3353
|
GLctx.vertexAttribDivisor(index, divisor);
|
|
3593
3354
|
};
|
|
3594
|
-
var _glVertexAttribIPointer =
|
|
3355
|
+
var _glVertexAttribIPointer = (index, size, type, stride, ptr) => {
|
|
3595
3356
|
GLctx.vertexAttribIPointer(index, size, type, stride, ptr);
|
|
3596
3357
|
};
|
|
3597
|
-
var _glVertexAttribPointer =
|
|
3358
|
+
var _glVertexAttribPointer = (index, size, type, normalized, stride, ptr) => {
|
|
3598
3359
|
GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr);
|
|
3599
3360
|
};
|
|
3600
|
-
var _glViewport =
|
|
3601
|
-
|
|
3602
|
-
};
|
|
3603
|
-
var _glWaitSync = function _glWaitSync(sync, flags, timeout) {
|
|
3361
|
+
var _glViewport = (x0, x1, x2, x3) => GLctx.viewport(x0, x1, x2, x3);
|
|
3362
|
+
var _glWaitSync = (sync, flags, timeout) => {
|
|
3604
3363
|
timeout = Number(timeout);
|
|
3605
3364
|
GLctx.waitSync(GL.syncs[sync], flags, timeout);
|
|
3606
3365
|
};
|
|
3607
|
-
var isLeapYear =
|
|
3608
|
-
|
|
3609
|
-
};
|
|
3610
|
-
var arraySum = function arraySum(array, index) {
|
|
3366
|
+
var isLeapYear = year => year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
3367
|
+
var arraySum = (array, index) => {
|
|
3611
3368
|
var sum = 0;
|
|
3612
3369
|
for (var i = 0; i <= index; sum += array[i++]) {}
|
|
3613
3370
|
return sum;
|
|
3614
3371
|
};
|
|
3615
3372
|
var MONTH_DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
3616
3373
|
var MONTH_DAYS_REGULAR = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
3617
|
-
var addDays =
|
|
3374
|
+
var addDays = (date, days) => {
|
|
3618
3375
|
var newDate = new Date(date.getTime());
|
|
3619
3376
|
while (days > 0) {
|
|
3620
3377
|
var leap = isLeapYear(newDate.getFullYear());
|
|
@@ -3643,10 +3400,10 @@ var WebRendererWasmFactory = function () {
|
|
|
3643
3400
|
if (dontAddNull) u8array.length = numBytesWritten;
|
|
3644
3401
|
return u8array;
|
|
3645
3402
|
}
|
|
3646
|
-
var writeArrayToMemory =
|
|
3403
|
+
var writeArrayToMemory = (array, buffer) => {
|
|
3647
3404
|
HEAP8.set(array, buffer);
|
|
3648
3405
|
};
|
|
3649
|
-
var _strftime =
|
|
3406
|
+
var _strftime = (s, maxsize, format, tm) => {
|
|
3650
3407
|
var tm_zone = HEAPU32[tm + 40 >> 2];
|
|
3651
3408
|
var date = {
|
|
3652
3409
|
tm_sec: HEAP32[tm >> 2],
|
|
@@ -3752,72 +3509,42 @@ var WebRendererWasmFactory = function () {
|
|
|
3752
3509
|
return thisDate.getFullYear() - 1;
|
|
3753
3510
|
}
|
|
3754
3511
|
var EXPANSION_RULES_2 = {
|
|
3755
|
-
"%a":
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
"%
|
|
3759
|
-
|
|
3760
|
-
},
|
|
3761
|
-
"%b": function b(date) {
|
|
3762
|
-
return MONTHS[date.tm_mon].substring(0, 3);
|
|
3763
|
-
},
|
|
3764
|
-
"%B": function B(date) {
|
|
3765
|
-
return MONTHS[date.tm_mon];
|
|
3766
|
-
},
|
|
3767
|
-
"%C": function C(date) {
|
|
3512
|
+
"%a": date => WEEKDAYS[date.tm_wday].substring(0, 3),
|
|
3513
|
+
"%A": date => WEEKDAYS[date.tm_wday],
|
|
3514
|
+
"%b": date => MONTHS[date.tm_mon].substring(0, 3),
|
|
3515
|
+
"%B": date => MONTHS[date.tm_mon],
|
|
3516
|
+
"%C": date => {
|
|
3768
3517
|
var year = date.tm_year + 1900;
|
|
3769
3518
|
return leadingNulls(year / 100 | 0, 2);
|
|
3770
3519
|
},
|
|
3771
|
-
"%d":
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
"%e": function e(date) {
|
|
3775
|
-
return leadingSomething(date.tm_mday, 2, " ");
|
|
3776
|
-
},
|
|
3777
|
-
"%g": function g(date) {
|
|
3778
|
-
return getWeekBasedYear(date).toString().substring(2);
|
|
3779
|
-
},
|
|
3520
|
+
"%d": date => leadingNulls(date.tm_mday, 2),
|
|
3521
|
+
"%e": date => leadingSomething(date.tm_mday, 2, " "),
|
|
3522
|
+
"%g": date => getWeekBasedYear(date).toString().substring(2),
|
|
3780
3523
|
"%G": getWeekBasedYear,
|
|
3781
|
-
"%H":
|
|
3782
|
-
|
|
3783
|
-
},
|
|
3784
|
-
"%I": function I(date) {
|
|
3524
|
+
"%H": date => leadingNulls(date.tm_hour, 2),
|
|
3525
|
+
"%I": date => {
|
|
3785
3526
|
var twelveHour = date.tm_hour;
|
|
3786
3527
|
if (twelveHour == 0) twelveHour = 12;else if (twelveHour > 12) twelveHour -= 12;
|
|
3787
3528
|
return leadingNulls(twelveHour, 2);
|
|
3788
3529
|
},
|
|
3789
|
-
"%j":
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
"%
|
|
3793
|
-
|
|
3794
|
-
},
|
|
3795
|
-
"%M": function M(date) {
|
|
3796
|
-
return leadingNulls(date.tm_min, 2);
|
|
3797
|
-
},
|
|
3798
|
-
"%n": function n() {
|
|
3799
|
-
return "\n";
|
|
3800
|
-
},
|
|
3801
|
-
"%p": function p(date) {
|
|
3530
|
+
"%j": date => leadingNulls(date.tm_mday + arraySum(isLeapYear(date.tm_year + 1900) ? MONTH_DAYS_LEAP : MONTH_DAYS_REGULAR, date.tm_mon - 1), 3),
|
|
3531
|
+
"%m": date => leadingNulls(date.tm_mon + 1, 2),
|
|
3532
|
+
"%M": date => leadingNulls(date.tm_min, 2),
|
|
3533
|
+
"%n": () => "\n",
|
|
3534
|
+
"%p": date => {
|
|
3802
3535
|
if (date.tm_hour >= 0 && date.tm_hour < 12) {
|
|
3803
3536
|
return "AM";
|
|
3804
3537
|
}
|
|
3805
3538
|
return "PM";
|
|
3806
3539
|
},
|
|
3807
|
-
"%S":
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
"%
|
|
3811
|
-
return "\t";
|
|
3812
|
-
},
|
|
3813
|
-
"%u": function u(date) {
|
|
3814
|
-
return date.tm_wday || 7;
|
|
3815
|
-
},
|
|
3816
|
-
"%U": function U(date) {
|
|
3540
|
+
"%S": date => leadingNulls(date.tm_sec, 2),
|
|
3541
|
+
"%t": () => "\t",
|
|
3542
|
+
"%u": date => date.tm_wday || 7,
|
|
3543
|
+
"%U": date => {
|
|
3817
3544
|
var days = date.tm_yday + 7 - date.tm_wday;
|
|
3818
3545
|
return leadingNulls(Math.floor(days / 7), 2);
|
|
3819
3546
|
},
|
|
3820
|
-
"%V":
|
|
3547
|
+
"%V": date => {
|
|
3821
3548
|
var val = Math.floor((date.tm_yday + 7 - (date.tm_wday + 6) % 7) / 7);
|
|
3822
3549
|
if ((date.tm_wday + 371 - date.tm_yday - 2) % 7 <= 2) {
|
|
3823
3550
|
val++;
|
|
@@ -3834,32 +3561,22 @@ var WebRendererWasmFactory = function () {
|
|
|
3834
3561
|
}
|
|
3835
3562
|
return leadingNulls(val, 2);
|
|
3836
3563
|
},
|
|
3837
|
-
"%w":
|
|
3838
|
-
|
|
3839
|
-
},
|
|
3840
|
-
"%W": function W(date) {
|
|
3564
|
+
"%w": date => date.tm_wday,
|
|
3565
|
+
"%W": date => {
|
|
3841
3566
|
var days = date.tm_yday + 7 - (date.tm_wday + 6) % 7;
|
|
3842
3567
|
return leadingNulls(Math.floor(days / 7), 2);
|
|
3843
3568
|
},
|
|
3844
|
-
"%y":
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
"%Y": function Y(date) {
|
|
3848
|
-
return date.tm_year + 1900;
|
|
3849
|
-
},
|
|
3850
|
-
"%z": function z(date) {
|
|
3569
|
+
"%y": date => (date.tm_year + 1900).toString().substring(2),
|
|
3570
|
+
"%Y": date => date.tm_year + 1900,
|
|
3571
|
+
"%z": date => {
|
|
3851
3572
|
var off = date.tm_gmtoff;
|
|
3852
3573
|
var ahead = off >= 0;
|
|
3853
3574
|
off = Math.abs(off) / 60;
|
|
3854
3575
|
off = off / 60 * 100 + off % 60;
|
|
3855
3576
|
return (ahead ? "+" : "-") + String("0000" + off).slice(-4);
|
|
3856
3577
|
},
|
|
3857
|
-
"%Z":
|
|
3858
|
-
|
|
3859
|
-
},
|
|
3860
|
-
"%%": function _() {
|
|
3861
|
-
return "%";
|
|
3862
|
-
}
|
|
3578
|
+
"%Z": date => date.tm_zone,
|
|
3579
|
+
"%%": () => "%"
|
|
3863
3580
|
};
|
|
3864
3581
|
pattern = pattern.replace(/%%/g, "\0\0");
|
|
3865
3582
|
for (var rule in EXPANSION_RULES_2) {
|
|
@@ -3875,32 +3592,20 @@ var WebRendererWasmFactory = function () {
|
|
|
3875
3592
|
writeArrayToMemory(bytes, s);
|
|
3876
3593
|
return bytes.length - 1;
|
|
3877
3594
|
};
|
|
3878
|
-
var _strftime_l =
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
var _this;
|
|
3884
|
-
_classCallCheck(this, InternalError);
|
|
3885
|
-
_this = _callSuper(this, InternalError, [message]);
|
|
3886
|
-
_this.name = "InternalError";
|
|
3887
|
-
return _this;
|
|
3595
|
+
var _strftime_l = (s, maxsize, format, tm, loc) => _strftime(s, maxsize, format, tm);
|
|
3596
|
+
InternalError = Module["InternalError"] = class InternalError extends Error {
|
|
3597
|
+
constructor(message) {
|
|
3598
|
+
super(message);
|
|
3599
|
+
this.name = "InternalError";
|
|
3888
3600
|
}
|
|
3889
|
-
|
|
3890
|
-
return _createClass(InternalError);
|
|
3891
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
3601
|
+
};
|
|
3892
3602
|
embind_init_charCodes();
|
|
3893
|
-
BindingError = Module["BindingError"] =
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
return _this2;
|
|
3900
|
-
}
|
|
3901
|
-
_inherits(BindingError, _Error2);
|
|
3902
|
-
return _createClass(BindingError);
|
|
3903
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
3603
|
+
BindingError = Module["BindingError"] = class BindingError extends Error {
|
|
3604
|
+
constructor(message) {
|
|
3605
|
+
super(message);
|
|
3606
|
+
this.name = "BindingError";
|
|
3607
|
+
}
|
|
3608
|
+
};
|
|
3904
3609
|
init_ClassHandle();
|
|
3905
3610
|
init_embind();
|
|
3906
3611
|
init_RegisteredPointer();
|
|
@@ -4126,24 +3831,12 @@ var WebRendererWasmFactory = function () {
|
|
|
4126
3831
|
cb: _strftime_l
|
|
4127
3832
|
};
|
|
4128
3833
|
var wasmExports = createWasm();
|
|
4129
|
-
var
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
var
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
var _free = Module["_free"] = function (a0) {
|
|
4136
|
-
return (_free = Module["_free"] = wasmExports["Yc"])(a0);
|
|
4137
|
-
};
|
|
4138
|
-
var _setThrew2 = function _setThrew(a0, a1) {
|
|
4139
|
-
return (_setThrew2 = wasmExports["Zc"])(a0, a1);
|
|
4140
|
-
};
|
|
4141
|
-
var _emscripten_stack_restore = function __emscripten_stack_restore(a0) {
|
|
4142
|
-
return (_emscripten_stack_restore = wasmExports["_c"])(a0);
|
|
4143
|
-
};
|
|
4144
|
-
var _emscripten_stack_get_current2 = function _emscripten_stack_get_current() {
|
|
4145
|
-
return (_emscripten_stack_get_current2 = wasmExports["$c"])();
|
|
4146
|
-
};
|
|
3834
|
+
var ___getTypeName = a0 => (___getTypeName = wasmExports["Vc"])(a0);
|
|
3835
|
+
var _malloc = Module["_malloc"] = a0 => (_malloc = Module["_malloc"] = wasmExports["Wc"])(a0);
|
|
3836
|
+
var _free = Module["_free"] = a0 => (_free = Module["_free"] = wasmExports["Yc"])(a0);
|
|
3837
|
+
var _setThrew = (a0, a1) => (_setThrew = wasmExports["Zc"])(a0, a1);
|
|
3838
|
+
var __emscripten_stack_restore = a0 => (__emscripten_stack_restore = wasmExports["_c"])(a0);
|
|
3839
|
+
var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports["$c"])();
|
|
4147
3840
|
function invoke_ii(index, a1) {
|
|
4148
3841
|
var sp = stackSave();
|
|
4149
3842
|
try {
|
|
@@ -4151,7 +3844,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4151
3844
|
} catch (e) {
|
|
4152
3845
|
stackRestore(sp);
|
|
4153
3846
|
if (e !== e + 0) throw e;
|
|
4154
|
-
|
|
3847
|
+
_setThrew(1, 0);
|
|
4155
3848
|
}
|
|
4156
3849
|
}
|
|
4157
3850
|
function invoke_iii(index, a1, a2) {
|
|
@@ -4161,7 +3854,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4161
3854
|
} catch (e) {
|
|
4162
3855
|
stackRestore(sp);
|
|
4163
3856
|
if (e !== e + 0) throw e;
|
|
4164
|
-
|
|
3857
|
+
_setThrew(1, 0);
|
|
4165
3858
|
}
|
|
4166
3859
|
}
|
|
4167
3860
|
function invoke_viii(index, a1, a2, a3) {
|
|
@@ -4171,7 +3864,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4171
3864
|
} catch (e) {
|
|
4172
3865
|
stackRestore(sp);
|
|
4173
3866
|
if (e !== e + 0) throw e;
|
|
4174
|
-
|
|
3867
|
+
_setThrew(1, 0);
|
|
4175
3868
|
}
|
|
4176
3869
|
}
|
|
4177
3870
|
function invoke_vii(index, a1, a2) {
|
|
@@ -4181,7 +3874,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4181
3874
|
} catch (e) {
|
|
4182
3875
|
stackRestore(sp);
|
|
4183
3876
|
if (e !== e + 0) throw e;
|
|
4184
|
-
|
|
3877
|
+
_setThrew(1, 0);
|
|
4185
3878
|
}
|
|
4186
3879
|
}
|
|
4187
3880
|
function invoke_iiiii(index, a1, a2, a3, a4) {
|
|
@@ -4191,7 +3884,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4191
3884
|
} catch (e) {
|
|
4192
3885
|
stackRestore(sp);
|
|
4193
3886
|
if (e !== e + 0) throw e;
|
|
4194
|
-
|
|
3887
|
+
_setThrew(1, 0);
|
|
4195
3888
|
}
|
|
4196
3889
|
}
|
|
4197
3890
|
function invoke_iiii(index, a1, a2, a3) {
|
|
@@ -4201,7 +3894,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4201
3894
|
} catch (e) {
|
|
4202
3895
|
stackRestore(sp);
|
|
4203
3896
|
if (e !== e + 0) throw e;
|
|
4204
|
-
|
|
3897
|
+
_setThrew(1, 0);
|
|
4205
3898
|
}
|
|
4206
3899
|
}
|
|
4207
3900
|
function invoke_vi(index, a1) {
|
|
@@ -4211,7 +3904,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4211
3904
|
} catch (e) {
|
|
4212
3905
|
stackRestore(sp);
|
|
4213
3906
|
if (e !== e + 0) throw e;
|
|
4214
|
-
|
|
3907
|
+
_setThrew(1, 0);
|
|
4215
3908
|
}
|
|
4216
3909
|
}
|
|
4217
3910
|
function invoke_viiii(index, a1, a2, a3, a4) {
|
|
@@ -4221,7 +3914,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4221
3914
|
} catch (e) {
|
|
4222
3915
|
stackRestore(sp);
|
|
4223
3916
|
if (e !== e + 0) throw e;
|
|
4224
|
-
|
|
3917
|
+
_setThrew(1, 0);
|
|
4225
3918
|
}
|
|
4226
3919
|
}
|
|
4227
3920
|
function invoke_viiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
|
@@ -4231,7 +3924,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4231
3924
|
} catch (e) {
|
|
4232
3925
|
stackRestore(sp);
|
|
4233
3926
|
if (e !== e + 0) throw e;
|
|
4234
|
-
|
|
3927
|
+
_setThrew(1, 0);
|
|
4235
3928
|
}
|
|
4236
3929
|
}
|
|
4237
3930
|
function invoke_v(index) {
|
|
@@ -4241,7 +3934,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4241
3934
|
} catch (e) {
|
|
4242
3935
|
stackRestore(sp);
|
|
4243
3936
|
if (e !== e + 0) throw e;
|
|
4244
|
-
|
|
3937
|
+
_setThrew(1, 0);
|
|
4245
3938
|
}
|
|
4246
3939
|
}
|
|
4247
3940
|
function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) {
|
|
@@ -4251,7 +3944,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4251
3944
|
} catch (e) {
|
|
4252
3945
|
stackRestore(sp);
|
|
4253
3946
|
if (e !== e + 0) throw e;
|
|
4254
|
-
|
|
3947
|
+
_setThrew(1, 0);
|
|
4255
3948
|
}
|
|
4256
3949
|
}
|
|
4257
3950
|
function invoke_iiiiii(index, a1, a2, a3, a4, a5) {
|
|
@@ -4261,7 +3954,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4261
3954
|
} catch (e) {
|
|
4262
3955
|
stackRestore(sp);
|
|
4263
3956
|
if (e !== e + 0) throw e;
|
|
4264
|
-
|
|
3957
|
+
_setThrew(1, 0);
|
|
4265
3958
|
}
|
|
4266
3959
|
}
|
|
4267
3960
|
function invoke_iiiiiii(index, a1, a2, a3, a4, a5, a6) {
|
|
@@ -4271,7 +3964,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4271
3964
|
} catch (e) {
|
|
4272
3965
|
stackRestore(sp);
|
|
4273
3966
|
if (e !== e + 0) throw e;
|
|
4274
|
-
|
|
3967
|
+
_setThrew(1, 0);
|
|
4275
3968
|
}
|
|
4276
3969
|
}
|
|
4277
3970
|
function invoke_viiiii(index, a1, a2, a3, a4, a5) {
|
|
@@ -4281,7 +3974,7 @@ var WebRendererWasmFactory = function () {
|
|
|
4281
3974
|
} catch (e) {
|
|
4282
3975
|
stackRestore(sp);
|
|
4283
3976
|
if (e !== e + 0) throw e;
|
|
4284
|
-
|
|
3977
|
+
_setThrew(1, 0);
|
|
4285
3978
|
}
|
|
4286
3979
|
}
|
|
4287
3980
|
Module["GL"] = GL;
|
|
@@ -4315,6 +4008,6 @@ var WebRendererWasmFactory = function () {
|
|
|
4315
4008
|
moduleRtn = readyPromise;
|
|
4316
4009
|
return moduleRtn;
|
|
4317
4010
|
};
|
|
4318
|
-
}();
|
|
4011
|
+
})();
|
|
4319
4012
|
|
|
4320
4013
|
export { WebRendererWasmFactory as default };
|