diff options
author | Dudemanguy <random342@airmail.cc> | 2024-02-21 09:48:51 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-02-26 16:46:00 +0000 |
commit | c774b5f5173f8e43e2da0612437f7e3931df6acc (patch) | |
tree | cef61519cc579c658bf0b7594bf13d5391fbf1f2 | |
parent | b7fd232524bc213df91fa77ca0261ff514fad1e4 (diff) | |
download | mpv-c774b5f5173f8e43e2da0612437f7e3931df6acc.tar.bz2 mpv-c774b5f5173f8e43e2da0612437f7e3931df6acc.tar.xz |
player: rename --background to --background-color
This better represents what it actually does. --background will be used
for another, related option in the next commit.
-rw-r--r-- | DOCS/interface-changes.rst | 1 | ||||
-rw-r--r-- | DOCS/man/options.rst | 2 | ||||
-rw-r--r-- | video/out/gpu/video.c | 10 | ||||
-rw-r--r-- | video/out/gpu/video.h | 2 | ||||
-rw-r--r-- | video/out/vo_gpu_next.c | 8 |
5 files changed, 12 insertions, 11 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 99b1567fda..e9984f7ce5 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -57,6 +57,7 @@ Interface changes - move the `options` argument of the `loadfile` command from the third parameter to the fourth (after `index`) - add `--drag-and-drop=insert-next` option + - rename `--background` to `--background-color` --- mpv 0.37.0 --- - `--save-position-on-quit` and its associated commands now store state files in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index b861240976..e484b183ab 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -6946,7 +6946,7 @@ them. any advantages over normal textures. Note that hardware decoding overrides this flag. Could be removed any time. -``--background=<color>`` +``--background-color=<color>`` Color used to draw parts of the mpv window not covered by video. See the ``--sub-color`` option for how colors are defined. diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index c7bbbfd888..75eca4a314 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -313,7 +313,7 @@ static const struct gl_video_opts gl_video_opts_def = { .sigmoid_upscaling = true, .interpolation_threshold = 0.01, .alpha_mode = ALPHA_BLEND_TILES, - .background = {0, 0, 0, 255}, + .background_color = {0, 0, 0, 255}, .gamma = 1.0f, .tone_map = { .curve = TONE_MAPPING_AUTO, @@ -453,7 +453,7 @@ const struct m_sub_options gl_video_conf = { {"blend", ALPHA_BLEND}, {"blend-tiles", ALPHA_BLEND_TILES})}, {"opengl-rectangle-textures", OPT_BOOL(use_rectangle)}, - {"background", OPT_COLOR(background)}, + {"background-color", OPT_COLOR(background_color)}, {"interpolation", OPT_BOOL(interpolation)}, {"interpolation-threshold", OPT_FLOAT(interpolation_threshold)}, {"blend-subtitles", OPT_CHOICE(blend_subs, @@ -3088,7 +3088,7 @@ static void pass_draw_to_screen(struct gl_video *p, const struct ra_fbo *fbo, in GLSL(color.a = 1.0;) } else if (p->opts.alpha_mode == ALPHA_BLEND) { // Blend into background color (usually black) - struct m_color c = p->opts.background; + struct m_color c = p->opts.background_color; GLSLF("vec4 background = vec4(%f, %f, %f, %f);\n", c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0); GLSL(color.rgb += background.rgb * (1.0 - color.a);) @@ -3864,7 +3864,7 @@ static void check_gl_features(struct gl_video *p) .fbo_format = p->opts.fbo_format, .alpha_mode = p->opts.alpha_mode, .use_rectangle = p->opts.use_rectangle, - .background = p->opts.background, + .background_color = p->opts.background_color, .dither_algo = p->opts.dither_algo, .dither_depth = p->opts.dither_depth, .dither_size = p->opts.dither_size, @@ -4115,7 +4115,7 @@ static void reinit_from_options(struct gl_video *p) p->opts = *(struct gl_video_opts *)p->opts_cache->opts; if (!p->force_clear_color) - p->clear_color = p->opts.background; + p->clear_color = p->opts.background_color; check_gl_features(p); uninit_rendering(p); diff --git a/video/out/gpu/video.h b/video/out/gpu/video.h index 71d5b45302..672f80cf85 100644 --- a/video/out/gpu/video.h +++ b/video/out/gpu/video.h @@ -157,7 +157,7 @@ struct gl_video_opts { char *fbo_format; int alpha_mode; bool use_rectangle; - struct m_color background; + struct m_color background_color; bool interpolation; float interpolation_threshold; int blend_subs; diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 2922303b80..a4b92eb38d 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -2083,10 +2083,10 @@ static void update_render_options(struct vo *vo) pl_options pars = p->pars; const struct gl_video_opts *opts = p->opts_cache->opts; pars->params.antiringing_strength = opts->scaler[0].antiring; - pars->params.background_color[0] = opts->background.r / 255.0; - pars->params.background_color[1] = opts->background.g / 255.0; - pars->params.background_color[2] = opts->background.b / 255.0; - pars->params.background_transparency = 1.0 - opts->background.a / 255.0; + pars->params.background_color[0] = opts->background_color.r / 255.0; + pars->params.background_color[1] = opts->background_color.g / 255.0; + pars->params.background_color[2] = opts->background_color.b / 255.0; + pars->params.background_transparency = 1 - opts->background_color.a / 255.0; pars->params.skip_anti_aliasing = !opts->correct_downscaling; pars->params.disable_linear_scaling = !opts->linear_downscaling && !opts->linear_upscaling; pars->params.disable_fbos = opts->dumb_mode == 1; |