--- a/application.mjs +++ b/application.mjs @@ -33,12 +33,12 @@ const saved = localStorage.getItem('0ad-gpu-preference'); if (['default', 'high-performance'].includes(saved)) gpuPreference.value = saved; const backend = localStorage.getItem('0ad-renderer-backend'); - if (['webgl', 'webgpu'].includes(backend)) backendSelector.value = backend; + backendSelector.value = 'webgl'; // Batollo hosting: WebGL 2 only const quality = localStorage.getItem('0ad-graphics-quality'); if (GRAPHICS_MODES.includes(quality)) graphicsQuality.value = quality; } catch { /* Storage may be unavailable; the selector still works. */ } // ?renderer=webgpu preselects the experimental backend; WebGL 2 stays the default. -if (query.get('renderer') === 'webgpu') backendSelector.value = 'webgpu'; +backendSelector.value = 'webgl'; backendSelector.disabled = true; // ?graphics=auto|low|original overrides the saved choice for this page load. if (GRAPHICS_MODES.includes(query.get('graphics'))) graphicsQuality.value = query.get('graphics'); gpuPreference.addEventListener('change', () => { @@ -51,17 +51,17 @@ graphicsQuality.addEventListener('change', () => { try { localStorage.setItem('0ad-graphics-quality', graphicsQuality.value); } catch { } }); -const GPU_CATEGORIES = { software: 'renderizado por software', integrated: 'GPU integrada', - entry: 'GPU dedicada de gama de entrada', capable: 'GPU con potencia suficiente', unknown: 'GPU no identificada' }; +const GPU_CATEGORIES = { software: 'программный рендеринг', integrated: 'встроенная видеокарта', + entry: 'видеокарта начального уровня', capable: 'производительная видеокарта', unknown: 'модель видеокарты неизвестна' }; function describeGraphics({ mode, profile, gpu }) { - const quality = profile === 'low' ? 'baja' : 'original'; - return mode === 'auto' ? `calidad gráfica automática: ${quality} (${GPU_CATEGORIES[gpu.category]})` - : `calidad gráfica: ${quality} (elegida)`; + const quality = profile === 'low' ? 'низкая' : 'исходная'; + return mode === 'auto' ? `автоматическая графика: ${quality} (${GPU_CATEGORIES[gpu.category]})` + : `графика: ${quality} (выбрана вручную)`; } const GPU_GUIDE_TITLES = { - dedicated: name => `El navegador está usando la gráfica integrada${name ? ` (${name})` : ''}. ` + - 'Si tu equipo tiene además una gráfica dedicada, así puedes hacer que la use.', - acceleration: () => 'El navegador está dibujando sin aceleración por hardware y el juego irá muy lento. Cómo activarla.' + dedicated: name => `Браузер использует встроенную видеокарту${name ? ` (${name})` : ''}. ` + + 'Если есть отдельная видеокарта, её можно выбрать в настройках системы.', + acceleration: () => 'Аппаратное ускорение отключено. Как его включить.' }; function showGPUGuide(gpu) { const os = detectOS(), guide = gpuGuide(gpu, os); @@ -146,7 +146,7 @@ let engineReady = false; function showLoading(message) { loading.hidden = false; loadingText.textContent = message; } function showDownload(bytes) { - const message = `Descargando recursos originales: ${(bytes / 1048576).toFixed(0)} MiB. Solo ocurre la primera vez o tras una actualización.`; + const message = `Загрузка игровых данных: ${(bytes / 1048576).toFixed(0)} MiB. Данные сохраняются в браузере.`; // Once the engine draws, later downloads (e.g. a match) must not cover it. if (engineReady) status.textContent = message; else showLoading(message); } @@ -201,7 +201,7 @@ return; } document.querySelector('#start').disabled = true; - showLoading('Preparando 0 A.D.…'); + showLoading('Подготовка 0 A.D.…'); gpuPreference.disabled = true; backendSelector.disabled = true; graphicsQuality.disabled = true; @@ -215,14 +215,14 @@ throw new Error('Este build requiere un navegador compatible con promesas WebAssembly.'); window.applicationFeatures=dataManifest.runtimeFeatures??{}; // Select the backend and its offline resources before binding the canvas. - const webgpu = backendSelector.value === 'webgpu'; + const webgpu = false; let shaderCatalog; if(webgpu) { const response = await fetch('webgpu-shaders.json'); if(!response.ok)throw new Error('Falta el paquete offline de shaders WebGPU.'); shaderCatalog = await response.json(); } - const rendererOptions={ canvas, backend: backendSelector.value, + const rendererOptions={ canvas, backend: 'webgl', requiredFeatures: webgpu ? ['texture-compression-bc'] : [], optionalFeatures: webgpu ? ['float32-filterable','float32-blendable','depth32float-stencil8','dual-source-blending','rg11b10ufloat-renderable'] : [], powerPreference: gpuPreference.value, report: event => record(JSON.stringify(event)) }; @@ -276,10 +276,10 @@ showGPUGuide(gpu); const adapterName = webgpu && `${diagnostics.adapter.vendor} ${diagnostics.adapter.architecture}`; const backendInfo = webgpu ? `WebGPU · ${gpu.renderer ? `${gpu.name} (${adapterName})` : adapterName}` : diagnostics.renderer - ? `WebGL 2 · GPU utilizada: ${diagnostics.renderer}` - : 'WebGL 2 · El navegador no permite identificar la GPU utilizada.'; + ? `WebGL 2 · Видеокарта: ${diagnostics.renderer}` + : 'WebGL 2 · Браузер не сообщает модель видеокарты.'; gpuInfo.textContent = `${backendInfo} · ${describeGraphics(window.graphicsProfile)}`; - gpuInfo.title = 'Para cambiar la preferencia de gráfica o la calidad, recarga la página antes de iniciar el juego. Los ajustes guardados en Opciones del juego tienen prioridad.'; + gpuInfo.title = 'Чтобы изменить графику, перезагрузите страницу до запуска игры. Настройки, сохранённые в игре, имеют приоритет.'; application = await createApplication({ canvas, webgpuBackend, @@ -311,7 +311,7 @@ fullscreenPointer.release(); window.applicationCleanup=Promise.all([webgpuBackend?.dispose(),archiveService?.dispose(),persistentConfig?.flush()]); window.applicationResult = { code }; - if (!deviceLost) status.textContent = `Juego cerrado (${code}).`; + if (!deviceLost) status.textContent = `Игра закрыта (${code}).`; document.querySelector('#fullscreen').disabled = true; document.querySelector('#close').disabled = true; // The engine's threads, WASM memory and canvas context cannot be @@ -328,13 +328,13 @@ window.application = application; document.querySelector('#fullscreen').disabled = false; document.querySelector('#close').disabled = false; - status.textContent = 'Inicializando los menús originales…'; + status.textContent = 'Загрузка меню игры…'; const readyStatus = setInterval(() => { if (window.applicationResult) { loading.hidden = true; clearInterval(readyStatus); return; } if (application.applicationState?.frame > 0) { loading.hidden = true; engineReady = true; - status.textContent = '0 A.D. en ejecución.'; + status.textContent = '0 A.D. запущена.'; clearInterval(readyStatus); } }, 250); @@ -348,7 +348,7 @@ // No context was created: changing the selection is safe without reload. document.querySelector('#start').disabled = false; gpuPreference.disabled = false; - backendSelector.disabled = false; + backendSelector.disabled = true; graphicsQuality.disabled = false; } } @@ -356,7 +356,7 @@ document.querySelector('#fullscreen').addEventListener('click', async () => { try { await fullscreenPointer.enter(); canvas.focus(); } - catch (error) { status.textContent = `No se pudo entrar en pantalla completa: ${error.message}`; } + catch (error) { status.textContent = `Не удалось открыть полноэкранный режим: ${error.message}`; } }); document.addEventListener('fullscreenchange', () => { if (!application || window.applicationResult) return;