comparison libvo/sub.c @ 1569:fcbfc99cf8e6

skip lines with negative y position if there is too many lines to display
author atlka
date Fri, 17 Aug 2001 08:47:58 +0000
parents 787c053b314c
children c394d04d6b30
comparison
equal deleted inserted replaced
1568:2d4904c16667 1569:fcbfc99cf8e6
46 int mark=(vo_osd_progbar_value*(elems+1))>>8; 46 int mark=(vo_osd_progbar_value*(elems+1))>>8;
47 47
48 // printf("osd.progbar width=%d xpos=%d\n",width,x); 48 // printf("osd.progbar width=%d xpos=%d\n",width,x);
49 49
50 c=vo_osd_progbar_type; 50 c=vo_osd_progbar_type;
51 if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0) 51 if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0) {
52 draw_alpha(x-vo_font->width[c]-vo_font->spacewidth,y, 52 int xp=x-vo_font->width[c]-vo_font->spacewidth;
53 vo_font->width[c], 53 draw_alpha((xp<0?0:xp),y,
54 vo_font->pic_a[font]->h, 54 vo_font->width[c],
55 vo_font->pic_b[font]->bmp+vo_font->start[c], 55 vo_font->pic_a[font]->h,
56 vo_font->pic_a[font]->bmp+vo_font->start[c], 56 vo_font->pic_b[font]->bmp+vo_font->start[c],
57 vo_font->pic_a[font]->w); 57 vo_font->pic_a[font]->bmp+vo_font->start[c],
58 58 vo_font->pic_a[font]->w);
59 }
60
59 c=OSD_PB_START; 61 c=OSD_PB_START;
60 if ((font=vo_font->font[c])>=0) 62 if ((font=vo_font->font[c])>=0)
61 draw_alpha(x,y, 63 draw_alpha(x,y,
62 vo_font->width[c], 64 vo_font->width[c],
63 vo_font->pic_a[font]->h, 65 vo_font->pic_a[font]->h,
195 197
196 y = memy; 198 y = memy;
197 199
198 k=i=0; l=lines; 200 k=i=0; l=lines;
199 while (l--){ 201 while (l--){
200 x = xtbl[i++]; 202 if (y>=0){
201 if(y<dys) 203 x= xtbl[i++];
202 while ((c=utbl[k++])){ 204 while ((c=utbl[k++])){
203 if (x>=0 && x+vo_font->width[c]<=dxs) 205 if (x>=0 && x+vo_font->width[c]<=dxs)
204 if ((font=vo_font->font[c])>=0) 206 if ((font=vo_font->font[c])>=0)
205 draw_alpha(x,y, 207 draw_alpha(x,y,
206 vo_font->width[c], 208 vo_font->width[c],
207 // vo_font->pic_a[font]->h, 209 // vo_font->pic_a[font]->h,
208 (y+vo_font->pic_a[font]->h<=dys)?vo_font->pic_a[font]->h:dys-y, 210 (y+vo_font->pic_a[font]->h<=dys)?vo_font->pic_a[font]->h:dys-y,
209 vo_font->pic_b[font]->bmp+vo_font->start[c], 211 vo_font->pic_b[font]->bmp+vo_font->start[c],
210 vo_font->pic_a[font]->bmp+vo_font->start[c], 212 vo_font->pic_a[font]->bmp+vo_font->start[c],
211 vo_font->pic_a[font]->w); 213 vo_font->pic_a[font]->w);
212 x+=vo_font->width[c]+vo_font->charspace; 214 x+=vo_font->width[c]+vo_font->charspace;
213 } 215 }
214 y+=vo_font->height; 216 } else {
217 while (utbl[k++]) ; // skip lines with negative y value
218 i++; // seldom case but who know ;-)
219 }
220 y+=vo_font->height;
215 } 221 }
216 } 222 }
223
224
217 225
218 static int draw_alpha_init_flag=0; 226 static int draw_alpha_init_flag=0;
219 227
220 extern void vo_draw_alpha_init(); 228 extern void vo_draw_alpha_init();
221 229