Mercurial > mplayer.hg
comparison libvo/sub.c @ 1602:48f589cf639b
minor changes according to OSD
author | atlka |
---|---|
date | Tue, 21 Aug 2001 11:28:50 +0000 |
parents | 86a192179276 |
children | 38871427a131 |
comparison
equal
deleted
inserted
replaced
1601:cced86eff125 | 1602:48f589cf639b |
---|---|
31 | 31 |
32 int vo_osd_progbar_type=-1; | 32 int vo_osd_progbar_type=-1; |
33 int vo_osd_progbar_value=100; // 0..255 | 33 int vo_osd_progbar_value=100; // 0..255 |
34 | 34 |
35 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)){ | 35 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 int i; | 36 unsigned char *s; |
37 unsigned char *sa; | |
38 int i,w,h,st; | |
37 int y=(dys-vo_font->height)/2; | 39 int y=(dys-vo_font->height)/2; |
38 int c,font; | 40 int c,font; |
39 int delimw=vo_font->width[OSD_PB_START] | 41 int delimw=vo_font->width[OSD_PB_START] |
40 +vo_font->width[OSD_PB_END] | 42 +vo_font->width[OSD_PB_END] |
41 +vo_font->charspace; | 43 +vo_font->charspace; |
67 vo_font->pic_a[font]->bmp+vo_font->start[c], | 69 vo_font->pic_a[font]->bmp+vo_font->start[c], |
68 vo_font->pic_a[font]->w); | 70 vo_font->pic_a[font]->w); |
69 x+=vo_font->width[c]+vo_font->charspace; | 71 x+=vo_font->width[c]+vo_font->charspace; |
70 | 72 |
71 c=OSD_PB_0; | 73 c=OSD_PB_0; |
72 if ((font=vo_font->font[c])>=0) | 74 if ((font=vo_font->font[c])>=0){ |
75 w=vo_font->width[c]; | |
76 h=vo_font->pic_a[font]->h; | |
77 s=vo_font->pic_b[font]->bmp+vo_font->start[c]; | |
78 sa=vo_font->pic_a[font]->bmp+vo_font->start[c]; | |
79 st=vo_font->pic_a[font]->w; | |
73 for (i=mark;i--;){ | 80 for (i=mark;i--;){ |
74 draw_alpha(x,y, | 81 draw_alpha(x,y,w,h,s,sa,st); |
75 vo_font->width[c], | |
76 vo_font->pic_a[font]->h, | |
77 vo_font->pic_b[font]->bmp+vo_font->start[c], | |
78 vo_font->pic_a[font]->bmp+vo_font->start[c], | |
79 vo_font->pic_a[font]->w); | |
80 x+=charw; | 82 x+=charw; |
81 } | 83 } |
84 } | |
82 | 85 |
83 c=OSD_PB_1; | 86 c=OSD_PB_1; |
84 if ((font=vo_font->font[c])>=0) | 87 if ((font=vo_font->font[c])>=0){ |
88 w=vo_font->width[c]; | |
89 h=vo_font->pic_a[font]->h; | |
90 s =vo_font->pic_b[font]->bmp+vo_font->start[c]; | |
91 sa=vo_font->pic_a[font]->bmp+vo_font->start[c]; | |
92 st=vo_font->pic_a[font]->w; | |
85 for (i=elems-mark;i--;){ | 93 for (i=elems-mark;i--;){ |
86 draw_alpha(x,y, | 94 draw_alpha(x,y,w,h,s,sa,st); |
87 vo_font->width[c], | |
88 vo_font->pic_a[font]->h, | |
89 vo_font->pic_b[font]->bmp+vo_font->start[c], | |
90 vo_font->pic_a[font]->bmp+vo_font->start[c], | |
91 vo_font->pic_a[font]->w); | |
92 x+=charw; | 95 x+=charw; |
93 } | 96 } |
97 } | |
94 | 98 |
95 c=OSD_PB_END; | 99 c=OSD_PB_END; |
96 if ((font=vo_font->font[c])>=0) | 100 if ((font=vo_font->font[c])>=0) |
97 draw_alpha(x,y, | 101 draw_alpha(x,y, |
98 vo_font->width[c], | 102 vo_font->width[c], |
134 | 138 |
135 memsub=vo_sub; | 139 memsub=vo_sub; |
136 memdxs=dxs; | 140 memdxs=dxs; |
137 memdys=memy=dys; | 141 memdys=memy=dys; |
138 | 142 |
139 // too long lines divide into smaller ones | 143 // too long lines divide into a smaller ones |
140 i=k=lines=lasth=0; | 144 i=k=lines=lasth=0; |
141 h=vo_font->height; | 145 h=vo_font->height; |
142 xsize=-vo_font->charspace; | 146 xsize=-vo_font->charspace; |
143 lastStripPosition=-1; | 147 lastStripPosition=-1; |
144 l=vo_sub->lines; | 148 l=vo_sub->lines; |
185 while (t[j] && t[j]!=' ') j++; // jump to the nearest space | 189 while (t[j] && t[j]!=' ') j++; // jump to the nearest space |
186 } | 190 } |
187 } else if (j<len) | 191 } else if (j<len) |
188 continue; | 192 continue; |
189 if (h>memy){ // out of the screen so end parsing | 193 if (h>memy){ // out of the screen so end parsing |
190 memy +=vo_font->height-lasth; // correct y position | 194 memy +=vo_font->height-lasth; // correct the y position |
191 l=0; break; | 195 l=0; break; |
192 } | 196 } |
193 utbl[k++]=0; | 197 utbl[k++]=0; |
194 xtbl[lines++]=(dxs-xsize)/2; | 198 xtbl[lines++]=(dxs-xsize)/2; |
195 if (lines==MAX_UCSLINES||k>MAX_UCS){ | 199 if (lines==MAX_UCSLINES||k>MAX_UCS){ |
196 l=0; break; | 200 l=0; break; |
197 } else if(l || j<len){ // not last line or not last char | 201 } else if(l || j<len){ // not the last line or not the last char |
198 lastStripPosition=-1; | 202 lastStripPosition=-1; |
199 xsize=-vo_font->charspace; | 203 xsize=-vo_font->charspace; |
200 lasth=h; | 204 lasth=h; |
201 h=vo_font->height; | 205 h=vo_font->height; |
202 } | 206 } |