safari workaround for workers. disable decals in dark mode. add client listener before starting client

This commit is contained in:
Stewart Allen 2022-01-18 13:41:11 -05:00
commit 08d76c8b2f
4 changed files with 10 additions and 7 deletions

View file

@ -191,7 +191,8 @@
}); });
UC.setHoverPop(false); UC.setHoverPop(false);
updateFPS(); updateFPS();
if (control.decals) { if (control.decals && !control.dark) {
// disable decals in dark mode
loadDeviceTexture(currentDevice, deviceTexture); loadDeviceTexture(currentDevice, deviceTexture);
} else { } else {
clearDeviceTexture(); clearDeviceTexture();
@ -909,7 +910,9 @@
function loadDeviceTexture(dev, texture) { function loadDeviceTexture(dev, texture) {
clearDeviceTexture(); clearDeviceTexture();
deviceTexture = texture; deviceTexture = texture;
if (!(texture && API.conf.get().controller.decals)) { let { decals, dark } = API.conf.get().controller;
// disable decals in dark mode
if (!(texture && decals && !dark)) {
return; return;
} }
let { width, height } = texture.image; let { width, height } = texture.image;

View file

@ -59,6 +59,9 @@ function init() {
}, 100); }, 100);
space.view.setZoom(zoomrev, zoomspd); space.view.setZoom(zoomrev, zoomspd);
// reload stored space when worker is ready
moto.client.on('ready', restore_space);
// start worker // start worker
moto.client.start(`/code/mesh_work?${gapp.version}`); moto.client.start(`/code/mesh_work?${gapp.version}`);
@ -67,9 +70,6 @@ function init() {
// trigger ui building // trigger ui building
call.ui_build(); call.ui_build();
// reload stored space
moto.client.on('ready', restore_space);
} }
// restore space layout and view from previous session // restore space layout and view from previous session

View file

@ -319,7 +319,7 @@ let tool = {
} }
}, },
analyze(models, opt = { compound: false }) { analyze(models, opt = { compound: true }) {
models = fallback(models); models = fallback(models);
api.log.emit('analyzing mesh(es)...').pin(); api.log.emit('analyzing mesh(es)...').pin();
let promises = []; let promises = [];

View file

@ -6,7 +6,7 @@
let moto = self.moto = self.moto || {}, let moto = self.moto = self.moto || {},
ccvalue = self.navigator ? navigator.hardwareConcurrency || 1 : 1, ccvalue = self.navigator ? navigator.hardwareConcurrency || 1 : 1,
ccmax = ccvalue > 3 ? ccvalue - 1 : 0, ccmax = ccvalue > 3 ? ccvalue - 1 : 1,
workcc = false, // concurrent or not workcc = false, // concurrent or not
workurl = null, // url to load worker workurl = null, // url to load worker
worknum = 1, // number of workers to start worknum = 1, // number of workers to start