diff --git a/source/shared_lib/CMakeLists.txt b/source/shared_lib/CMakeLists.txt index 2260013b..f22d9ae5 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 bfe61ea2..2c888bd5 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 3e32765c..1301749f 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 44288003..95c4f768 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 717a96b0..cd5955d2 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 8cc178c7..51bb3500 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 d293785c..9654d8c5 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 aafddcce..3012116f 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 a4ca6a85..9a5d5157 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 3bec8688..4dcdc8ab 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 d28fcbc3..6bfaec4c 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 76cfb854..44d0aa57 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 6f0eafbc..bc74318b 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 ac05fc87..2079488a 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 93d19eb2..5f88948e 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 9bd93e43..c9d4c79d 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 1e69d18a..8cdf4d00 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