Mercurial > mplayer.hg
comparison libvo/sub.c @ 1727:9da2b587b029
changes according to OSD calculations
author | atlka |
---|---|
date | Tue, 28 Aug 2001 14:22:37 +0000 |
parents | 38871427a131 |
children | 85dda3b18445 |
comparison
equal
deleted
inserted
replaced
1726:38871427a131 | 1727:9da2b587b029 |
---|---|
32 int vo_osd_progbar_type=-1; | 32 int vo_osd_progbar_type=-1; |
33 int vo_osd_progbar_value=100; // 0..256 | 33 int vo_osd_progbar_value=100; // 0..256 |
34 | 34 |
35 // if we have n=256 bars then OSD progbar looks like below | 35 // if we have n=256 bars then OSD progbar looks like below |
36 // | 36 // |
37 // 0 1 2 3 ... 256 <= vo_osd_progbar_value | 37 // 0 1 2 3 ... 256 <= vo_osd_progbar_value |
38 // | | | | | | 38 // | | | | | |
39 // [ === === === ... === ] | 39 // [ === === === ... === ] |
40 // | 40 // |
41 // the above schema is rescalled to n=elems bars | 41 // the above schema is rescalled to n=elems bars |
42 | 42 |
43 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)){ | 43 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)){ |
54 int elems=width/charw; | 54 int elems=width/charw; |
55 int x=(dxs-elems*charw-delimw)/2; | 55 int x=(dxs-elems*charw-delimw)/2; |
56 | 56 |
57 if (vo_osd_progbar_value<=0) | 57 if (vo_osd_progbar_value<=0) |
58 mark=0; | 58 mark=0; |
59 else { | 59 else if ((mark=(vo_osd_progbar_value*elems)>>8)>elems) |
60 int mm=vo_osd_progbar_value*elems; | 60 mark=elems; |
61 mark=mm>>8; | 61 |
62 if (mm & 0x00FF) mark++; | |
63 if (mark>elems) mark=elems; | |
64 } | |
65 // printf("osd.progbar width=%d xpos=%d\n",width,x); | 62 // printf("osd.progbar width=%d xpos=%d\n",width,x); |
66 | 63 |
67 c=vo_osd_progbar_type; | 64 c=vo_osd_progbar_type; |
68 if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0) { | 65 if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0) { |
69 int xp=x-vo_font->width[c]-vo_font->spacewidth; | 66 int xp=x-vo_font->width[c]-vo_font->spacewidth; |