diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-09-01 17:56:31 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-09-01 17:56:31 +0000 |
commit | acc7b7085fe3908fc230fd15e2f0c4cfefcfaedb (patch) | |
tree | 705c58b7fce131b7345932073761671de7433170 /libvo/sub.c | |
parent | 8d3a4273784f383298d0f43d673eb8d97986379c (diff) | |
download | mpv-acc7b7085fe3908fc230fd15e2f0c4cfefcfaedb.tar.bz2 mpv-acc7b7085fe3908fc230fd15e2f0c4cfefcfaedb.tar.xz |
small fixes, and Y check put back to avoid sig11
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1825 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/sub.c')
-rw-r--r-- | libvo/sub.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/libvo/sub.c b/libvo/sub.c index 5fe28abf4a..c9ee16d6e0 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -162,7 +162,10 @@ inline static void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,in while (l--){ t=vo_sub->text[i++]; len=strlen(t)-1; - + + printf("sub(%d) '%s'\n",len,t); +// if(len<0) memy -=h; // according to max of vo_font->pic_a[font]->h +// else for (j=0;j<=len;j++){ if ((c=t[j])>=0x80){ if (sub_unicode) @@ -184,11 +187,21 @@ inline static void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,in lastk=k; lastStripPosition=j; lastxsize=xsize; - } else if ((font=vo_font->font[c])>=0){ + } +#if 1 + else if ((font=vo_font->font[c])>=0){ if (vo_font->pic_a[font]->h > h){ h=vo_font->pic_a[font]->h; } } +#endif +#if 0 + else if ((font=vo_font->font[c])>=0){ + if ((memy-h)+vo_font->pic_a[font]->h > dys){ + h=vo_font->pic_a[font]->h; + } + } +#endif xsize+=vo_font->width[c]+vo_font->charspace; if (dxs<xsize){ if (lastStripPosition>0){ @@ -216,21 +229,24 @@ inline static void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,in lasth=h; h=vo_font->height; } + printf("h: %d -> %d \n",vo_font->height,h); memy -=h; // according to max of vo_font->pic_a[font]->h } } } y = memy; + +// printf("lines=%d y=%d\n",lines,y); i=j=0; l=lines; - while (l--){ + while (i<lines){ x= xtbl[i++]; while ((c=utbl[j++])){ - if ((font=vo_font->font[c])>=0) + if ((font=vo_font->font[c])>=0 && y<dys) draw_alpha(x,y, vo_font->width[c], - vo_font->pic_a[font]->h, + vo_font->pic_a[font]->h+y<dys ? vo_font->pic_a[font]->h : dys-y, vo_font->pic_b[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->w); |