From 8c330bb82587aa2bee1b8b6ecb12e3fc55c45279 Mon Sep 17 00:00:00 2001 From: xfangfang <2553041586@qq.com> Date: Fri, 8 Dec 2023 00:28:29 +0800 Subject: [PATCH] Hide option for non-gl device --- scripts/shaders/old_tv.glsl | 26 ------------------- .../fragment/player_danmaku_setting.cpp | 6 ++--- 2 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 scripts/shaders/old_tv.glsl diff --git a/scripts/shaders/old_tv.glsl b/scripts/shaders/old_tv.glsl deleted file mode 100644 index 0eccbd2f..00000000 --- a/scripts/shaders/old_tv.glsl +++ /dev/null @@ -1,26 +0,0 @@ -// old_tv.glsl - -uniform sampler2D tex; -uniform float time; -uniform vec2 resolution; - -void main() { - vec2 uv = gl_FragCoord.xy / resolution.xy; - vec3 color = texture2D(tex, uv).rgb; - - // Add some noise - float noise = (fract(sin(dot(gl_FragCoord.xy + time, vec2(12.9898, 78.233))) * 43758.5453) - 0.5; - color += noise * 0.1; - - // Simulate scanlines - if (mod(gl_FragCoord.y, 2.0) < 1.0) { - color *= 0.9; - } - - // Simulate CRT curvature - uv = 2.0 * uv - 1.0; - float r = length(uv); - color *= 1.0 - 0.1 * r * r; - - gl_FragColor = vec4(color, 1.0); -} diff --git a/wiliwili/source/fragment/player_danmaku_setting.cpp b/wiliwili/source/fragment/player_danmaku_setting.cpp index 25b161fa..159d00c5 100644 --- a/wiliwili/source/fragment/player_danmaku_setting.cpp +++ b/wiliwili/source/fragment/player_danmaku_setting.cpp @@ -34,15 +34,15 @@ PlayerDanmakuSetting::PlayerDanmakuSetting() { auto& conf = ProgramConfig::instance(); -#ifdef __PSV__ - this->cellMask->setVisibility(brls::Visibility::GONE); -#else +#if defined(BOREALIS_USE_OPENGL) && !defined(__PSV__) this->cellMask->init("wiliwili/player/danmaku/filter/mask"_i18n, DanmakuCore::DANMAKU_SMART_MASK, [](bool data) { DanmakuCore::DANMAKU_SMART_MASK = data; DanmakuCore::save(); return true; }); +#else + this->cellMask->setVisibility(brls::Visibility::GONE); #endif this->cellTop->init("wiliwili/player/danmaku/filter/top"_i18n, DanmakuCore::DANMAKU_FILTER_SHOW_TOP, [](bool data) {