diff options
author | wiso <wiso@svn> | 2010-05-12 18:37:21 +0000 |
---|---|---|
committer | wiso <wiso@svn> | 2010-05-12 18:37:21 +0000 |
commit | f3479096738e39029a11f55dab275c5f8391f508 (patch) | |
tree | 140e8ccab5c87b17ea183379ab6326b8f5cbcb81 /lib | |
parent | 9c96135b76dae8421d2dc0df354ffcc0db4cd2c3 (diff) |
[WIN32] fixed compilation of new libass.dll and replaced the old project file within the XBMC main project.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30058 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libass/libass/ass_bitmap.c | 9 | ||||
-rw-r--r-- | lib/libass/libass/ass_drawing.c | 17 | ||||
-rw-r--r-- | lib/libass/libass/ass_font.c | 30 | ||||
-rw-r--r-- | lib/libass/libass/ass_parse.c | 4 | ||||
-rw-r--r-- | lib/libass/libass/ass_render.c | 35 | ||||
-rw-r--r-- | lib/libass/libass/ass_utils.h | 4 |
6 files changed, 59 insertions, 40 deletions
diff --git a/lib/libass/libass/ass_bitmap.c b/lib/libass/libass/ass_bitmap.c index c7c039ddd5..8302676c6c 100644 --- a/lib/libass/libass/ass_bitmap.c +++ b/lib/libass/libass/ass_bitmap.c @@ -469,10 +469,13 @@ int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur, int be, double blur_radius, FT_Vector shadow_offset, int border_style) { + int bord; + int bbord; + int gbord; blur_radius *= 2; - int bbord = be > 0 ? sqrt(2 * be) : 0; - int gbord = blur_radius > 0.0 ? blur_radius + 1 : 0; - int bord = FFMAX(bbord, gbord); + bbord = be > 0 ? sqrt(2 * be) : 0; + gbord = blur_radius > 0.0 ? blur_radius + 1 : 0; + bord = FFMAX(bbord, gbord); if (bord == 0 && (shadow_offset.x || shadow_offset.y)) bord = 1; diff --git a/lib/libass/libass/ass_drawing.c b/lib/libass/libass/ass_drawing.c index a3207c7c3b..e8857b3cea 100644 --- a/lib/libass/libass/ass_drawing.c +++ b/lib/libass/libass/ass_drawing.c @@ -276,27 +276,28 @@ static void drawing_evaluate_curve(ASS_Drawing *drawing, { double cx3, cx2, cx1, cx0, cy3, cy2, cy1, cy0; double t, h, max_accel, max_accel1, max_accel2; + int x0,y0,x1,y1,x2,y2,x3,y3; FT_Vector cur = {0, 0}; cur = token->point; translate_point(drawing, &cur); - int x0 = cur.x; - int y0 = cur.y; + x0 = cur.x; + y0 = cur.y; token = token->next; cur = token->point; translate_point(drawing, &cur); - int x1 = cur.x; - int y1 = cur.y; + x1 = cur.x; + y1 = cur.y; token = token->next; cur = token->point; translate_point(drawing, &cur); - int x2 = cur.x; - int y2 = cur.y; + x2 = cur.x; + y2 = cur.y; token = token->next; cur = token->point; translate_point(drawing, &cur); - int x3 = cur.x; - int y3 = cur.y; + x3 = cur.x; + y3 = cur.y; if (spline) { // 1 [-1 +3 -3 +1] diff --git a/lib/libass/libass/ass_font.c b/lib/libass/libass/ass_font.c index 7db1f076f7..448f46620f 100644 --- a/lib/libass/libass/ass_font.c +++ b/lib/libass/libass/ass_font.c @@ -296,6 +296,7 @@ static int ass_strike_outline_glyph(FT_Face face, ASS_Font *font, TT_OS2 *os2 = FT_Get_Sfnt_Table(face, ft_sfnt_os2); TT_Postscript *ps = FT_Get_Sfnt_Table(face, ft_sfnt_post); FT_Outline *ol = &((FT_OutlineGlyph) glyph)->outline; + FT_Vector points[4]; int bear, advance, y_scale, i, dir; if (!under && !through) @@ -330,12 +331,15 @@ static int ass_strike_outline_glyph(FT_Face face, ASS_Font *font, if (pos > 0 || size <= 0) return 1; - FT_Vector points[4] = { - {.x = bear, .y = pos + size}, - {.x = advance, .y = pos + size}, - {.x = advance, .y = pos - size}, - {.x = bear, .y = pos - size}, - }; + + points[0].x = bear; + points[0].y = pos + size; + points[1].x = advance; + points[1].y = pos + size; + points[2].x = advance; + points[2].y = pos - size; + points[3].x = bear; + points[3].y = pos - size; if (dir == FT_ORIENTATION_TRUETYPE) { for (i = 0; i < 4; i++) { @@ -360,12 +364,14 @@ static int ass_strike_outline_glyph(FT_Face face, ASS_Font *font, if (pos < 0 || size <= 0) return 1; - FT_Vector points[4] = { - {.x = bear, .y = pos + size}, - {.x = advance, .y = pos + size}, - {.x = advance, .y = pos - size}, - {.x = bear, .y = pos - size}, - }; + points[0].x = bear; + points[0].y = pos + size; + points[1].x = advance; + points[1].y = pos + size; + points[2].x = advance; + points[2].y = pos - size; + points[3].x = bear; + points[3].y = pos - size; if (dir == FT_ORIENTATION_TRUETYPE) { for (i = 0; i < 4; i++) { diff --git a/lib/libass/libass/ass_parse.c b/lib/libass/libass/ass_parse.c index e5d1b1699c..a378f73194 100644 --- a/lib/libass/libass/ass_parse.c +++ b/lib/libass/libass/ass_parse.c @@ -232,8 +232,8 @@ static char *parse_vector_clip(ASS_Renderer *render_priv, char *p) if (render_priv->settings.left_margin != 0 || render_priv->settings.top_margin != 0) { FT_Vector trans = { - .x = int_to_d6(render_priv->settings.left_margin), - .y = -int_to_d6(render_priv->settings.top_margin), + trans.x = int_to_d6(render_priv->settings.left_margin), + trans.y = -int_to_d6(render_priv->settings.top_margin), }; FT_Outline_Translate(&drawing->glyph->outline, trans.x, trans.y); } diff --git a/lib/libass/libass/ass_render.c b/lib/libass/libass/ass_render.c index 64e78a9d21..01028e3ece 100644 --- a/lib/libass/libass/ass_render.c +++ b/lib/libass/libass/ass_render.c @@ -329,11 +329,6 @@ static ASS_Image ** render_glyph(ASS_Renderer *render_priv, Bitmap *bm, int dst_x, int dst_y, uint32_t color, uint32_t color2, int brk, ASS_Image **tail) { - // Inverse clipping in use? - if (render_priv->state.clip_mode) - return render_glyph_i(render_priv, bm, dst_x, dst_y, color, color2, - brk, tail); - // brk is relative to dst_x // color = color left of brk // color2 = color right of brk @@ -342,6 +337,11 @@ render_glyph(ASS_Renderer *render_priv, Bitmap *bm, int dst_x, int dst_y, int tmp; ASS_Image *img; + // Inverse clipping in use? + if (render_priv->state.clip_mode) + return render_glyph_i(render_priv, bm, dst_x, dst_y, color, color2, + brk, tail); + dst_x += bm->left; dst_y += bm->top; brk -= bm->left; @@ -801,9 +801,10 @@ static void compute_string_bbox(TextInfo *info, DBBox *bbox) d6_to_double(info->glyphs[0].pos.y); for (i = 0; i < info->length; ++i) { + double s,e; if (info->glyphs[i].skip) continue; - double s = d6_to_double(info->glyphs[i].pos.x); - double e = s + d6_to_double(info->glyphs[i].advance.x); + s = d6_to_double(info->glyphs[i].pos.x); + e = s + d6_to_double(info->glyphs[i].advance.x); bbox->xMin = FFMIN(bbox->xMin, s); bbox->xMax = FFMAX(bbox->xMax, e); } @@ -902,9 +903,9 @@ static void free_render_context(ASS_Renderer *render_priv) static void get_contour_cbox(FT_BBox *box, FT_Vector *points, int start, int end) { + int i; box->xMin = box->yMin = INT_MAX; box->xMax = box->yMax = INT_MIN; - int i; for (i = start; i < end; i++) { box->xMin = (points[i].x < box->xMin) ? points[i].x : box->xMin; @@ -995,6 +996,7 @@ static void draw_opaque_box(ASS_Renderer *render_priv, uint32_t ch, * render_priv->font_scale_x; FT_OutlineGlyph og = (FT_OutlineGlyph) glyph; FT_Outline *ol; + FT_Vector points[4]; // to avoid gaps sx = FFMAX(64, sx); @@ -1019,12 +1021,14 @@ static void draw_opaque_box(ASS_Renderer *render_priv, uint32_t ch, desc *= scale_y; desc += asc * (scale_y - 1.0); - FT_Vector points[4] = { - { .x = -sx, .y = asc + sy }, - { .x = adv + sx, .y = asc + sy }, - { .x = adv + sx, .y = -desc - sy }, - { .x = -sx, .y = -desc - sy }, - }; + points[0].x = -sx; + points[0].y = asc + sy; + points[1].x = adv + sx; + points[1].y = asc + sy; + points[2].x = adv + sx; + points[2].y = -desc - sy; + points[3].x = -sx; + points[3].y = -desc - sy; FT_Outline_Done(render_priv->ftlibrary, &og->outline); FT_Outline_New(render_priv->ftlibrary, 4, 1, &og->outline); @@ -1525,9 +1529,10 @@ wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) for (i = 0; i < text_info->length; ++i) { cur = text_info->glyphs + i; if (cur->linebreak) { + double height; while (i < text_info->length && cur->skip && cur->symbol != '\n') cur = text_info->glyphs + ++i; - double height = + height = text_info->lines[cur_line - 1].desc + text_info->lines[cur_line].asc; cur_line++; diff --git a/lib/libass/libass/ass_utils.h b/lib/libass/libass/ass_utils.h index ad8574c1d6..8e5da38137 100644 --- a/lib/libass/libass/ass_utils.h +++ b/lib/libass/libass/ass_utils.h @@ -34,6 +34,10 @@ #include "ass.h" +#ifdef _WIN32 +#include "config.h" +#endif + #define MSGL_FATAL 0 #define MSGL_ERR 1 #define MSGL_WARN 2 |