History

sub/osd_libass: simplify osd bar variable names

nanahi committed 2 years ago

Commit 354ad7f1 parent 8612f801 file · +11 −9Browse files

Unified · Split

sub/osd_libass.c+11−9
@@ -363,6 +363,7 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj, · 362 unmodified lines
363363 float *o_border)
364364 {
365365 struct mp_osd_render_opts *opts = osd->opts;
366+ struct osd_bar_style_opts *bar_opts = opts->osd_bar_style;
366367
367368 create_ass_track(osd, obj, &obj->ass);
368369 ASS_Track *track = obj->ass.track;
@@ -380,10 +381,10 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj, · 11 unmodified lines
380381 // and each bar ass event gets its own opaque box - breaking the bar.
381382 style->BorderStyle = 1; // outline
382383
383− *o_w = track->PlayResX * (opts->osd_bar_style->w / 100.0);
384− *o_h = track->PlayResY * (opts->osd_bar_style->h / 100.0);
384+ *o_w = track->PlayResX * (bar_opts->w / 100.0);
385+ *o_h = track->PlayResY * (bar_opts->h / 100.0);
385386
386− style->Outline = opts->osd_bar_style->outline_size;
387+ style->Outline = bar_opts->outline_size;
387388 // Rendering with shadow is broken (because there's more than one shape)
388389 style->Shadow = 0;
389390 style->Blur = 0;
@@ -392,8 +393,8 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj, · 2 unmodified lines
392393
393394 *o_border = style->Outline;
394395
395− *o_x = get_align(opts->osd_bar_style->align_x, track->PlayResX, *o_w, *o_border);
396− *o_y = get_align(opts->osd_bar_style->align_y, track->PlayResY, *o_h, *o_border);
396+ *o_x = get_align(bar_opts->align_x, track->PlayResX, *o_w, *o_border);
397+ *o_y = get_align(bar_opts->align_y, track->PlayResY, *o_h, *o_border);
397398 }
398399
399400 static void update_progbar(struct osd_state *osd, struct osd_object *obj)
@@ -469,14 +470,15 @@ static void update_progbar(struct osd_state *osd, struct osd_object *obj) · 69 unmodified lines
469470 // the "hole"
470471 ass_draw_rect_ccw(d, 0, 0, width, height);
471472
473+ struct osd_bar_style_opts *bar_opts = osd->opts->osd_bar_style;
472474 // chapter marks
473− if (osd->opts->osd_bar_style->marker_style) {
475+ if (bar_opts->marker_style) {
474476 for (int n = 0; n < obj->progbar_state.num_stops; n++) {
475477 float s = obj->progbar_state.stops[n] * width;
476− float size = MPMAX(border * osd->opts->osd_bar_style->marker_scale,
477− osd->opts->osd_bar_style->marker_min_size);
478+ float size = MPMAX(border * bar_opts->marker_scale,
479+ bar_opts->marker_min_size);
478480
479− if (osd->opts->osd_bar_style->marker_style == 2 &&
481+ if (bar_opts->marker_style == 2 &&
480482 s > size / 2 && s < width - size / 2)
481483 { // line
482484 ass_draw_rect_cw(d, s - size / 2, 0, s + size / 2, height);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t