1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 16:56:00 +02:00
This commit is contained in:
syuilo
2026-04-27 17:13:25 +09:00
parent 130a43f39a
commit 1d71c0c6dd
3 changed files with 14 additions and 0 deletions

View File

@@ -12,6 +12,8 @@ import type { ShallowRef } from 'vue';
import type { RoomState } from './engine.js';
import type { ObjectDef, RoomStateObject } from './object.js';
import * as sound from '@/utility/sound.js';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
export type RoomControllerOptions = {
workerMode?: boolean;
@@ -83,6 +85,13 @@ export class RoomController {
const babylonEngine = new BABYLON.WebGPUEngine(canvas, { doNotHandleContextLost: true, powerPreference: 'high-performance' });
babylonEngine.compatibilityMode = false;
babylonEngine.enableOfflineSupport = false;
babylonEngine.onContextLostObservable.add(() => {
os.alert({
type: 'error',
title: i18n.ts.somethingHappened,
text: i18n.ts._room.crushed_description,
});
});
await babylonEngine.initAsync();
if (this.options.resolution === 2) babylonEngine.setHardwareScalingLevel(0.5);
if (this.options.resolution === 0.5) babylonEngine.setHardwareScalingLevel(2);