diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-20 17:18:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-20 17:18:34 +0200 |
commit | 16938adfc00b3c56a7b08a9eb97160b68902bae6 (patch) | |
tree | 6e818b95c8557872e39f23c00f5a60e09f2f11bc | |
parent | 318106223fc7351bd879980c17ee9c4bee65a272 (diff) | |
download | minetest-16938adfc00b3c56a7b08a9eb97160b68902bae6.tar.gz minetest-16938adfc00b3c56a7b08a9eb97160b68902bae6.tar.bz2 minetest-16938adfc00b3c56a7b08a9eb97160b68902bae6.zip |
Merge cguittfont lib in irrlicht change folder. (#6016)
* Merge cguittfont lib in irrlicht change folder.
This remove hack and static lib for FreeType
-rw-r--r-- | src/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/cguittfont/CMakeLists.txt | 30 | ||||
-rw-r--r-- | src/cguittfont/xCGUITTFont.cpp | 5 | ||||
-rw-r--r-- | src/cguittfont/xCGUITTFont.h | 7 | ||||
-rw-r--r-- | src/fontengine.cpp | 2 | ||||
-rw-r--r-- | src/guiChatConsole.cpp | 2 | ||||
-rw-r--r-- | src/irrlicht_changes/CGUITTFont.cpp (renamed from src/cguittfont/CGUITTFont.cpp) | 0 | ||||
-rw-r--r-- | src/irrlicht_changes/CGUITTFont.h (renamed from src/cguittfont/CGUITTFont.h) | 3 | ||||
-rw-r--r-- | src/irrlicht_changes/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/irrlicht_changes/irrUString.h (renamed from src/cguittfont/irrUString.h) | 2 | ||||
-rw-r--r-- | src/irrlicht_changes/static_text.cpp | 7 | ||||
-rw-r--r-- | util/travis/clang-format-whitelist.txt | 7 |
12 files changed, 21 insertions, 67 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ad5639a48..9e53b0e2c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -151,8 +151,6 @@ if(ENABLE_FREETYPE) if(FREETYPE_FOUND) message(STATUS "Freetype enabled.") set(USE_FREETYPE TRUE) - set(CGUITTFONT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cguittfont") - set(CGUITTFONT_LIBRARY cguittfont) endif() endif(ENABLE_FREETYPE) @@ -560,7 +558,7 @@ include_directories( if(USE_FREETYPE) - include_directories(${FREETYPE_INCLUDE_DIRS} ${CGUITTFONT_INCLUDE_DIR}) + include_directories(${FREETYPE_INCLUDE_DIRS}) endif() if(USE_CURL) @@ -619,7 +617,6 @@ if(BUILD_CLIENT) target_link_libraries( ${PROJECT_NAME} ${FREETYPE_LIBRARY} - ${CGUITTFONT_LIBRARY} ) endif() if (USE_CURSES) @@ -878,10 +875,3 @@ if (USE_GETTEXT) add_custom_target(translations ALL COMMENT "mo update" DEPENDS ${MO_FILES}) endif() - - -# Subdirectories - -if (BUILD_CLIENT AND USE_FREETYPE) - add_subdirectory(cguittfont) -endif() diff --git a/src/cguittfont/CMakeLists.txt b/src/cguittfont/CMakeLists.txt deleted file mode 100644 index 6cd35f310..000000000 --- a/src/cguittfont/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# CGUITTFont authors, y u no include headers you use? -# Do not add CGUITTFont.cpp to the line below. -# xCGUITTFont.cpp is a wrapper file that includes -# additional required headers. -add_library(cguittfont STATIC xCGUITTFont.cpp) - -if(FREETYPE_PKGCONFIG_FOUND) - set_target_properties(cguittfont - PROPERTIES - COMPILE_FLAGS "${FREETYPE_CFLAGS_STR}" - LINK_FLAGS "${FREETYPE_LDFLAGS_STR}" - ) - - include_directories( - ${IRRLICHT_INCLUDE_DIR} - ) -else(FREETYPE_PKGCONFIG_FOUND) - include_directories( - ${IRRLICHT_INCLUDE_DIR} - ${FREETYPE_INCLUDE_DIRS} - ) -endif(FREETYPE_PKGCONFIG_FOUND) - -target_link_libraries( - cguittfont - ${IRRLICHT_LIBRARY} - ${FREETYPE_LIBRARY} - ${ZLIB_LIBRARIES} # needed by freetype, repeated here for safety - ) - diff --git a/src/cguittfont/xCGUITTFont.cpp b/src/cguittfont/xCGUITTFont.cpp deleted file mode 100644 index c51922e4c..000000000 --- a/src/cguittfont/xCGUITTFont.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// A wrapper source file to avoid hack with gcc and modifying -// the CGUITTFont files. - -#include "xCGUITTFont.h" -#include "CGUITTFont.cpp" diff --git a/src/cguittfont/xCGUITTFont.h b/src/cguittfont/xCGUITTFont.h deleted file mode 100644 index c3efe7f6f..000000000 --- a/src/cguittfont/xCGUITTFont.h +++ /dev/null @@ -1,7 +0,0 @@ -// A wrapper header to avoid hack with gcc and modifying -// the CGUITTFont files. - -#include <algorithm> -#include <stddef.h> -#include "irrUString.h" -#include "CGUITTFont.h" diff --git a/src/fontengine.cpp b/src/fontengine.cpp index 2c277a04e..536828ede 100644 --- a/src/fontengine.cpp +++ b/src/fontengine.cpp @@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #if USE_FREETYPE #include "gettext.h" -#include "xCGUITTFont.h" +#include "irrlicht_changes/CGUITTFont.h" #endif /** maximum size distance for getting a "similar" font size */ diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp index ecd280f5e..7e90bf43a 100644 --- a/src/guiChatConsole.cpp +++ b/src/guiChatConsole.cpp @@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <string> #if USE_FREETYPE - #include "xCGUITTFont.h" + #include "irrlicht_changes/CGUITTFont.h" #endif inline u32 clamp_u8(s32 value) diff --git a/src/cguittfont/CGUITTFont.cpp b/src/irrlicht_changes/CGUITTFont.cpp index bd4e700de..bd4e700de 100644 --- a/src/cguittfont/CGUITTFont.cpp +++ b/src/irrlicht_changes/CGUITTFont.cpp diff --git a/src/cguittfont/CGUITTFont.h b/src/irrlicht_changes/CGUITTFont.h index 77c9e34f8..7ce898369 100644 --- a/src/cguittfont/CGUITTFont.h +++ b/src/irrlicht_changes/CGUITTFont.h @@ -35,6 +35,7 @@ #include <irrlicht.h> #include <ft2build.h> #include <vector> +#include "irrUString.h" #include "util/enriched_string.h" #include FT_FREETYPE_H @@ -268,7 +269,7 @@ namespace gui virtual void draw(const core::stringw& text, const core::rect<s32>& position, video::SColor color, bool hcenter=false, bool vcenter=false, const core::rect<s32>* clip=0); - + virtual void draw(const EnrichedString& text, const core::rect<s32>& position, video::SColor color, bool hcenter=false, bool vcenter=false, const core::rect<s32>* clip=0); diff --git a/src/irrlicht_changes/CMakeLists.txt b/src/irrlicht_changes/CMakeLists.txt index 3a265c99d..d2f66ab77 100644 --- a/src/irrlicht_changes/CMakeLists.txt +++ b/src/irrlicht_changes/CMakeLists.txt @@ -1,7 +1,16 @@ if (BUILD_CLIENT) set(client_irrlicht_changes_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/static_text.cpp - PARENT_SCOPE ) + + if (ENABLE_FREETYPE) + set(client_irrlicht_changes_SRCS ${client_irrlicht_changes_SRCS} + ${CMAKE_CURRENT_SOURCE_DIR}/CGUITTFont.cpp + ) + endif() + + # CMake require us to set a local scope and then parent scope + # Else the last set win in parent scope + set(client_irrlicht_changes_SRCS ${client_irrlicht_changes_SRCS} PARENT_SCOPE) endif() diff --git a/src/cguittfont/irrUString.h b/src/irrlicht_changes/irrUString.h index eb7abe5a1..2472eda4d 100644 --- a/src/cguittfont/irrUString.h +++ b/src/irrlicht_changes/irrUString.h @@ -41,6 +41,8 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <cstddef> + #ifdef _WIN32 #define __BYTE_ORDER 0 #define __LITTLE_ENDIAN 0 diff --git a/src/irrlicht_changes/static_text.cpp b/src/irrlicht_changes/static_text.cpp index 50c6c6a68..455dbf437 100644 --- a/src/irrlicht_changes/static_text.cpp +++ b/src/irrlicht_changes/static_text.cpp @@ -7,18 +7,13 @@ #include "static_text.h" #ifdef _IRR_COMPILE_WITH_GUI_ -#include <vector> -#include <string> -#include <iostream> -#include <IGUISkin.h> -#include <IGUIEnvironment.h> #include <IGUIFont.h> #include <IVideoDriver.h> #include <rect.h> #include <SColor.h> #if USE_FREETYPE - #include "cguittfont/xCGUITTFont.h" + #include "CGUITTFont.h" #endif #ifndef _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX // newer Irrlicht versions no longer have this diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 66e312cdb..f276af282 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -3,10 +3,6 @@ src/ban.cpp src/camera.cpp src/camera.h src/cavegen.cpp -src/cguittfont/CGUITTFont.cpp -src/cguittfont/CGUITTFont.h -src/cguittfont/irrUString.h -src/cguittfont/xCGUITTFont.h src/chat.cpp src/chat.h src/chat_interface.h @@ -113,6 +109,9 @@ src/inventory.cpp src/inventory.h src/inventorymanager.cpp src/inventorymanager.h +src/irrlicht_changes/CGUITTFont.cpp +src/irrlicht_changes/CGUITTFont.h +src/irrlicht_changes/irrUString.h src/irrlicht_changes/static_text.cpp src/irrlicht_changes/static_text.h src/irrlichttypes.h |