diff options
author | wiso <wiso@svn> | 2010-08-17 17:38:43 +0000 |
---|---|---|
committer | wiso <wiso@svn> | 2010-08-17 17:38:43 +0000 |
commit | 05f3779275bca3aa1390159378da856faea89e47 (patch) | |
tree | 5945912c3767d9a460605d164d0ce5979bc7da06 /lib | |
parent | e668e2e3b466a62209e3730d1ba36349d6330dfd (diff) |
[WIN32] fixed libass compilation
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@32867 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libass/libass/ass.c | 2 | ||||
-rw-r--r-- | lib/libass/libass/ass_font.c | 27 | ||||
-rw-r--r-- | lib/libass/libass/ass_fontconfig.c | 2 | ||||
-rw-r--r-- | lib/libass/libass/ass_render.c | 11 | ||||
-rw-r--r-- | lib/libass/libass/ass_utils.c | 10 | ||||
-rw-r--r-- | lib/libass/xbmc/libass_win32/libass_win32_vs2008.vcproj | 4 |
6 files changed, 40 insertions, 16 deletions
diff --git a/lib/libass/libass/ass.c b/lib/libass/libass/ass.c index cc66e1a1f9..26502b74d5 100644 --- a/lib/libass/libass/ass.c +++ b/lib/libass/libass/ass.c @@ -23,7 +23,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#ifndef _WIN32 #include <strings.h> +#endif #include <assert.h> #include <errno.h> #include <sys/types.h> diff --git a/lib/libass/libass/ass_font.c b/lib/libass/libass/ass_font.c index edf1e23024..7134d88400 100644 --- a/lib/libass/libass/ass_font.c +++ b/lib/libass/libass/ass_font.c @@ -27,7 +27,9 @@ #include FT_GLYPH_H #include FT_TRUETYPE_TABLES_H #include FT_OUTLINE_H +#ifndef _WIN32 #include <strings.h> +#endif #include "ass.h" #include "ass_library.h" @@ -426,6 +428,8 @@ FT_Glyph ass_font_get_glyph(void *fontconfig_priv, ASS_Font *font, FT_Face face = 0; int flags = 0; int vertical = font->desc.vertical; + FT_Matrix scale; + FT_Outline *outl; if (ch < 0x20) return 0; @@ -454,9 +458,10 @@ FT_Glyph ass_font_get_glyph(void *fontconfig_priv, ASS_Font *font, face = font->faces[face_idx]; index = FT_Get_Char_Index(face, ch); if (index == 0 && face->num_charmaps > 0) { + FT_CharMap cur; ass_msg(font->library, MSGL_WARN, "Glyph 0x%X not found, falling back to first charmap", ch); - FT_CharMap cur = face->charmap; + cur = face->charmap; FT_Set_Charmap(face, face->charmaps[0]); index = FT_Get_Char_Index(face, ch); FT_Set_Charmap(face, cur); @@ -520,9 +525,12 @@ FT_Glyph ass_font_get_glyph(void *fontconfig_priv, ASS_Font *font, } // Apply scaling and shift - FT_Matrix scale = { double_to_d16(font->scale_x), 0, 0, - double_to_d16(font->scale_y) }; - FT_Outline *outl = &((FT_OutlineGlyph) glyph)->outline; + scale.xx = double_to_d16(font->scale_x); + scale.xy = 0; + scale.yx = 0; + scale.yy = double_to_d16(font->scale_y); + + outl = &((FT_OutlineGlyph) glyph)->outline; FT_Outline_Transform(outl, &scale); FT_Outline_Translate(outl, font->v.x, font->v.y); glyph->advance.x *= font->scale_x; @@ -578,9 +586,9 @@ void ass_font_free(ASS_Font *font) 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; @@ -639,9 +647,10 @@ void fix_freetype_stroker(FT_OutlineGlyph glyph, int border_x, int border_y) // or contained in another contour end = -1; for (i = 0; i < nc; i++) { + int dir; start = end + 1; end = glyph->outline.contours[i]; - int dir = get_contour_direction(glyph->outline.points, start, end); + dir = get_contour_direction(glyph->outline.points, start, end); valid_cont[i] = 1; if (dir == inside_direction) { for (j = 0; j < nc; j++) { @@ -669,9 +678,11 @@ void fix_freetype_stroker(FT_OutlineGlyph glyph, int border_x, int border_y) check_inside: if (dir == inside_direction) { FT_BBox box; + int width; + int height; get_contour_cbox(&box, glyph->outline.points, start, end); - int width = box.xMax - box.xMin; - int height = box.yMax - box.yMin; + width = box.xMax - box.xMin; + height = box.yMax - box.yMin; if (width < border_x * 2 || height < border_y * 2) { valid_cont[i] = 0; modified = 1; diff --git a/lib/libass/libass/ass_fontconfig.c b/lib/libass/libass/ass_fontconfig.c index 031f4fac85..f916bafff0 100644 --- a/lib/libass/libass/ass_fontconfig.c +++ b/lib/libass/libass/ass_fontconfig.c @@ -24,7 +24,9 @@ #include <stdio.h> #include <assert.h> #include <string.h> +#ifndef _WIN32 #include <strings.h> +#endif #include <sys/types.h> #include <sys/stat.h> #include <inttypes.h> diff --git a/lib/libass/libass/ass_render.c b/lib/libass/libass/ass_render.c index ecaa4fce52..ced1989548 100644 --- a/lib/libass/libass/ass_render.c +++ b/lib/libass/libass/ass_render.c @@ -601,8 +601,8 @@ static void blend_vector_clip(ASS_Renderer *render_priv, 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); @@ -1255,6 +1255,7 @@ get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info) && !info->skip) { FT_Glyph glyph; FT_Glyph outline; + FT_Matrix m; double scale_x = render_priv->font_scale_x; FT_Glyph_Copy(info->glyph, &glyph); @@ -1271,8 +1272,10 @@ get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info) fay_scaled, render_priv->font_scale, info->asc); // PAR correction scaling - FT_Matrix m = { double_to_d16(scale_x), 0, - 0, double_to_d16(1.0) }; + m.xx = double_to_d16(scale_x); + m.xy = 0; + m.yx = 0; + m.yy = double_to_d16(1.0); // subpixel shift if (glyph) { diff --git a/lib/libass/libass/ass_utils.c b/lib/libass/libass/ass_utils.c index 880b4d17af..b4dc8acab1 100644 --- a/lib/libass/libass/ass_utils.c +++ b/lib/libass/libass/ass_utils.c @@ -25,17 +25,19 @@ #include <inttypes.h> #include <ft2build.h> #include FT_GLYPH_H +#ifndef _WIN32 #include <strings.h> +#endif #include "ass_library.h" #include "ass.h" #include "ass_utils.h" #ifdef _WIN32 -FILE *fopen_utf8(const char *_Filename, const char *_Mode)
-{
- return fopen(_Filename, _Mode);
-}
+FILE *fopen_utf8(const char *_Filename, const char *_Mode) +{ + return fopen(_Filename, _Mode); +} #endif int mystrtoi(char **p, int *res) diff --git a/lib/libass/xbmc/libass_win32/libass_win32_vs2008.vcproj b/lib/libass/xbmc/libass_win32/libass_win32_vs2008.vcproj index fa2836ddce..37bd42ab2c 100644 --- a/lib/libass/xbmc/libass_win32/libass_win32_vs2008.vcproj +++ b/lib/libass/xbmc/libass_win32/libass_win32_vs2008.vcproj @@ -280,6 +280,10 @@ >
</File>
<File
+ RelativePath="..\..\libass\ass_render_api.c"
+ >
+ </File>
+ <File
RelativePath="..\..\libass\ass_strtod.c"
>
</File>
|