comparison libvo/sub.c @ 1548:eee7951a23af

changes according to proper subfont bar positioning and char spaceing - sub.c changes to scale from 0.100 to 0..255 for proper OSD displaying - mplayer.c
author atlka
date Thu, 16 Aug 2001 09:25:32 +0000
parents 1c8f80aeecdb
children 787c053b314c
comparison
equal deleted inserted replaced
1547:4b0046db8e64 1548:eee7951a23af
36 inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ 36 inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
37 int i; 37 int i;
38 int y=(dys-vo_font->height)/2; 38 int y=(dys-vo_font->height)/2;
39 int x; 39 int x;
40 int c,font; 40 int c,font;
41 int width=(dxs*2/3-vo_font->width[0x10]-vo_font->width[0x12]); 41 int charw=vo_font->width[OSD_PB_0]+vo_font->charspace;
42 int elems=width/vo_font->width[0x11]; 42 int delimw=vo_font->width[OSD_PB_START]
43 +vo_font->width[OSD_PB_END]
44 +vo_font->charspace;
45 int width=(2*dxs-3*delimw)/3;
46 int elems=width/charw;
43 int mark=(vo_osd_progbar_value*(elems+1))>>8; 47 int mark=(vo_osd_progbar_value*(elems+1))>>8;
44 x=(dxs-width)/2; 48 x=(dxs-elems*charw-delimw)/2;
49
45 // printf("osd.progbar width=%d xpos=%d\n",width,x); 50 // printf("osd.progbar width=%d xpos=%d\n",width,x);
46 51
47 c=vo_osd_progbar_type; 52 c=vo_osd_progbar_type;
48 if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0) 53 if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0)
49 draw_alpha(x-vo_font->width[c]-vo_font->spacewidth,y, 54 draw_alpha(x-vo_font->width[c]-vo_font->spacewidth,y,
59 vo_font->width[c], 64 vo_font->width[c],
60 vo_font->pic_a[font]->h, 65 vo_font->pic_a[font]->h,
61 vo_font->pic_b[font]->bmp+vo_font->start[c], 66 vo_font->pic_b[font]->bmp+vo_font->start[c],
62 vo_font->pic_a[font]->bmp+vo_font->start[c], 67 vo_font->pic_a[font]->bmp+vo_font->start[c],
63 vo_font->pic_a[font]->w); 68 vo_font->pic_a[font]->w);
64 x+=vo_font->width[c]; 69 x+=vo_font->width[c]+vo_font->charspace;
65 70
66 c=OSD_PB_0; 71 c=OSD_PB_0;
67 if ((font=vo_font->font[c])>=0) 72 if ((font=vo_font->font[c])>=0)
68 for (i=mark;i--;){ 73 for (i=mark;i--;){
69 draw_alpha(x,y, 74 draw_alpha(x,y,
70 vo_font->width[c], 75 vo_font->width[c],
71 vo_font->pic_a[font]->h, 76 vo_font->pic_a[font]->h,
72 vo_font->pic_b[font]->bmp+vo_font->start[c], 77 vo_font->pic_b[font]->bmp+vo_font->start[c],
73 vo_font->pic_a[font]->bmp+vo_font->start[c], 78 vo_font->pic_a[font]->bmp+vo_font->start[c],
74 vo_font->pic_a[font]->w); 79 vo_font->pic_a[font]->w);
75 x+=vo_font->width[c]; 80 x+=charw;
76 } 81 }
77 82
78 c=OSD_PB_1; 83 c=OSD_PB_1;
79 if ((font=vo_font->font[c])>=0) 84 if ((font=vo_font->font[c])>=0)
80 for (i=elems-mark;i--;){ 85 for (i=elems-mark;i--;){
82 vo_font->width[c], 87 vo_font->width[c],
83 vo_font->pic_a[font]->h, 88 vo_font->pic_a[font]->h,
84 vo_font->pic_b[font]->bmp+vo_font->start[c], 89 vo_font->pic_b[font]->bmp+vo_font->start[c],
85 vo_font->pic_a[font]->bmp+vo_font->start[c], 90 vo_font->pic_a[font]->bmp+vo_font->start[c],
86 vo_font->pic_a[font]->w); 91 vo_font->pic_a[font]->w);
87 x+=vo_font->width[c]; 92 x+=charw;
88 } 93 }
89 94
90 c=OSD_PB_END; 95 c=OSD_PB_END;
91 if ((font=vo_font->font[c])>=0) 96 if ((font=vo_font->font[c])>=0)
92 draw_alpha(x,y, 97 draw_alpha(x,y,
93 vo_font->width[c], 98 vo_font->width[c],
94 vo_font->pic_a[font]->h, 99 vo_font->pic_a[font]->h,
95 vo_font->pic_b[font]->bmp+vo_font->start[c], 100 vo_font->pic_b[font]->bmp+vo_font->start[c],
96 vo_font->pic_a[font]->bmp+vo_font->start[c], 101 vo_font->pic_a[font]->bmp+vo_font->start[c],
97 vo_font->pic_a[font]->w); 102 vo_font->pic_a[font]->w);
98 // x+=vo_font->width[c]; 103 // x+=vo_font->width[c]+vo_font->charspace;
99 104
100 105
101 // vo_osd_progbar_value=(vo_osd_progbar_value+1)&0xFF; 106 // vo_osd_progbar_value=(vo_osd_progbar_value+1)&0xFF;
102 107
103 } 108 }