From 6a6b58fa20e090d1548ee971ded3cdaa6ed5d251 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 16 Dec 2011 05:30:46 +0000 Subject: [PATCH] - turn off building freetype-gl unless enabled in cmake flags --- source/shared_lib/CMakeLists.txt | 15 +++++++-------- .../include/graphics/freetype-gl/edtaa3func.h | 4 +++- .../include/graphics/freetype-gl/font-manager.h | 4 ++++ .../include/graphics/freetype-gl/markup.h | 5 +++++ .../include/graphics/freetype-gl/texture-atlas.h | 5 +++++ .../include/graphics/freetype-gl/texture-font.h | 4 ++++ .../include/graphics/freetype-gl/texture-glyph.h | 5 +++++ .../include/graphics/freetype-gl/vector.h | 4 ++++ .../include/graphics/freetype-gl/vertex-buffer.h | 5 +++++ .../sources/graphics/freetype-gl/edtaa3func.c | 4 ++++ .../sources/graphics/freetype-gl/font-manager.c | 5 +++++ .../sources/graphics/freetype-gl/markup.c | 5 +++++ .../sources/graphics/freetype-gl/texture-atlas.c | 4 ++++ .../sources/graphics/freetype-gl/texture-font.c | 5 +++++ .../sources/graphics/freetype-gl/texture-glyph.c | 5 +++++ .../sources/graphics/freetype-gl/vector.c | 4 ++++ .../sources/graphics/freetype-gl/vertex-buffer.c | 5 +++++ 17 files changed, 79 insertions(+), 9 deletions(-) diff --git a/source/shared_lib/CMakeLists.txt b/source/shared_lib/CMakeLists.txt index 2260013bf..f22d9ae51 100644 --- a/source/shared_lib/CMakeLists.txt +++ b/source/shared_lib/CMakeLists.txt @@ -193,18 +193,17 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER OR BUILD_MEGAGLEST_MAP_EDITOR OR BUILD_MEGAGLEST ADD_DEFINITIONS(-DMINIUPNPC_VERSION_PRE1_6) ENDIF() - OPTION(USE_FREETYPEGL "Use Freetype-GL for on-screen fonts" ON) + OPTION(USE_FREETYPEGL "Use Freetype-GL for on-screen fonts" OFF) if(USE_FREETYPEGL) ADD_DEFINITIONS(-DUSE_FREETYPEGL) - - FIND_PACKAGE(Freetype REQUIRED) - INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_PATH}) - IF(UNIX) - SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${FREETYPE_LIBRARY}) - ENDIF() - endif(USE_FREETYPEGL) + FIND_PACKAGE(Freetype REQUIRED) + INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_PATH}) + IF(UNIX) + SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${FREETYPE_LIBRARY}) + ENDIF() + FIND_PACKAGE(GLEW REQUIRED) INCLUDE_DIRECTORIES(${GLEW_INCLUDE_PATH}) IF(UNIX) diff --git a/source/shared_lib/include/graphics/freetype-gl/edtaa3func.h b/source/shared_lib/include/graphics/freetype-gl/edtaa3func.h index bfe61ea2f..2c888bd58 100644 --- a/source/shared_lib/include/graphics/freetype-gl/edtaa3func.h +++ b/source/shared_lib/include/graphics/freetype-gl/edtaa3func.h @@ -56,7 +56,7 @@ * */ - +#ifdef USE_FREETYPEGL #include @@ -94,3 +94,5 @@ void edtaa3(double *img, double *gx, double *gy, int w, int h, short *distx, sho #ifdef __cplusplus } #endif + +#endif diff --git a/source/shared_lib/include/graphics/freetype-gl/font-manager.h b/source/shared_lib/include/graphics/freetype-gl/font-manager.h index 3e32765c4..1301749fb 100644 --- a/source/shared_lib/include/graphics/freetype-gl/font-manager.h +++ b/source/shared_lib/include/graphics/freetype-gl/font-manager.h @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #pragma once #ifndef __FONT_MANAGER_H__ #define __FONT_MANAGER_H__ @@ -129,3 +132,4 @@ typedef struct { #endif /* __FONT_MANAGER_H__ */ +#endif diff --git a/source/shared_lib/include/graphics/freetype-gl/markup.h b/source/shared_lib/include/graphics/freetype-gl/markup.h index 442880031..95c4f768c 100644 --- a/source/shared_lib/include/graphics/freetype-gl/markup.h +++ b/source/shared_lib/include/graphics/freetype-gl/markup.h @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #pragma once #ifndef __MARKUP_H__ #define __MARKUP_H__ @@ -126,3 +129,5 @@ void markup_set_strikethrough_color( Markup *self, #endif #endif /* __MARKUP_H__ */ + +#endif diff --git a/source/shared_lib/include/graphics/freetype-gl/texture-atlas.h b/source/shared_lib/include/graphics/freetype-gl/texture-atlas.h index 717a96b0a..cd5955d2b 100644 --- a/source/shared_lib/include/graphics/freetype-gl/texture-atlas.h +++ b/source/shared_lib/include/graphics/freetype-gl/texture-atlas.h @@ -40,6 +40,9 @@ http://clb.demon.fi/files/RectangleBinPack/ ========================================================================= */ + +#ifdef USE_FREETYPEGL + #pragma once #ifndef __TEXTURE_ATLAS_H__ #define __TEXTURE_ATLAS_H__ @@ -154,3 +157,5 @@ typedef struct #endif #endif /* __TEXTURE_ATLAS_H__ */ + +#endif diff --git a/source/shared_lib/include/graphics/freetype-gl/texture-font.h b/source/shared_lib/include/graphics/freetype-gl/texture-font.h index 8cc178c7b..51bb35002 100644 --- a/source/shared_lib/include/graphics/freetype-gl/texture-font.h +++ b/source/shared_lib/include/graphics/freetype-gl/texture-font.h @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #pragma once #ifndef __TEXTURE_FONT_H__ #define __TEXTURE_FONT_H__ @@ -118,3 +121,4 @@ typedef struct TextureFont_ TextureFont; #endif /* __TEXTURE_FONT_H__ */ +#endif diff --git a/source/shared_lib/include/graphics/freetype-gl/texture-glyph.h b/source/shared_lib/include/graphics/freetype-gl/texture-glyph.h index d293785ce..9654d8c50 100644 --- a/source/shared_lib/include/graphics/freetype-gl/texture-glyph.h +++ b/source/shared_lib/include/graphics/freetype-gl/texture-glyph.h @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #pragma once #ifndef __TEXTURE_GLYPH_H__ #define __TEXTURE_GLYPH_H__ @@ -129,3 +132,5 @@ typedef struct { #endif #endif /* __TEXTURE_GLYPH_H__ */ + +#endif diff --git a/source/shared_lib/include/graphics/freetype-gl/vector.h b/source/shared_lib/include/graphics/freetype-gl/vector.h index aafddccef..3012116f7 100644 --- a/source/shared_lib/include/graphics/freetype-gl/vector.h +++ b/source/shared_lib/include/graphics/freetype-gl/vector.h @@ -30,6 +30,8 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ +#ifdef USE_FREETYPEGL + #ifndef __VECTOR_H__ #define __VECTOR_H__ @@ -287,3 +289,5 @@ typedef struct #endif #endif /* __VECTOR_H__ */ + +#endif diff --git a/source/shared_lib/include/graphics/freetype-gl/vertex-buffer.h b/source/shared_lib/include/graphics/freetype-gl/vertex-buffer.h index a4ca6a854..9a5d5157c 100644 --- a/source/shared_lib/include/graphics/freetype-gl/vertex-buffer.h +++ b/source/shared_lib/include/graphics/freetype-gl/vertex-buffer.h @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #ifndef __VERTEX_BUFFER_H__ #define __VERTEX_BUFFER_H__ @@ -477,3 +480,5 @@ vertex_attribute_new( GLenum target, #endif /* __VERTEX_BUFFER_H__ */ + +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c b/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c index 3bec8688b..4dcdc8ab4 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c +++ b/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c @@ -55,6 +55,9 @@ * Updated in 2011 to avoid a corner case infinite loop. * */ + +#ifdef USE_FREETYPEGL + #include @@ -575,3 +578,4 @@ void edtaa3(double *img, double *gx, double *gy, int w, int h, short *distx, sho /* The transformation is completed. */ } +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/font-manager.c b/source/shared_lib/sources/graphics/freetype-gl/font-manager.c index d28fcbc34..6bfaec4c9 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/font-manager.c +++ b/source/shared_lib/sources/graphics/freetype-gl/font-manager.c @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #ifdef HAVE_FONTCONFIG #include #endif @@ -231,3 +234,5 @@ font_manager_set_cache( FontManager *self, } self->cache = wcsdup( cache ); } + +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/markup.c b/source/shared_lib/sources/graphics/freetype-gl/markup.c index 76cfb854b..44d0aa57e 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/markup.c +++ b/source/shared_lib/sources/graphics/freetype-gl/markup.c @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #include #include #include @@ -292,3 +295,5 @@ markup_set_strikethrough_color( Markup *self, const Color * color ) { } + +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/texture-atlas.c b/source/shared_lib/sources/graphics/freetype-gl/texture-atlas.c index 6f0eafbc7..bc74318bf 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/texture-atlas.c +++ b/source/shared_lib/sources/graphics/freetype-gl/texture-atlas.c @@ -31,6 +31,8 @@ * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ +#ifdef USE_FREETYPEGL + #ifdef WIN32 #include #endif @@ -343,3 +345,5 @@ texture_atlas_clear( TextureAtlas *self ) } } } + +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/texture-font.c b/source/shared_lib/sources/graphics/freetype-gl/texture-font.c index ac05fc877..2079488a7 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/texture-font.c +++ b/source/shared_lib/sources/graphics/freetype-gl/texture-font.c @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #include #include FT_FREETYPE_H // #include FT_ADVANCES_H @@ -434,3 +437,5 @@ texture_font_load_face( FT_Library * library, return 1; } + +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/texture-glyph.c b/source/shared_lib/sources/graphics/freetype-gl/texture-glyph.c index 93d19eb24..5f88948e8 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/texture-glyph.c +++ b/source/shared_lib/sources/graphics/freetype-gl/texture-glyph.c @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #if defined(_WIN32) #define WIN32_LEAN_AND_MEAN @@ -233,3 +236,5 @@ texture_glyph_get_kerning( TextureGlyph *self, } return 0; } + +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/vector.c b/source/shared_lib/sources/graphics/freetype-gl/vector.c index 9bd93e437..c9d4c79d5 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/vector.c +++ b/source/shared_lib/sources/graphics/freetype-gl/vector.c @@ -30,6 +30,8 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ +#ifdef USE_FREETYPEGL + #include #include #include @@ -404,3 +406,5 @@ vector_sort( Vector *self, assert( self->size ); qsort(self->items, self->size, self->item_size, cmp); } + +#endif diff --git a/source/shared_lib/sources/graphics/freetype-gl/vertex-buffer.c b/source/shared_lib/sources/graphics/freetype-gl/vertex-buffer.c index 1e69d18a5..8cdf4d008 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/vertex-buffer.c +++ b/source/shared_lib/sources/graphics/freetype-gl/vertex-buffer.c @@ -30,6 +30,9 @@ * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of Nicolas P. Rougier. * ========================================================================= */ + +#ifdef USE_FREETYPEGL + #include #include #include @@ -757,3 +760,5 @@ GL_TYPE_STRING( GLenum gtype ) default: return "GL_VOID"; } } + +#endif