diff --git a/CMake/FindSDL2_ttf.cmake b/CMake/FindSDL2_ttf.cmake deleted file mode 100644 index 922a0463c..000000000 --- a/CMake/FindSDL2_ttf.cmake +++ /dev/null @@ -1,197 +0,0 @@ -# - Find SDL2_ttf -# Find the SDL2 headers and libraries -# -# SDL2::SDL2_ttf - Imported target -# -# SDL2_ttf_FOUND - True if SDL2_ttf was found. -# SDL2_ttf_DYNAMIC - If we found a DLL version of SDL2_ttf -# -# Modified for SDL2_ttf of FindSDL2.cmake -# Original Author: -# 2015 Ryan Pavlik -# -# Copyright Sensics, Inc. 2015. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# Set up architectures (for windows) and prefixes (for mingw builds) -if(WIN32) - if(MINGW) - include(MinGWSearchPathExtras OPTIONAL) - if(MINGWSEARCH_TARGET_TRIPLE) - set(SDL2_ttf_PREFIX ${MINGWSEARCH_TARGET_TRIPLE}) - endif() - endif() - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(SDL2_ttf_LIB_PATH_SUFFIX lib/x64) - if(NOT MSVC AND NOT SDL2_ttf_PREFIX) - set(SDL2_ttf_PREFIX x86_64-w64-mingw32) - endif() - else() - set(SDL2_ttf_LIB_PATH_SUFFIX lib/x86) - if(NOT MSVC AND NOT SDL2_ttf_PREFIX) - set(SDL2_ttf_PREFIX i686-w64-mingw32) - endif() - endif() -endif() - -if(SDL2_ttf_PREFIX) - set(SDL2_ttf_ORIGPREFIXPATH ${CMAKE_PREFIX_PATH}) - if(SDL2_ttf_ROOT_DIR) - list(APPEND CMAKE_PREFIX_PATH "${SDL2_ttf_ROOT_DIR}") - endif() - if(CMAKE_PREFIX_PATH) - foreach(_prefix ${CMAKE_PREFIX_PATH}) - list(APPEND CMAKE_PREFIX_PATH "${_prefix}/${SDL2_ttf_PREFIX}") - endforeach() - endif() - if(MINGWSEARCH_PREFIXES) - list(APPEND CMAKE_PREFIX_PATH ${MINGWSEARCH_PREFIXES}) - endif() -endif() - -# Invoke pkgconfig for hints -find_package(PkgConfig QUIET) -set(SDL2_ttf_INCLUDE_HINTS) -set(SDL2_ttf_LIB_HINTS) -if(PKG_CONFIG_FOUND) - pkg_search_module(SDL2_ttfPC QUIET SDL2_ttf) - if(SDL2_ttfPC_INCLUDE_DIRS) - set(SDL2_ttf_INCLUDE_HINTS ${SDL2_ttfPC_INCLUDE_DIRS}) - endif() - if(SDL2_ttfPC_LIBRARY_DIRS) - set(SDL2_ttf_LIB_HINTS ${SDL2_ttfPC_LIBRARY_DIRS}) - endif() -endif() - -include(FindPackageHandleStandardArgs) - -find_library(SDL2_ttf_LIBRARY - NAMES - SDL2_ttf - HINTS - ${SDL2_ttf_LIB_HINTS} - PATHS - ${SDL2_ttf_ROOT_DIR} - ENV SDL2DIR - PATH_SUFFIXES lib SDL2 ${SDL2_ttf_LIB_PATH_SUFFIX}) - -set(_sdl2_framework FALSE) -# Some special-casing if we've found/been given a framework. -# Handles whether we're given the library inside the framework or the framework itself. -if(APPLE AND "${SDL2_ttf_LIBRARY}" MATCHES "(/[^/]+)*.framework(/.*)?$") - set(_sdl2_framework TRUE) - set(SDL2_ttf_FRAMEWORK "${SDL2_ttf_LIBRARY}") - # Move up in the directory tree as required to get the framework directory. - while("${SDL2_ttf_FRAMEWORK}" MATCHES "(/[^/]+)*.framework(/.*)$" AND NOT "${SDL2_ttf_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$") - get_filename_component(SDL2_ttf_FRAMEWORK "${SDL2_ttf_FRAMEWORK}" DIRECTORY) - endwhile() - if("${SDL2_ttf_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$") - set(SDL2_ttf_FRAMEWORK_NAME ${CMAKE_MATCH_1}) - # If we found a framework, do a search for the header ahead of time that will be more likely to get the framework header. - find_path(SDL2_ttf_INCLUDE_DIR - NAMES - SDL_ttf.h - HINTS - "${SDL2_ttf_FRAMEWORK}/Headers/") - else() - # For some reason we couldn't get the framework directory itself. - # Shouldn't happen, but might if something is weird. - unset(SDL2_ttf_FRAMEWORK) - endif() -endif() - -find_path(SDL2_ttf_INCLUDE_DIR - NAMES - SDL_ttf.h - HINTS - ${SDL2_ttf_INCLUDE_HINTS} - PATHS - ${SDL2_ttf_ROOT_DIR} - ENV SDL2DIR - PATH_SUFFIXES include include/sdl2 include/SDL2 SDL2) - -if(WIN32 AND SDL2_ttf_LIBRARY) - find_file(SDL2_ttf_RUNTIME_LIBRARY - NAMES - SDL2_ttf.dll - libSDL2_ttf.dll - HINTS - ${SDL2_ttf_LIB_HINTS} - PATHS - ${SDL2_ttf_ROOT_DIR} - ENV SDL2DIR - PATH_SUFFIXES bin lib ${SDL2_ttf_LIB_PATH_SUFFIX}) -endif() - -if(MINGW AND NOT SDL2_ttfPC_FOUND) - find_library(SDL2_ttf_MINGW_LIBRARY mingw32) - find_library(SDL2_ttf_MWINDOWS_LIBRARY mwindows) -endif() - -if(SDL2_ttf_PREFIX) - # Restore things the way they used to be. - set(CMAKE_PREFIX_PATH ${SDL2_ttf_ORIGPREFIXPATH}) -endif() - -# handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SDL2_ttf - DEFAULT_MSG - SDL2_ttf_LIBRARY - SDL2_ttf_INCLUDE_DIR - ${SDL2_ttf_EXTRA_REQUIRED}) - -if(SDL2_ttf_FOUND) - if(NOT TARGET SDL2::SDL2_ttf) - # Create SDL2::SDL2_ttf - if(WIN32 AND SDL2_ttf_RUNTIME_LIBRARY) - set(SDL2_ttf_DYNAMIC TRUE) - add_library(SDL2::SDL2_ttf SHARED IMPORTED) - set_target_properties(SDL2::SDL2_ttf - PROPERTIES - IMPORTED_IMPLIB "${SDL2_ttf_LIBRARY}" - IMPORTED_LOCATION "${SDL2_ttf_RUNTIME_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_ttf_INCLUDE_DIR}" - ) - else() - add_library(SDL2::SDL2_ttf UNKNOWN IMPORTED) - if(SDL2_ttf_FRAMEWORK AND SDL2_ttf_FRAMEWORK_NAME) - # Handle the case that SDL2_ttf is a framework and we were able to decompose it above. - set_target_properties(SDL2::SDL2_ttf PROPERTIES - IMPORTED_LOCATION "${SDL2_ttf_FRAMEWORK}/${SDL2_ttf_FRAMEWORK_NAME}") - elseif(_sdl2_framework AND SDL2_ttf_LIBRARY MATCHES "(/[^/]+)*.framework$") - # Handle the case that SDL2_ttf is a framework and SDL_LIBRARY is just the framework itself. - - # This takes the basename of the framework, without the extension, - # and sets it (as a child of the framework) as the imported location for the target. - # This is the library symlink inside of the framework. - set_target_properties(SDL2::SDL2_ttf PROPERTIES - IMPORTED_LOCATION "${SDL2_ttf_LIBRARY}/${CMAKE_MATCH_1}") - else() - # Handle non-frameworks (including non-Mac), as well as the case that we're given the library inside of the framework - set_target_properties(SDL2::SDL2_ttf PROPERTIES - IMPORTED_LOCATION "${SDL2_ttf_LIBRARY}") - endif() - set_target_properties(SDL2::SDL2_ttf - PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_ttf_INCLUDE_DIR}" - ) - endif() - endif() - mark_as_advanced(SDL2_ttf_ROOT_DIR) -endif() - -mark_as_advanced(SDL2_ttf_LIBRARY - SDL2_ttf_RUNTIME_LIBRARY - SDL2_ttf_INCLUDE_DIR - SDL2_ttf_SDLMAIN_LIBRARY - SDL2_ttf_COCOA_LIBRARY - SDL2_ttf_MINGW_LIBRARY - SDL2_ttf_MWINDOWS_LIBRARY) - -find_package(SDL2 REQUIRED) -set_property(TARGET SDL2::SDL2_ttf APPEND PROPERTY - INTERFACE_LINK_LIBRARIES SDL2::SDL2) diff --git a/CMake/amiga_defs.cmake b/CMake/amiga_defs.cmake index 8d3e10bab..a4ea892ea 100644 --- a/CMake/amiga_defs.cmake +++ b/CMake/amiga_defs.cmake @@ -3,10 +3,8 @@ set(UBSAN OFF) set(NONET ON) set(USE_SDL1 ON) set(SDL1_VIDEO_MODE_BPP 8) -set(TTF_FONT_NAME \"LiberationSerif-Bold.ttf\") # Enable exception suport as they are used in dvlnet code set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") -find_package(Freetype REQUIRED) find_package(ZLIB REQUIRED) # Do not warn about unknown attributes, such as [[nodiscard]]. diff --git a/CMake/ctr/modules/FindBZIP2.cmake b/CMake/ctr/modules/FindBZIP2.cmake deleted file mode 100644 index 458f2b30d..000000000 --- a/CMake/ctr/modules/FindBZIP2.cmake +++ /dev/null @@ -1,65 +0,0 @@ -# - Try to find BZip2 -# You can set BZIP2_ROOT to specify a certain directory to look in first. -# Once done this will define -# BZIP2_FOUND - System has BZip2 -# BZIP2_INCLUDE_DIRS - The BZip2 include directories -# BZIP2_LIBRARIES - The libraries needed to use BZip2 -# Unless we are unable to find ZLIB -# It also adds an imported target named `3ds::bzip2`, Linking against it is -# equivalent to: -# target_link_libraries(mytarget ${BZIP2_LIBRARIES}) -# target_include_directories(mytarget PRIVATE ${BZIP2_INCLUDE_DIRS}) - -if(NOT NINTENDO_3DS) - message(FATAL_ERROR "This module can only be used if you are using the 3DS toolchain file. Please erase this build directory or create another one, and then use -DCMAKE_TOOLCHAIN_FILE=DevkitArm3DS.cmake when calling cmake for the 1st time. For more information, see the Readme.md for more information.") -endif() - -if(BZIP2_INCLUDE_DIR) - # Already in cache, be silent - set(BZIP2_FIND_QUIETLY TRUE) -endif(BZIP2_INCLUDE_DIR) - -include(LibFindMacros) -include(try_add_imported_target) - -#libfind_package(BZIP2) - -set(_BZIP2_SEARCHES) - -# Search BZIP2_ROOT first if it is set. -if(BZIP2_ROOT) - set(_BZIP2_SEARCH_ROOT - PATHS ${BZIP2_ROOT} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH) - list(APPEND _BZIP2_SEARCHES _BZIP2_SEARCH_ROOT) -endif() - -# Search below ${DEVKITPRO}, ${DEVKITARM}, portlibs (if enabled) etc. -set(_BZIP2_SEARCH_NORMAL - PATHS / - NO_DEFAULT_PATH - ONLY_CMAKE_FIND_ROOT_PATH) -list(APPEND _BZIP2_SEARCHES _BZIP2_SEARCH_NORMAL) - -foreach(search ${_BZIP2_SEARCHES}) - find_path(BZIP2_INCLUDE_DIR NAMES bzlib.h - ${${search}} - PATH_SUFFIXES include) - find_library(BZIP2_LIBRARY NAMES bzip2 libbz2.a - ${${search}} - PATH_SUFFIXES lib) -endforeach() - -#find_library(LIBM_LIBRARY NAMES m libm.a -# PATHS / /arm-none-eabi -# PATH_SUFFIXES lib/armv6k/fpu) - -set(LIBM_LIBRARY m) - -set(BZIP2_PROCESS_INCLUDES BZIP2_INCLUDE_DIR) -set(BZIP2_PROCESS_LIBS BZIP2_LIBRARY LIBM_LIBRARY) - -libfind_process(BZIP2) - -try_add_imported_target(BZIP2 m) diff --git a/CMake/ctr/modules/FindFREETYPE.cmake b/CMake/ctr/modules/FindFREETYPE.cmake deleted file mode 100644 index cdb85f6f2..000000000 --- a/CMake/ctr/modules/FindFREETYPE.cmake +++ /dev/null @@ -1,59 +0,0 @@ -# - Try to find freetype -# You can set FREETYPE_ROOT to specify a certain directory to look in first. -# Once done this will define -# FREETYPE_FOUND - System has freetype -# FREETYPE_INCLUDE_DIRS - The freetype include directories -# FREETYPE_LIBRARIES - The libraries needed to use freetype -# Unless we are unable to find ZLIB -# It also adds an imported target named `3ds::freetype`, Linking against it is -# equivalent to: -# target_link_libraries(mytarget ${FREETYPE_LIBRARIES}) -# target_include_directories(mytarget PRIVATE ${FREETYPE_INCLUDE_DIRS}) - -if(NOT NINTENDO_3DS) - message(FATAL_ERROR "This module can only be used if you are using the 3DS toolchain file. Please erase this build directory or create another one, and then use -DCMAKE_TOOLCHAIN_FILE=DevkitArm3DS.cmake when calling cmake for the 1st time. For more information, see the Readme.md for more information.") -endif() - -if(FREETYPE_INCLUDE_DIR) - # Already in cache, be silent - set(FREETYPE_FIND_QUIETLY TRUE) -endif(FREETYPE_INCLUDE_DIR) - -include(LibFindMacros) -include(try_add_imported_target) - -libfind_package(FREETYPE ZLIB) - -set(_FREETYPE_SEARCHES) - -# Search FREETYPE_ROOT first if it is set. -if(FREETYPE_ROOT) - set(_FREETYPE_SEARCH_ROOT - PATHS ${FREETYPE_ROOT} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH) - list(APPEND _FREETYPE_SEARCHES _FREETYPE_SEARCH_ROOT) -endif() - -# Search below ${DEVKITPRO}, ${DEVKITARM}, portlibs (if enabled) etc. -set(_FREETYPE_SEARCH_NORMAL - PATHS / - NO_DEFAULT_PATH - ONLY_CMAKE_FIND_ROOT_PATH) -list(APPEND _FREETYPE_SEARCHES _FREETYPE_SEARCH_NORMAL) - -foreach(search ${_FREETYPE_SEARCHES}) - find_path(FREETYPE_INCLUDE_DIR NAMES freetype/config/ftheader.h config/ftheader.h - ${${search}} - PATH_SUFFIXES include/freetype2 include freetype2) - find_library(FREETYPE_LIBRARY NAMES freetype libfreetype.a - ${${search}} - PATH_SUFFIXES lib) -endforeach() - -set(FREETYPE_PROCESS_INCLUDES FREETYPE_INCLUDE_DIR) -set(FREETYPE_PROCESS_LIBS FREETYPE_LIBRARY) - -libfind_process(FREETYPE) - -try_add_imported_target(FREETYPE 3ds::zlib) diff --git a/CMake/ctr/n3ds_defs.cmake b/CMake/ctr/n3ds_defs.cmake index 973b0df62..05fea5911 100644 --- a/CMake/ctr/n3ds_defs.cmake +++ b/CMake/ctr/n3ds_defs.cmake @@ -12,12 +12,9 @@ set(PREFILL_PLAYER_NAME ON) #3DS libraries list(APPEND CMAKE_MODULE_PATH "${DevilutionX_SOURCE_DIR}/CMake/ctr/modules") find_package(CITRO3D REQUIRED) -find_package(FREETYPE REQUIRED) -find_package(BZIP2 REQUIRED) #additional compilation definitions add_definitions(-D__3DS__) -set(TTF_FONT_DIR \"romfs:/\") set(MO_LANG_DIR \"romfs:/\") #SDL video mode parameters diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d0474a06..88cf1fcc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -263,10 +263,8 @@ endif() if(ANDROID) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/android-project/3rdParty/SDL2) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/android-project/3rdParty/SDL2_ttf) elseif(USE_SDL1) find_package(SDL REQUIRED) - find_package(SDL_ttf REQUIRED) include_directories(${SDL_INCLUDE_DIR}) else() find_package(SDL2 REQUIRED) @@ -290,7 +288,6 @@ else() # Can't define an INTERFACE target with ::, so alias instead add_library(SDL2::SDL2 ALIAS SDL2_lib) endif() - find_package(SDL2_ttf REQUIRED) endif() if(NOT NONET AND NOT DISABLE_TCP) @@ -459,7 +456,6 @@ set(libdevilutionx_SRCS Source/DiabloUI/diabloui.cpp Source/DiabloUI/dialogs.cpp Source/DiabloUI/errorart.cpp - Source/DiabloUI/fonts.cpp Source/DiabloUI/mainmenu.cpp Source/DiabloUI/progress.cpp Source/DiabloUI/scrollbar.cpp @@ -469,9 +465,7 @@ set(libdevilutionx_SRCS Source/DiabloUI/selok.cpp Source/DiabloUI/selyesno.cpp Source/DiabloUI/support_lines.cpp - Source/DiabloUI/text_draw.cpp Source/DiabloUI/title.cpp - Source/DiabloUI/ttf_render_wrapped.cpp Source/panels/charpanel.cpp Source/panels/mainpanel.cpp Source/dvlnet/abstract_net.cpp @@ -595,7 +589,6 @@ else() Source/main.cpp Source/devilutionx.exe.manifest Packaging/macOS/AppIcon.icns - Packaging/resources/CharisSILB.ttf Packaging/windows/devilutionx.rc) endif() target_link_libraries(${BIN_TARGET} PRIVATE libdevilutionx) @@ -695,6 +688,18 @@ set(devilutionx_assets fonts/12-03.pcx fonts/12-04.bin fonts/12-04.pcx + fonts/22-00.bin + fonts/22-00.pcx + fonts/22-01.bin + fonts/22-01.pcx + fonts/22-02.bin + fonts/22-02.pcx + fonts/22-03.bin + fonts/22-03.pcx + fonts/22-04.bin + fonts/22-04.pcx + fonts/22-05.bin + fonts/22-05.pcx fonts/24-00.bin fonts/24-00.pcx fonts/24-01.bin @@ -746,6 +751,7 @@ set(devilutionx_assets fonts/red.trn fonts/whitegold.trn fonts/white.trn + fonts/yellowdialog.trn gendata/cutportlw.pcx gendata/cutportrw.pcx gendata/cutstartw.pcx @@ -764,9 +770,6 @@ if(SMPQ) file(COPY "Packaging/resources/devilutionx.mpq" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") endif() -# Copy CharisSILB.ttf to the build directory so the game can run from the build directory -file(COPY "Packaging/resources/CharisSILB.ttf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") - target_include_directories(libdevilutionx PUBLIC Source ${CMAKE_CURRENT_BINARY_DIR}) @@ -834,8 +837,6 @@ foreach( DEFAULT_AUDIO_BUFFER_SIZE DEFAULT_AUDIO_RESAMPLING_QUALITY MO_LANG_DIR - TTF_FONT_DIR - TTF_FONT_NAME SDL1_VIDEO_MODE_BPP SDL1_VIDEO_MODE_FLAGS SDL1_FORCE_SVID_VIDEO_MODE @@ -908,14 +909,12 @@ endif() if(USE_SDL1) target_link_libraries(libdevilutionx PUBLIC - ${SDL_TTF_LIBRARY} ${SDL_LIBRARY}) target_compile_definitions(libdevilutionx PUBLIC USE_SDL1) else() target_link_libraries(libdevilutionx PUBLIC SDL2::SDL2 - ${SDL2_MAIN} - SDL2::SDL2_ttf) + ${SDL2_MAIN}) endif() target_link_libraries(libdevilutionx PUBLIC SDL_image) @@ -925,7 +924,6 @@ endif() if(AMIGA) target_link_libraries(libdevilutionx PUBLIC - ${FREETYPE_LIBRARY} ${ZLIB_LIBRARY}) if(NOT WARPOS) target_link_libraries(libdevilutionx PUBLIC -ldebug) @@ -936,14 +934,11 @@ if (VITA) target_link_libraries(libdevilutionx PUBLIC ScePower_stub SceAppUtil_stub - freetype - z ) target_compile_definitions(libdevilutionx PUBLIC VITA) endif() if(NINTENDO_3DS) - target_link_libraries(libdevilutionx PUBLIC 3ds::freetype 3ds::bzip2) target_link_libraries(libdevilutionx PUBLIC 3ds::citro3d 3ds::ctrulib) endif() @@ -1004,7 +999,6 @@ endif() if(APPLE) set_source_files_properties("./Packaging/macOS/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - set_source_files_properties("./Packaging/resources/CharisSILB.ttf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set(MACOSX_BUNDLE_GUI_IDENTIFIER com.diasurgical.devilutionx) set(MACOSX_BUNDLE_COPYRIGHT Unlicense) set(MACOSX_BUNDLE_BUNDLE_NAME devilutionx) @@ -1031,13 +1025,6 @@ if(APPLE) endif() if(NINTENDO_SWITCH) - - target_link_libraries(libdevilutionx PUBLIC - freetype - bz2 - z - ) - nx_generate_nacp (${BIN_TARGET}.nacp NAME "DevilutionX" AUTHOR "Devilution Team" @@ -1067,7 +1054,6 @@ if(VITA) FILE Packaging/vita/sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png FILE Packaging/vita/sce_sys/livearea/contents/logo0.png sce_sys/livearea/contents/logo0.png FILE Packaging/vita/sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml - FILE Packaging/resources/CharisSILB.ttf CharisSILB.ttf FILE Packaging/resources/devilutionx.mpq devilutionx.mpq ${VITA_TRANSLATIONS_LIST} ) @@ -1083,7 +1069,6 @@ if(NINTENDO_3DS) set(APP_RSF "${PROJECT_SOURCE_DIR}/Packaging/ctr/template.rsf") set(APP_ROMFS "${CMAKE_BINARY_DIR}/romfs") list(APPEND APP_ROMFS_FILES - ${PROJECT_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf ${PROJECT_SOURCE_DIR}/Packaging/resources/devilutionx.mpq ${devilutionx_TRANSLATIONS}) set(APP_VERSION ${PROJECT_VERSION}) @@ -1142,9 +1127,6 @@ if(CPACK) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/windows/README.txt" DESTINATION "." ) - install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf" - DESTINATION "." - ) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/devilutionx.mpq" DESTINATION "." ) @@ -1199,16 +1181,13 @@ if(CPACK) DESTINATION "share/icons/hicolor/512x512/apps" RENAME "${project_name}-hellfire.png" ) - install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf" - DESTINATION "share/fonts/truetype" - ) # -G DEB set(CPACK_PACKAGE_CONTACT "anders@jenbo.dk") if(USE_SDL1) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libsdl-ttf2.0-0") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian") else() - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl2-2.0-0, libsdl2-ttf-2.0-0") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl2-2.0-0") endif() set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) diff --git a/Packaging/OpenDingux/build.sh b/Packaging/OpenDingux/build.sh index 1d2f50c7c..bdef393cb 100755 --- a/Packaging/OpenDingux/build.sh +++ b/Packaging/OpenDingux/build.sh @@ -66,7 +66,7 @@ prepare_buildroot() { make_buildroot() { cd "$BUILDROOT" - BR2_JLEVEL=0 make toolchain libzip sdl sdl_ttf + BR2_JLEVEL=0 make toolchain sdl cd - } diff --git a/Packaging/OpenDingux/package-opk.sh b/Packaging/OpenDingux/package-opk.sh index eea561b38..76fcdbb89 100755 --- a/Packaging/OpenDingux/package-opk.sh +++ b/Packaging/OpenDingux/package-opk.sh @@ -17,7 +17,7 @@ package_opk() { mksquashfs "${BUILD_DIR}/devilutionx" \ "${tmp}/default.${ext}.desktop" "${tmp}/hellfire.${ext}.desktop" \ "${tmp}/readme.${ext}.txt" Packaging/resources/icon_32.png \ - Packaging/resources/hellfire_32.png Packaging/resources/CharisSILB.ttf \ + Packaging/resources/hellfire_32.png \ Packaging/resources/devilutionx.mpq \ "${BUILD_DIR}/devilutionx-${TARGET}.opk" \ -all-root -no-xattrs -noappend -no-exports -no-progress diff --git a/Packaging/amiga/LiberationSerif-Bold.ttf b/Packaging/amiga/LiberationSerif-Bold.ttf deleted file mode 100644 index db3d6f38c..000000000 Binary files a/Packaging/amiga/LiberationSerif-Bold.ttf and /dev/null differ diff --git a/Packaging/amiga/SIL Open Font License.txt b/Packaging/amiga/SIL Open Font License.txt deleted file mode 100644 index f2473f9cc..000000000 --- a/Packaging/amiga/SIL Open Font License.txt +++ /dev/null @@ -1,46 +0,0 @@ -Digitized data copyright (c) 2010 Google Corporation - with Reserved Font Arimo, Tinos and Cousine. -Copyright (c) 2012 Red Hat, Inc. - with Reserved Font Name Liberation. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. - -The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the copyright statement(s). - -"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. - -"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. - -5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/Packaging/amiga/prep.sh b/Packaging/amiga/prep.sh index 78e8be130..04bae83d0 100755 --- a/Packaging/amiga/prep.sh +++ b/Packaging/amiga/prep.sh @@ -37,21 +37,3 @@ mkdir -p ${SYSROOT}/usr/include cp -fvr libSDL.a ${SYSROOT}/usr/lib/ cp -fvr include/* ${SYSROOT}/usr/include/ cd .. - -# FreeType -wget https://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.gz -O freetype-2.10.1.tar.gz -tar -xvf freetype-2.10.1.tar.gz -mkdir -p freetype-2.10.1/build -cd freetype-2.10.1/build -cmake .. -DUNIX=1 -DM68K_CPU="$M68K_CPU" -DM68K_FPU="$M68K_FPU" -DM68K_COMMON="${M68K_COMMON}" -cmake --build . --config Release --target install -- -j$(getconf _NPROCESSORS_ONLN) -cd ../.. - -# SDL_ttf -wget https://github.com/SDL-mirror/SDL_ttf/archive/SDL-1.2.tar.gz -O SDL_ttf-SDL-1.2.tar.gz -tar -xvf SDL_ttf-SDL-1.2.tar.gz -cd SDL_ttf-SDL-1.2 -./autogen.sh -LDFLAGS="-L${SYSROOT}/usr/lib" SDL_LIBS='-lSDL -ldebug' SDL_CFLAGS="-L${SYSROOT}/usr/lib -I${SYSROOT}/usr/include/SDL -noixemul" CFLAGS="${M68K_CFLAGS}" CXXFLAGS="${M68K_CXXFLAGS}" FT2_CFLAGS="-L${SYSROOT}/usr/lib -I${SYSROOT}/usr/include/freetype2" FT2_LIBS="-lfreetype -lzlib" ./configure --disable-shared --enable-static --host=${TARGET} --prefix=${SYSROOT}/usr -make -j$(getconf _NPROCESSORS_ONLN) -make install diff --git a/Packaging/cpi-gamesh/build.sh b/Packaging/cpi-gamesh/build.sh index c7147fdbe..0a754edc4 100755 --- a/Packaging/cpi-gamesh/build.sh +++ b/Packaging/cpi-gamesh/build.sh @@ -37,7 +37,7 @@ done set -- "${POSITIONAL[@]}" # restore positional parameters install_deps() { - sudo apt install -y cmake libsdl2-ttf-dev libsdl2-mixer-dev + sudo apt install -y cmake libsdl2-dev } main() { diff --git a/Packaging/ctr/build.sh b/Packaging/ctr/build.sh index 04773de2c..cef295445 100755 --- a/Packaging/ctr/build.sh +++ b/Packaging/ctr/build.sh @@ -27,7 +27,7 @@ build() { install_deps() { "$DEVKITPRO/pacman/bin/pacman" -S --needed --noconfirm --quiet \ devkitARM general-tools 3dstools devkitpro-pkgbuild-helpers \ - libctru citro3d 3ds-sdl 3ds-sdl_ttf 3ds-freetype + libctru citro3d 3ds-sdl } prepare_devkitpro() { diff --git a/Packaging/debian/control b/Packaging/debian/control index a60aae571..9ffe53c2d 100644 --- a/Packaging/debian/control +++ b/Packaging/debian/control @@ -8,7 +8,6 @@ Build-Depends: git, g++, gettext, - libsdl2-ttf-dev, libsodium-dev Standards-Version: 4.3.0 Homepage: https://github.com/diasurgical/devilutionX diff --git a/Packaging/nix/AppRun b/Packaging/nix/AppRun index b64df875b..c893a68f5 100755 --- a/Packaging/nix/AppRun +++ b/Packaging/nix/AppRun @@ -1,2 +1,2 @@ #!/bin/sh -exec "$APPDIR/usr/bin/devilutionx" --ttf-dir "$APPDIR/usr/share/fonts/truetype/" "$@" +exec "$APPDIR/usr/bin/devilutionx" "$@" diff --git a/Packaging/nix/LinuxReleasePackaging.sh b/Packaging/nix/LinuxReleasePackaging.sh index 1aa16a340..7e22d4e89 100755 --- a/Packaging/nix/LinuxReleasePackaging.sh +++ b/Packaging/nix/LinuxReleasePackaging.sh @@ -4,7 +4,6 @@ cp ./build/devilutionx ./build/package/devilutionx cp ./Packaging/resources/devilutionx.mpq ./build/package/devilutionx.mpq cp ./build/devilutionx*.deb ./build/package/devilutionx.deb cp ./build/devilutionx*.rpm ./build/package/devilutionx.rpm -cp ./build/CharisSILB.ttf ./build/package/CharisSILB.ttf cp ./Packaging/nix/README.txt ./build/package/README.txt cp ./Packaging/resources/LICENSE.CharisSILB.txt ./build/package/LICENSE.CharisSILB.txt -cd ./build/package/ && tar -cavf ../../devilutionx.tar.xz * && cd ../../ \ No newline at end of file +cd ./build/package/ && tar -cavf ../../devilutionx.tar.xz * && cd ../../ diff --git a/Packaging/nix/README.txt b/Packaging/nix/README.txt index f7c85ca49..d8980b84b 100644 --- a/Packaging/nix/README.txt +++ b/Packaging/nix/README.txt @@ -10,7 +10,7 @@ For a full list of changes see our changelog: https://github.com/diasurgical/dev # How To Install: - Extract the files in the archive. - - Install libsdl2 libsdl2-mixer libsdl2-ttf + - Install libsdl2 - Copy DIABDAT.MPQ from the CD or GOG-installation (or extract it from the GoG installer) to the DevilutionX folder. - To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq. - Run ./devilutionx diff --git a/Packaging/pi/README.txt b/Packaging/pi/README.txt index 72df66cd1..52653dcd4 100644 --- a/Packaging/pi/README.txt +++ b/Packaging/pi/README.txt @@ -10,7 +10,7 @@ For a full list of changes see our changelog: https://github.com/diasurgical/dev # How To Install: - Extract the files in the archive. - - Install libsdl2 libsdl2-mixer libsdl2-ttf + - Install libsdl2 - Copy DIABDAT.MPQ from the CD or GOG-installation (or extract it from the GoG installer) to the DevilutionX folder. - To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq. - Run ./devilutionx diff --git a/Packaging/resources/CharisSILB.ttf b/Packaging/resources/CharisSILB.ttf deleted file mode 100644 index b82438322..000000000 Binary files a/Packaging/resources/CharisSILB.ttf and /dev/null differ diff --git a/Packaging/resources/LICENSE.freetype.txt b/Packaging/resources/LICENSE.freetype.txt deleted file mode 100644 index 5fb9b74e1..000000000 --- a/Packaging/resources/LICENSE.freetype.txt +++ /dev/null @@ -1,173 +0,0 @@ -The source code to this library used with SDL_ttf can be found here: -https://hg.libsdl.org/SDL_ttf/file/default/external ---- - - The FreeType Project LICENSE - ---------------------------- - - 2006-Jan-27 - - Copyright 1996-2002, 2006 by - David Turner, Robert Wilhelm, and Werner Lemberg - - - -Introduction -============ - - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. - - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. - - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: - - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) - - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) - - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') - - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. - - - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: - - """ - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. - """ - - Please replace with the value from the FreeType version you - actually use. - - -Legal Terms -=========== - -0. Definitions --------------- - - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. - - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. - - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. - - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. - -1. No Warranty --------------- - - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. - -2. Redistribution ------------------ - - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: - - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. - - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. - - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. - -3. Advertising --------------- - - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. - - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. - - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. - -4. Contacts ------------ - - There are two mailing lists related to FreeType: - - o freetype@nongnu.org - - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. - - o freetype-devel@nongnu.org - - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. - - Our home page can be found at - - https://www.freetype.org - - ---- end of FTL.TXT --- diff --git a/Packaging/resources/assets/fonts/22-00.bin b/Packaging/resources/assets/fonts/22-00.bin new file mode 100644 index 000000000..82cc0f74d --- /dev/null +++ b/Packaging/resources/assets/fonts/22-00.bin @@ -0,0 +1,41 @@ + +   + + + + + + + + +  + +  + +  + + + + + +   + + +    +  +      + + + + + + +  + + + + + + + + \ No newline at end of file diff --git a/Packaging/resources/assets/fonts/22-00.pcx b/Packaging/resources/assets/fonts/22-00.pcx new file mode 100644 index 000000000..77ac6c9f2 Binary files /dev/null and b/Packaging/resources/assets/fonts/22-00.pcx differ diff --git a/Packaging/resources/assets/fonts/22-01.bin b/Packaging/resources/assets/fonts/22-01.bin new file mode 100644 index 000000000..ecdbfe0f6 --- /dev/null +++ b/Packaging/resources/assets/fonts/22-01.bin @@ -0,0 +1,38 @@ + + + + + + + +  + + + +   + + +       +      + + +  + +   + +     +      + + + +  + +  + + + + + +  +  + diff --git a/Packaging/resources/assets/fonts/22-01.pcx b/Packaging/resources/assets/fonts/22-01.pcx new file mode 100644 index 000000000..2547d9a70 Binary files /dev/null and b/Packaging/resources/assets/fonts/22-01.pcx differ diff --git a/Packaging/resources/assets/fonts/22-02.bin b/Packaging/resources/assets/fonts/22-02.bin new file mode 100644 index 000000000..006a2d1d6 --- /dev/null +++ b/Packaging/resources/assets/fonts/22-02.bin @@ -0,0 +1,38 @@ +  + + + + + +     + + + + + + +   +  + +  + + + +   + +  +  +  + +  + +  + + +  +       +  +  + + + \ No newline at end of file diff --git a/Packaging/resources/assets/fonts/22-02.pcx b/Packaging/resources/assets/fonts/22-02.pcx new file mode 100644 index 000000000..795d8d40d Binary files /dev/null and b/Packaging/resources/assets/fonts/22-02.pcx differ diff --git a/Packaging/resources/assets/fonts/22-03.bin b/Packaging/resources/assets/fonts/22-03.bin new file mode 100644 index 000000000..91785ec9f --- /dev/null +++ b/Packaging/resources/assets/fonts/22-03.bin @@ -0,0 +1,12 @@ +  + +    + + + + + +            + + +   \ No newline at end of file diff --git a/Packaging/resources/assets/fonts/22-03.pcx b/Packaging/resources/assets/fonts/22-03.pcx new file mode 100644 index 000000000..b7252051d Binary files /dev/null and b/Packaging/resources/assets/fonts/22-03.pcx differ diff --git a/Packaging/resources/assets/fonts/22-04.bin b/Packaging/resources/assets/fonts/22-04.bin new file mode 100644 index 000000000..44f2795b3 --- /dev/null +++ b/Packaging/resources/assets/fonts/22-04.bin @@ -0,0 +1,33 @@ +  +     + +  +  +      + +   + + + + +    + + +  +  +       +   + +    + + + +  + + + + +    + +  + \ No newline at end of file diff --git a/Packaging/resources/assets/fonts/22-04.pcx b/Packaging/resources/assets/fonts/22-04.pcx new file mode 100644 index 000000000..3d48095dd Binary files /dev/null and b/Packaging/resources/assets/fonts/22-04.pcx differ diff --git a/Packaging/resources/assets/fonts/22-05.bin b/Packaging/resources/assets/fonts/22-05.bin new file mode 100644 index 000000000..b235344d2 --- /dev/null +++ b/Packaging/resources/assets/fonts/22-05.bin @@ -0,0 +1,5 @@ + + +   +   +  \ No newline at end of file diff --git a/Packaging/resources/assets/fonts/22-05.pcx b/Packaging/resources/assets/fonts/22-05.pcx new file mode 100644 index 000000000..0159899a4 Binary files /dev/null and b/Packaging/resources/assets/fonts/22-05.pcx differ diff --git a/Packaging/resources/assets/fonts/yellowdialog.trn b/Packaging/resources/assets/fonts/yellowdialog.trn new file mode 100644 index 000000000..172006163 Binary files /dev/null and b/Packaging/resources/assets/fonts/yellowdialog.trn differ diff --git a/Packaging/switch/README.txt b/Packaging/switch/README.txt index 8767bb25d..267afbca6 100644 --- a/Packaging/switch/README.txt +++ b/Packaging/switch/README.txt @@ -1,7 +1,7 @@ # Nintendo Switch Port of DevilutionX (Diablo) # How To Install: - - Put `devilutionx.nro` and `CharisSILB.ttf` in into `/switch/devilutionx` + - Put `devilutionx.nro` in into `/switch/devilutionx` - Copy diabdat.mpq from your CD (or GoG install folder) to `/switch/devilutionx`. - To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq. - Launch `devilutionx.nro`. (Do not use album to launch; see the note below.) diff --git a/Packaging/switch/build.sh b/Packaging/switch/build.sh index 19ad919d4..3a88e3204 100755 --- a/Packaging/switch/build.sh +++ b/Packaging/switch/build.sh @@ -26,10 +26,9 @@ build() { install_deps() { "$DEVKITPRO/pacman/bin/pacman" -S --needed --noconfirm --quiet \ - switch-freetype switch-mesa switch-glad switch-glm switch-libpng \ - switch-sdl2 switch-sdl2_ttf switch-libvorbis switch-libmikmod \ - switch-libsodium libnx devkitA64 devkitA64 general-tools \ - switch-tools devkitpro-pkgbuild-helpers + switch-mesa switch-glad switch-glm switch-libpng \ + switch-sdl2 switch-libsodium libnx devkitA64 devkitA64 \ + general-tools switch-tools devkitpro-pkgbuild-helpers } prepare_devkitpro() { diff --git a/Source/DiabloUI/button.cpp b/Source/DiabloUI/button.cpp index 3631b8b6c..8ed2e526f 100644 --- a/Source/DiabloUI/button.cpp +++ b/Source/DiabloUI/button.cpp @@ -1,7 +1,8 @@ #include "DiabloUI/art_draw.h" #include "DiabloUI/button.h" +#include "DiabloUI/diabloui.h" #include "DiabloUI/errorart.h" -#include "DiabloUI/text_draw.h" +#include "engine/render/text_render.hpp" #include "utils/display.h" namespace devilution { @@ -23,14 +24,12 @@ void RenderButton(UiButton *button) } DrawArt({ button->m_rect.x, button->m_rect.y }, button->m_art, frame, button->m_rect.w, button->m_rect.h); - SDL_Rect textRect = button->m_rect; + Rectangle textRect { { button->m_rect.x, button->m_rect.y }, { button->m_rect.w, button->m_rect.h } }; if (!button->m_pressed) - --textRect.y; + --textRect.position.y; - SDL_Color color1 = { 243, 243, 243, 0 }; - SDL_Color color2 = { 0, 0, 0, 0 }; - DrawTTF(button->m_text, textRect, UiFlags::AlignCenter, - color1, color2, button->m_render_cache); + const Surface &out = Surface(DiabloUiSurface()); + DrawString(out, button->m_text, textRect, UiFlags::AlignCenter | UiFlags::FontSizeDialog | UiFlags::ColorDialogWhite, 0); } bool HandleMouseEventButton(const SDL_Event &event, UiButton *button) diff --git a/Source/DiabloUI/credits.cpp b/Source/DiabloUI/credits.cpp index e98df4110..a92769744 100644 --- a/Source/DiabloUI/credits.cpp +++ b/Source/DiabloUI/credits.cpp @@ -6,16 +6,15 @@ #include "DiabloUI/art_draw.h" #include "DiabloUI/credits_lines.h" #include "DiabloUI/diabloui.h" -#include "DiabloUI/fonts.h" #include "DiabloUI/support_lines.h" #include "control.h" #include "controls/menu_controls.h" +#include "engine/render/text_render.hpp" #include "hwcursor.hpp" #include "utils/display.h" #include "utils/language.h" #include "utils/log.hpp" #include "utils/sdl_compat.h" -#include "utils/ttf_wrap.h" namespace devilution { @@ -34,72 +33,11 @@ std::size_t textLines; // a line is leaving the screen while another one is entering. #define MAX_VISIBLE_LINES ((VIEWPORT.h - 1) / LINE_H + 2) -struct CachedLine { - - CachedLine() - { - mIndex = 0; - paletteVersion = pal_surface_palette_version; - } - - CachedLine(std::size_t index, SDLSurfaceUniquePtr surface) - { - mIndex = index; - mSurface = std::move(surface); - paletteVersion = pal_surface_palette_version; - } - - std::size_t mIndex; - SDLSurfaceUniquePtr mSurface; - unsigned int paletteVersion; -}; - -CachedLine PrepareLine(std::size_t index) -{ - const char *contents = _(Text[index]); - while (contents[0] == '\t') - ++contents; - - // Precompose shadow and text: - SDLSurfaceUniquePtr surface; - if (contents[0] != '\0') { - const SDL_Color shadowColor = { 0, 0, 0, 0 }; - SDLSurfaceUniquePtr text = TTFWrap::RenderUTF8_Solid(font, contents, shadowColor); - - // Set up the target surface to have 3 colors: mask, text, and shadow. - surface = SDLWrap::CreateRGBSurfaceWithFormat(0, text->w + ShadowOffsetX, text->h + ShadowOffsetY, 8, SDL_PIXELFORMAT_INDEX8); - const SDL_Color maskColor = { 0, 255, 0, 0 }; // Any color different from both shadow and text - const SDL_Color &textColor = Palette->colors[224]; - SDL_Color colors[3] = { maskColor, textColor, shadowColor }; - if (SDLC_SetSurfaceColors(surface.get(), colors, 0, 3) <= -1) - Log("{}", SDL_GetError()); - SDLC_SetColorKey(surface.get(), 0); - - // Blit the shadow first: - SDL_Rect shadowRect = { ShadowOffsetX, ShadowOffsetY, 0, 0 }; - if (SDL_BlitSurface(text.get(), nullptr, surface.get(), &shadowRect) <= -1) - ErrSdl(); - - // Change the text surface color and blit again: - SDL_Color textColors[2] = { maskColor, textColor }; - if (SDLC_SetSurfaceColors(text.get(), textColors, 0, 2) <= -1) - ErrSdl(); - SDLC_SetColorKey(text.get(), 0); - - if (SDL_BlitSurface(text.get(), nullptr, surface.get(), nullptr) <= -1) - ErrSdl(); - - surface = ScaleSurfaceToOutput(std::move(surface)); - } - return CachedLine(index, std::move(surface)); -} - class CreditsRenderer { public: CreditsRenderer() { - LoadTtfFont(); ticks_begin_ = SDL_GetTicks(); prev_offset_y_ = 0; finished_ = false; @@ -109,8 +47,6 @@ public: { ArtBackgroundWidescreen.Unload(); ArtBackground.Unload(); - UnloadTtfFont(); - lines_.clear(); } void Render(); @@ -121,7 +57,6 @@ public: } private: - std::vector lines_; bool finished_; Uint32 ticks_begin_; int prev_offset_y_; @@ -137,8 +72,6 @@ void CreditsRenderer::Render() SDL_FillRect(DiabloUiSurface(), nullptr, 0x000000); DrawArt({ PANEL_LEFT - 320, UI_OFFSET_Y }, &ArtBackgroundWidescreen); DrawArt({ PANEL_LEFT, UI_OFFSET_Y }, &ArtBackground); - if (font == nullptr) - return; const std::size_t linesBegin = std::max(offsetY / LINE_H, 0); const std::size_t linesEnd = std::min(linesBegin + MAX_VISIBLE_LINES, textLines); @@ -149,9 +82,6 @@ void CreditsRenderer::Render() return; } - while (linesEnd > lines_.size()) - lines_.push_back(PrepareLine(lines_.size())); - SDL_Rect viewport = VIEWPORT; viewport.x += PANEL_LEFT; viewport.y += UI_OFFSET_Y; @@ -161,26 +91,19 @@ void CreditsRenderer::Render() // We use unscaled coordinates for calculation throughout. Sint16 destY = UI_OFFSET_Y + VIEWPORT.y - (offsetY - linesBegin * LINE_H); for (std::size_t i = linesBegin; i < linesEnd; ++i, destY += LINE_H) { - CachedLine &line = lines_[i]; - if (line.mSurface == nullptr) - continue; - - // Still fading in: the cached line was drawn with a different fade level. - if (line.paletteVersion != pal_surface_palette_version) { - line = PrepareLine(line.mIndex); - } - Sint16 destX = PANEL_LEFT + VIEWPORT.x + 31; int j = 0; - while (Text[line.mIndex][j++] == '\t') + while (Text[i][j] == '\t') { destX += 40; + j++; + } - SDL_Rect dstRect = { destX, destY, 0, 0 }; + SDL_Rect dstRect { destX, destY, 0, 0 }; ScaleOutputRect(&dstRect); - dstRect.w = line.mSurface->w; - dstRect.h = line.mSurface->h; - if (SDL_BlitSurface(line.mSurface.get(), nullptr, DiabloUiSurface(), &dstRect) < 0) - ErrSdl(); + if (Text[i][j] != '\0') { + const Surface &out = Surface(DiabloUiSurface()); + DrawString(out, _(Text[i]), Point { dstRect.x, dstRect.y }, UiFlags::FontSizeDialog | UiFlags::ColorDialogWhite, 0); + } } SDL_SetClipRect(DiabloUiSurface(), nullptr); } diff --git a/Source/DiabloUI/diabloui.cpp b/Source/DiabloUI/diabloui.cpp index e4b1197c1..bce9199ba 100644 --- a/Source/DiabloUI/diabloui.cpp +++ b/Source/DiabloUI/diabloui.cpp @@ -11,9 +11,7 @@ #include "DiabloUI/art_draw.h" #include "DiabloUI/button.h" #include "DiabloUI/dialogs.h" -#include "DiabloUI/fonts.h" #include "DiabloUI/scrollbar.h" -#include "DiabloUI/text_draw.h" #include "controls/controller.h" #include "controls/menu_controls.h" #include "dx.h" @@ -550,7 +548,6 @@ void UiInitialize() void UiDestroy() { - UnloadTtfFont(); UnloadFonts(); UnloadUiGFX(); } @@ -715,12 +712,10 @@ namespace { void Render(UiText *uiText) { - DrawTTF(uiText->m_text, - uiText->m_rect, - uiText->m_iFlags, - uiText->m_color, - uiText->m_shadow_color, - uiText->m_render_cache); + Rectangle rect { { uiText->m_rect.x, uiText->m_rect.y }, { uiText->m_rect.w, uiText->m_rect.h } }; + + const Surface &out = Surface(DiabloUiSurface()); + DrawString(out, uiText->m_text, rect, uiText->m_iFlags | UiFlags::FontSizeDialog, 0); } void Render(const UiArtText *uiArtText) diff --git a/Source/DiabloUI/dialogs.cpp b/Source/DiabloUI/dialogs.cpp index 87e50f850..eea47bfaa 100644 --- a/Source/DiabloUI/dialogs.cpp +++ b/Source/DiabloUI/dialogs.cpp @@ -5,7 +5,6 @@ #include "DiabloUI/button.h" #include "DiabloUI/diabloui.h" #include "DiabloUI/errorart.h" -#include "DiabloUI/fonts.h" #include "control.h" #include "controls/menu_controls.h" #include "dx.h" @@ -20,7 +19,6 @@ namespace devilution { namespace { Art dialogArt; -bool fontWasLoaded; bool dialogEnd; @@ -157,6 +155,7 @@ void LoadFallbackPalette() }; // clang-format on ApplyGamma(logical_palette, FallbackPalette, 256); + BlackPalette(); } void Init(const char *text, const char *caption, bool error, bool renderBehind) @@ -166,7 +165,7 @@ void Init(const char *text, const char *caption, bool error, bool renderBehind) vecOkDialog.push_back(std::make_unique(&dialogArt, rect1)); SDL_Rect rect2 = { (Sint16)(PANEL_LEFT + 200), (Sint16)(UI_OFFSET_Y + 211), 240, 80 }; - vecOkDialog.push_back(std::make_unique(text, rect2, UiFlags::AlignCenter)); + vecOkDialog.push_back(std::make_unique(text, rect2, UiFlags::AlignCenter | UiFlags::ColorDialogWhite)); SDL_Rect rect3 = { (Sint16)(PANEL_LEFT + 265), (Sint16)(UI_OFFSET_Y + 265), SML_BUTTON_WIDTH, SML_BUTTON_HEIGHT }; vecOkDialog.push_back(std::make_unique(&SmlButton, _("OK"), &DialogActionOK, rect3)); @@ -174,48 +173,42 @@ void Init(const char *text, const char *caption, bool error, bool renderBehind) SDL_Rect rect1 = { (Sint16)(PANEL_LEFT + 127), (Sint16)(UI_OFFSET_Y + 100), 385, 280 }; vecOkDialog.push_back(std::make_unique(&dialogArt, rect1)); - SDL_Color color = { 255, 255, 0, 0 }; SDL_Rect rect2 = { (Sint16)(PANEL_LEFT + 147), (Sint16)(UI_OFFSET_Y + 110), 345, 20 }; - vecOkDialog.push_back(std::make_unique(text, rect2, UiFlags::AlignCenter, color)); + vecOkDialog.push_back(std::make_unique(text, rect2, UiFlags::AlignCenter | UiFlags::ColorDialogYellow)); SDL_Rect rect3 = { (Sint16)(PANEL_LEFT + 147), (Sint16)(UI_OFFSET_Y + 141), 345, 190 }; - vecOkDialog.push_back(std::make_unique(caption, rect3, UiFlags::AlignCenter)); + vecOkDialog.push_back(std::make_unique(caption, rect3, UiFlags::AlignCenter | UiFlags::ColorDialogWhite)); SDL_Rect rect4 = { (Sint16)(PANEL_LEFT + 264), (Sint16)(UI_OFFSET_Y + 335), SML_BUTTON_WIDTH, SML_BUTTON_HEIGHT }; vecOkDialog.push_back(std::make_unique(&SmlButton, _("OK"), &DialogActionOK, rect4)); } if (!renderBehind) { + ArtBackground.Unload(); LoadBackgroundArt("ui_art\\black.pcx"); if (ArtBackground.surface == nullptr) { LoadFallbackPalette(); + if (SDL_ShowCursor(SDL_ENABLE) <= -1) + Log("{}", SDL_GetError()); } } - SetFadeLevel(256); + if (caption == nullptr) { LoadMaskedArt(error ? "ui_art\\srpopup.pcx" : "ui_art\\spopup.pcx", &dialogArt); + } else if (error) { + LoadArt(&dialogArt, PopupData, 385, 280); } else { - if (error) { - LoadArt(&dialogArt, PopupData, 385, 280); - } else { - LoadMaskedArt("ui_art\\lpopup.pcx", &dialogArt); - } + LoadMaskedArt("ui_art\\lpopup.pcx", &dialogArt); } LoadSmlButtonArt(); - - fontWasLoaded = font != nullptr; - if (!fontWasLoaded) - LoadTtfFont(); } void Deinit() { dialogArt.Unload(); UnloadSmlButtonArt(); - if (!fontWasLoaded) - UnloadTtfFont(); - vecOkDialog.clear(); + ArtBackground.Unload(); } void DialogLoop(const std::vector> &items, const std::vector> &renderBehind) @@ -244,12 +237,14 @@ void DialogLoop(const std::vector> &items, const std } if (renderBehind.empty()) { - SDL_FillRect(DiabloUiSurface(), nullptr, 0); + SDL_FillRect(DiabloUiSurface(), nullptr, 0x000000); } else { UiRenderItems(renderBehind); } UiRenderItems(items); - DrawMouse(); + if (ArtBackground.surface != nullptr) { + DrawMouse(); + } UiFadeIn(); } while (!dialogEnd); } @@ -260,28 +255,32 @@ void UiOkDialog(const char *text, const char *caption, bool error, const std::ve { static bool inDialog = false; + if (caption != nullptr) { + LogError("{}\n{}", text, caption); + } else { + LogError("{}", text); + } + if (!gbActive || inDialog) { - if (!IsHardwareCursor()) { - if (SDL_ShowCursor(SDL_ENABLE) <= -1) { - Log("{}", SDL_GetError()); - } - } if (!gbQuietMode) { + if (SDL_ShowCursor(SDL_ENABLE) <= -1) + Log("{}", SDL_GetError()); if (SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, text, caption, nullptr) <= -1) { Log("{}", SDL_GetError()); } } - Log("{}", text); - Log("{}", caption); return; } + if (IsHardwareCursor()) { + if (SDL_ShowCursor(SDL_ENABLE) <= -1) + Log("{}", SDL_GetError()); + } + inDialog = true; + SDL_SetClipRect(DiabloUiSurface(), nullptr); Init(text, caption, error, !renderBehind.empty()); - if (font != nullptr) - DialogLoop(vecOkDialog, renderBehind); - else - UiOkDialog(text, caption, error, renderBehind); + DialogLoop(vecOkDialog, renderBehind); Deinit(); inDialog = false; } diff --git a/Source/DiabloUI/fonts.cpp b/Source/DiabloUI/fonts.cpp deleted file mode 100644 index 7d55aa437..000000000 --- a/Source/DiabloUI/fonts.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "DiabloUI/fonts.h" - -#include "diablo.h" -#include "engine/load_file.hpp" -#include "utils/file_util.h" -#include "utils/log.hpp" -#include "utils/paths.h" - -namespace devilution { - -TTF_Font *font = nullptr; -/** This is so we know ttf has been init when we get to the diablo_deinit() function */ -bool was_fonts_init = false; - -void LoadTtfFont() -{ - if (TTF_WasInit() == 0) { - if (TTF_Init() == -1) { - Log("TTF_Init: {}", TTF_GetError()); - diablo_quit(1); - } - was_fonts_init = true; - } - - std::string ttfFontPath = paths::TtfPath() + paths::TtfName(); -#if defined(__linux__) && !defined(__ANDROID__) - if (!FileExists(ttfFontPath.c_str())) { - ttfFontPath = "/usr/share/fonts/truetype/" + paths::TtfName(); - } -#endif - font = TTF_OpenFont(ttfFontPath.c_str(), 17); - if (font == nullptr) { - Log("TTF_OpenFont: {}", TTF_GetError()); - return; - } - - TTF_SetFontKerning(font, 0); - TTF_SetFontHinting(font, TTF_HINTING_MONO); -} - -void UnloadTtfFont() -{ - if (font != nullptr && TTF_WasInit() != 0) - TTF_CloseFont(font); - font = nullptr; -} - -void FontsCleanup() -{ - TTF_Quit(); -} - -} // namespace devilution diff --git a/Source/DiabloUI/fonts.h b/Source/DiabloUI/fonts.h deleted file mode 100644 index dce98207b..000000000 --- a/Source/DiabloUI/fonts.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include -#include - -#include - -#include "DiabloUI/art.h" - -namespace devilution { - -extern TTF_Font *font; - -void LoadTtfFont(); -void UnloadTtfFont(); -void FontsCleanup(); - -} // namespace devilution diff --git a/Source/DiabloUI/progress.cpp b/Source/DiabloUI/progress.cpp index 5fe3cb781..0439fba39 100644 --- a/Source/DiabloUI/progress.cpp +++ b/Source/DiabloUI/progress.cpp @@ -1,7 +1,6 @@ #include "DiabloUI/art_draw.h" #include "DiabloUI/button.h" #include "DiabloUI/diabloui.h" -#include "DiabloUI/fonts.h" #include "control.h" #include "controls/menu_controls.h" #include "dx.h" @@ -9,7 +8,6 @@ #include "palette.h" #include "utils/display.h" #include "utils/language.h" -#include "utils/ttf_wrap.h" namespace devilution { namespace { @@ -18,8 +16,6 @@ Art progressArt; Art ArtPopupSm; Art ArtProgBG; Art ProgFil; -SDLSurfaceUniquePtr msgSurface; -SDLSurfaceUniquePtr msgShadow; std::vector> vecProgress; bool endMenu; @@ -35,15 +31,7 @@ void ProgressLoad(const char *msg) LoadArt("ui_art\\prog_bg.pcx", &ArtProgBG); LoadArt("ui_art\\prog_fil.pcx", &ProgFil); LoadSmlButtonArt(); - LoadTtfFont(); - if (font != nullptr) { - SDL_Color color = { 243, 243, 243, 0 }; - SDL_Color black = { 0, 0, 0, 0 }; - - msgSurface = TTFWrap::RenderUTF8_Solid(font, msg, color); - msgShadow = TTFWrap::RenderUTF8_Solid(font, msg, black); - } SDL_Rect rect3 = { (Sint16)(PANEL_LEFT + 265), (Sint16)(UI_OFFSET_Y + 267), SML_BUTTON_WIDTH, SML_BUTTON_HEIGHT }; vecProgress.push_back(std::make_unique(&SmlButton, _("Cancel"), &DialogActionCancel, rect3)); } @@ -55,9 +43,6 @@ void ProgressFree() ArtProgBG.Unload(); ProgFil.Unload(); UnloadSmlButtonArt(); - msgSurface = nullptr; - msgShadow = nullptr; - UnloadTtfFont(); } void ProgressRender(BYTE progress) @@ -73,19 +58,6 @@ void ProgressRender(BYTE progress) DrawArt({ GetCenterOffset(227), position.y + 52 }, &ProgFil, 0, 227 * progress / 100); } DrawArt({ GetCenterOffset(110), position.y + 99 }, &SmlButton, 2, 110); - - if (msgSurface != nullptr) { - SDL_Rect dscRect = { - static_cast(position.x + 50 + 1), - static_cast(position.y + 8 + 1), - static_cast(msgSurface->w), - static_cast(msgSurface->h) - }; - Blit(msgShadow.get(), nullptr, &dscRect); - dscRect.x -= 1; - dscRect.y -= 1; - Blit(msgSurface.get(), nullptr, &dscRect); - } } } // namespace diff --git a/Source/DiabloUI/text_draw.cpp b/Source/DiabloUI/text_draw.cpp deleted file mode 100644 index 5f246bb0c..000000000 --- a/Source/DiabloUI/text_draw.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "DiabloUI/text_draw.h" - -#include "DiabloUI/art_draw.h" -#include "DiabloUI/diabloui.h" -#include "DiabloUI/fonts.h" -#include "DiabloUI/ttf_render_wrapped.h" -#include "DiabloUI/ui_item.h" -#include "utils/display.h" - -namespace devilution { - -namespace { - -TextAlignment XAlignmentFromFlags(UiFlags flags) -{ - if (HasAnyOf(flags, UiFlags::AlignCenter)) - return TextAlignment_CENTER; - if (HasAnyOf(flags, UiFlags::AlignRight)) - return TextAlignment_END; - return TextAlignment_BEGIN; -} - -int AlignXOffset(UiFlags flags, const SDL_Rect &dest, int w) -{ - if (HasAnyOf(flags, UiFlags::AlignCenter)) - return (dest.w - w) / 2; - if (HasAnyOf(flags, UiFlags::AlignRight)) - return dest.w - w; - return 0; -} - -} // namespace - -void DrawTTF(const char *text, const SDL_Rect &rectIn, UiFlags flags, - const SDL_Color &textColor, const SDL_Color &shadowColor, - TtfSurfaceCache &renderCache) -{ - SDL_Rect rect(rectIn); - if (font == nullptr || text == nullptr || *text == '\0') - return; - - const auto xAlign = XAlignmentFromFlags(flags); - if (renderCache.text == nullptr) - renderCache.text = ScaleSurfaceToOutput(RenderUTF8_Solid_Wrapped(font, text, textColor, rect.w, xAlign)); - if (renderCache.shadow == nullptr) - renderCache.shadow = ScaleSurfaceToOutput(RenderUTF8_Solid_Wrapped(font, text, shadowColor, rect.w, xAlign)); - - SDL_Surface *textSurface = renderCache.text.get(); - SDL_Surface *shadowSurface = renderCache.shadow.get(); - if (textSurface == nullptr) - return; - - SDL_Rect destRect = rect; - ScaleOutputRect(&destRect); - destRect.x += AlignXOffset(flags, destRect, textSurface->w); - destRect.y += HasAnyOf(flags, UiFlags::VerticalCenter) ? (destRect.h - textSurface->h) / 2 : 0; - - SDL_Rect shadowRect = destRect; - ++shadowRect.x; - ++shadowRect.y; - if (SDL_BlitSurface(shadowSurface, nullptr, DiabloUiSurface(), &shadowRect) < 0) - ErrSdl(); - if (SDL_BlitSurface(textSurface, nullptr, DiabloUiSurface(), &destRect) < 0) - ErrSdl(); -} - -} // namespace devilution diff --git a/Source/DiabloUI/text_draw.h b/Source/DiabloUI/text_draw.h deleted file mode 100644 index fa2f4fd48..000000000 --- a/Source/DiabloUI/text_draw.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include - -#include "utils/sdl_ptrs.h" - -namespace devilution { - -struct TtfSurfaceCache { - SDLSurfaceUniquePtr text; - SDLSurfaceUniquePtr shadow; -}; - -enum class UiFlags; // Defined in ui_item.h, declared here to avoid circular dependency - -void DrawTTF(const char *text, const SDL_Rect &rect, UiFlags flags, - const SDL_Color &textColor, const SDL_Color &shadowColor, - TtfSurfaceCache &renderCache); - -} // namespace devilution diff --git a/Source/DiabloUI/ttf_render_wrapped.cpp b/Source/DiabloUI/ttf_render_wrapped.cpp deleted file mode 100644 index df214b707..000000000 --- a/Source/DiabloUI/ttf_render_wrapped.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include "DiabloUI/ttf_render_wrapped.h" - -#include -#include -#include -#include - -#include -#ifdef USE_SDL1 -#include "utils/sdl2_to_1_2_backports.h" -#else -#include "utils/sdl2_backports.h" -#endif - -#include "utils/log.hpp" -#include "utils/sdl_compat.h" -#include "utils/sdl_wrap.h" -#include "utils/ttf_wrap.h" - -namespace devilution { - -namespace { - -bool CharacterIsDelimiter(char c) -{ - constexpr char Delimiters[] = { ' ', '\t', '\r', '\n' }; - - return std::find(std::begin(Delimiters), std::end(Delimiters), c) != std::end(Delimiters); -} - -} // namespace - -// Based on SDL 2.0.12 TTF_RenderUTF8_Blended_Wrapped -SDLSurfaceUniquePtr RenderUTF8_Solid_Wrapped(TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength, const int xAlign) -{ - int width = 0; - int height = 0; - const int lineSpace = 2; - - /* Get the dimensions of the text surface */ - if (TTF_SizeUTF8(font, text, &width, &height) < 0 || width == 0) { - TTF_SetError("Text has zero width"); - return {}; - } - - std::unique_ptr str; - std::vector strLines; - if (wrapLength > 0 && *text != '\0') { - const std::size_t strLen = std::strlen(text); - - str.reset(new char[strLen + 1]); - - std::memcpy(str.get(), text, strLen + 1); - char *tok = str.get(); - char *end = str.get() + strLen; - do { - strLines.push_back(tok); - - /* Look for the end of the line */ - char *spot; - if ((spot = SDL_strchr(tok, '\r')) != nullptr || (spot = SDL_strchr(tok, '\n')) != nullptr) { - if (*spot == '\r') { - ++spot; - } - if (*spot == '\n') { - ++spot; - } - } else { - spot = end; - } - char *nextTok = spot; - - /* Get the longest string that will fit in the desired space */ - for (;;) { - /* Strip trailing whitespace */ - while (spot > tok && CharacterIsDelimiter(spot[-1])) { - --spot; - } - if (spot == tok) { - if (CharacterIsDelimiter(*spot)) { - *spot = '\0'; - } - break; - } - char delim = *spot; - *spot = '\0'; - - int w = 0; - int h = 0; - TTF_SizeUTF8(font, tok, &w, &h); - if ((Uint32)w <= wrapLength) { - break; - } - /* Back up and try again... */ - *spot = delim; - - while (spot > tok && !CharacterIsDelimiter(spot[-1])) { - --spot; - } - if (spot > tok) { - nextTok = spot; - } - } - tok = nextTok; - } while (tok < end); - } - - if (strLines.empty()) - return TTFWrap::RenderUTF8_Solid(font, text, fg); - - /* Create the target surface */ - auto textbuf = SDLWrap::CreateRGBSurface(SDL_SWSURFACE, (strLines.size() > 1) ? wrapLength : width, height * strLines.size() + (lineSpace * (strLines.size() - 1)), 8, 0, 0, 0, 0); - - /* Fill the palette with the foreground color */ - SDL_Palette *palette = textbuf->format->palette; - palette->colors[0].r = 255 - fg.r; - palette->colors[0].g = 255 - fg.g; - palette->colors[0].b = 255 - fg.b; - palette->colors[1].r = fg.r; - palette->colors[1].g = fg.g; - palette->colors[1].b = fg.b; - SDLC_SetColorKey(textbuf.get(), 0); - - // Reduced space between lines to roughly match Diablo. - const int lineskip = TTF_FontLineSkip(font) * 7 / 10; // avoids forced int > float > int conversion - SDL_Rect dest = { 0, 0, 0, 0 }; - for (auto text : strLines) { - if (*text == '\0') { - dest.y += lineskip; - continue; - } - SDLSurfaceUniquePtr tmp = TTFWrap::RenderUTF8_Solid(font, text, fg); - - dest.w = static_cast(tmp->w); - dest.h = static_cast(tmp->h); - - switch (xAlign) { - case TextAlignment_END: - dest.x = textbuf->w - tmp->w; - break; - case TextAlignment_CENTER: - dest.x = (textbuf->w - tmp->w) / 2; - break; - case TextAlignment_BEGIN: - dest.x = 0; - break; - } - SDL_BlitSurface(tmp.get(), nullptr, textbuf.get(), &dest); - dest.y += lineskip; - } - return textbuf; -} - -} // namespace devilution diff --git a/Source/DiabloUI/ttf_render_wrapped.h b/Source/DiabloUI/ttf_render_wrapped.h deleted file mode 100644 index e1aa8fcb8..000000000 --- a/Source/DiabloUI/ttf_render_wrapped.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include -#include -#include "utils/sdl_ptrs.h" - -namespace devilution { - -enum TextAlignment : uint8_t { - TextAlignment_BEGIN, - TextAlignment_CENTER, - TextAlignment_END, -}; - -/** - * Renders UTF-8, wrapping lines to avoid exceeding wrapLength, and aligning - * according to the `x_align` argument. - * - * This method is slow. Caching the result is recommended. - */ -SDLSurfaceUniquePtr RenderUTF8_Solid_Wrapped( - TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength, const int xAlign = TextAlignment_BEGIN); - -} // namespace devilution diff --git a/Source/DiabloUI/ui_item.h b/Source/DiabloUI/ui_item.h index d9e5f43b5..6b3de9f54 100644 --- a/Source/DiabloUI/ui_item.h +++ b/Source/DiabloUI/ui_item.h @@ -6,7 +6,6 @@ #include #include "DiabloUI/art.h" -#include "DiabloUI/text_draw.h" #include "utils/stubs.h" namespace devilution { @@ -31,31 +30,34 @@ enum class UiFlags { FontSize30 = 1 << 2, FontSize42 = 1 << 3, FontSize46 = 1 << 4, - - ColorUiGold = 1 << 5, - ColorUiSilver = 1 << 6, - ColorUiGoldDark = 1 << 7, - ColorUiSilverDark = 1 << 8, - ColorGold = 1 << 9, - ColorBlack = 1 << 10, - ColorWhite = 1 << 11, - ColorWhitegold = 1 << 12, - ColorRed = 1 << 13, - ColorBlue = 1 << 14, - ColorButtonface = 1 << 15, - ColorButtonpushed = 1 << 16, - - AlignCenter = 1 << 17, - AlignRight = 1 << 18, - VerticalCenter = 1 << 19, - - KerningFitSpacing = 1 << 20, - - ElementDisabled = 1 << 21, - ElementHidden = 1 << 22, - - PentaCursor = 1 << 23, - TextCursor = 1 << 24, + FontSizeDialog = 1 << 5, + + ColorUiGold = 1 << 6, + ColorUiSilver = 1 << 7, + ColorUiGoldDark = 1 << 8, + ColorUiSilverDark = 1 << 9, + ColorDialogWhite = 1 << 10, + ColorDialogYellow = 1 << 11, + ColorGold = 1 << 12, + ColorBlack = 1 << 13, + ColorWhite = 1 << 14, + ColorWhitegold = 1 << 15, + ColorRed = 1 << 16, + ColorBlue = 1 << 17, + ColorButtonface = 1 << 18, + ColorButtonpushed = 1 << 19, + + AlignCenter = 1 << 20, + AlignRight = 1 << 21, + VerticalCenter = 1 << 22, + + KerningFitSpacing = 1 << 23, + + ElementDisabled = 1 << 24, + ElementHidden = 1 << 25, + + PentaCursor = 1 << 26, + TextCursor = 1 << 27, // clang-format on }; @@ -271,26 +273,18 @@ public: //============================================================================= -// Plain text (TTF) +// Plain text class UiText : public UiItemBase { public: - UiText(const char *text, SDL_Rect rect, UiFlags flags = UiFlags::None, SDL_Color color = { 243, 243, 243, 0 }) + UiText(const char *text, SDL_Rect rect, UiFlags flags = UiFlags::ColorDialogWhite) : UiItemBase(UiType::Text, rect, flags) - , m_color(color) - , m_shadow_color({ 0, 0, 0, 0 }) , m_text(text) - , m_render_cache() { } //private: - SDL_Color m_color; - SDL_Color m_shadow_color; const char *m_text; - - // State: - TtfSurfaceCache m_render_cache; }; //============================================================================= @@ -305,7 +299,6 @@ public: , m_text(text) , m_action(action) , m_pressed(false) - , m_render_cache() { } @@ -322,7 +315,6 @@ public: // State bool m_pressed; - TtfSurfaceCache m_render_cache; }; //============================================================================= diff --git a/Source/appfat.h b/Source/appfat.h index 53d3facb1..15387846b 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -13,8 +13,6 @@ namespace devilution { #define ErrSdl() ErrDlg("SDL Error", SDL_GetError(), __FILE__, __LINE__) -#define ErrTtf() ErrDlg("TTF Error", TTF_GetError(), __FILE__, __LINE__) - #undef assert #ifndef _DEBUG diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 0a0e9899b..69b4c28f6 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -781,8 +781,6 @@ void RunGameLoop(interface_mode uMsg) printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--data-dir", _("Specify the folder of diabdat.mpq")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--save-dir", _("Specify the folder of save files")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--config-dir", _("Specify the location of diablo.ini")); - printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--ttf-dir", _("Specify the location of the .ttf font")); - printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--ttf-name", _("Specify the name of a custom .ttf font")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "-n", _("Skip startup videos")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "-f", _("Display frames per second")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "-x", _("Run in windowed mode")); @@ -833,10 +831,6 @@ void DiabloParseFlags(int argc, char **argv) paths::SetConfigPath(argv[++i]); } else if (strcasecmp("--lang-dir", argv[i]) == 0) { paths::SetLangPath(argv[++i]); - } else if (strcasecmp("--ttf-dir", argv[i]) == 0) { - paths::SetTtfPath(argv[++i]); - } else if (strcasecmp("--ttf-name", argv[i]) == 0) { - paths::SetTtfName(argv[++i]); } else if (strcasecmp("-n", argv[i]) == 0) { gbShowIntro = false; } else if (strcasecmp("-f", argv[i]) == 0) { @@ -986,8 +980,6 @@ void DiabloDeinit() init_cleanup(); if (was_window_init) dx_cleanup(); // Cleanup SDL surfaces stuff, so we have to do it before SDL_Quit(). - if (was_fonts_init) - FontsCleanup(); UnloadFonts(); if (SDL_WasInit(SDL_INIT_EVERYTHING & ~SDL_INIT_HAPTIC) != 0) SDL_Quit(); diff --git a/Source/diablo.h b/Source/diablo.h index 11c2d1738..11f1babc5 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -67,7 +67,6 @@ extern bool gbLoadGame; extern bool cineflag; extern int force_redraw; /* These are defined in fonts.h */ -extern bool was_fonts_init; extern void FontsCleanup(); extern int PauseMode; extern bool gbNestArt; diff --git a/Source/engine/render/text_render.cpp b/Source/engine/render/text_render.cpp index 7060a50ba..1c5dfb596 100644 --- a/Source/engine/render/text_render.cpp +++ b/Source/engine/render/text_render.cpp @@ -28,16 +28,19 @@ namespace { std::unordered_map Fonts; std::unordered_map> FontKerns; -std::array FontSizes = { 12, 24, 30, 42, 46 }; -std::array LineHeights = { 12, 26, 38, 42, 50 }; -std::array BaseLineOffset = { -3, -2, -3, -6, -7 }; +std::array FontSizes = { 12, 24, 30, 42, 46, 22 }; +std::array LineHeights = { 12, 26, 38, 42, 50, 22 }; +std::array BaseLineOffset = { -3, -2, -3, -6, -7, 3 }; -std::array ColorTranlations = { +std::array ColorTranlations = { "fonts\\goldui.trn", "fonts\\grayui.trn", "fonts\\golduis.trn", "fonts\\grayuis.trn", + nullptr, + "fonts\\yellowdialog.trn", + nullptr, "fonts\\black.trn", @@ -60,6 +63,8 @@ GameFontTables GetSizeFromFlags(UiFlags flags) return GameFont42; else if (HasAnyOf(flags, UiFlags::FontSize46)) return GameFont46; + else if (HasAnyOf(flags, UiFlags::FontSizeDialog)) + return FontSizeDialog; return GameFont12; } @@ -84,6 +89,10 @@ text_color GetColorFromFlags(UiFlags flags) return ColorUiGoldDark; else if (HasAnyOf(flags, UiFlags::ColorUiSilverDark)) return ColorUiSilverDark; + else if (HasAnyOf(flags, UiFlags::ColorDialogWhite)) + return ColorDialogWhite; + else if (HasAnyOf(flags, UiFlags::ColorDialogYellow)) + return ColorDialogYellow; else if (HasAnyOf(flags, UiFlags::ColorButtonface)) return ColorButtonface; else if (HasAnyOf(flags, UiFlags::ColorButtonpushed)) diff --git a/Source/engine/render/text_render.hpp b/Source/engine/render/text_render.hpp index 28aa0fbef..2aabe6afb 100644 --- a/Source/engine/render/text_render.hpp +++ b/Source/engine/render/text_render.hpp @@ -24,6 +24,7 @@ enum GameFontTables : uint8_t { GameFont30, GameFont42, GameFont46, + FontSizeDialog, }; enum text_color : uint8_t { @@ -32,6 +33,9 @@ enum text_color : uint8_t { ColorUiGoldDark, ColorUiSilverDark, + ColorDialogWhite, + ColorDialogYellow, + ColorGold, ColorBlack, diff --git a/Source/utils/paths.cpp b/Source/utils/paths.cpp index 8f353288d..7785e543c 100644 --- a/Source/utils/paths.cpp +++ b/Source/utils/paths.cpp @@ -11,14 +11,6 @@ #include "utils/sdl2_to_1_2_backports.h" #endif -#ifndef TTF_FONT_DIR -#define TTF_FONT_DIR "" -#endif - -#ifndef TTF_FONT_NAME -#define TTF_FONT_NAME "CharisSILB.ttf" -#endif - #ifndef MO_LANG_DIR #define MO_LANG_DIR "" #endif @@ -33,8 +25,6 @@ std::optional basePath; std::optional prefPath; std::optional configPath; std::optional langPath; -std::optional ttfPath; -std::optional ttfName; void AddTrailingSlash(std::string &path) { @@ -97,20 +87,6 @@ const std::string &LangPath() return *langPath; } -const std::string &TtfPath() -{ - if (!ttfPath) - ttfPath.emplace(TTF_FONT_DIR); - return *ttfPath; -} - -const std::string &TtfName() -{ - if (!ttfName) - ttfName.emplace(TTF_FONT_NAME); - return *ttfName; -} - void SetBasePath(const std::string &path) { basePath = path; @@ -135,17 +111,6 @@ void SetLangPath(const std::string &path) AddTrailingSlash(*langPath); } -void SetTtfPath(const std::string &path) -{ - ttfPath = path; - AddTrailingSlash(*ttfPath); -} - -void SetTtfName(const std::string &name) -{ - ttfName = name; -} - } // namespace paths } // namespace devilution diff --git a/Source/utils/paths.h b/Source/utils/paths.h index 02bd2fc44..b98c6690d 100644 --- a/Source/utils/paths.h +++ b/Source/utils/paths.h @@ -10,15 +10,11 @@ const std::string &BasePath(); const std::string &PrefPath(); const std::string &ConfigPath(); const std::string &LangPath(); -const std::string &TtfPath(); -const std::string &TtfName(); void SetBasePath(const std::string &path); void SetPrefPath(const std::string &path); void SetConfigPath(const std::string &path); void SetLangPath(const std::string &path); -void SetTtfPath(const std::string &path); -void SetTtfName(const std::string &name); } // namespace paths diff --git a/Source/utils/ttf_wrap.h b/Source/utils/ttf_wrap.h deleted file mode 100644 index f16c4bd9a..000000000 --- a/Source/utils/ttf_wrap.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include -#include -#ifdef USE_SDL1 -#include "utils/sdl2_to_1_2_backports.h" -#else -#include "utils/sdl2_backports.h" -#endif - -#include "appfat.h" -#include "utils/sdl_ptrs.h" - -namespace devilution { - -namespace TTFWrap { - -inline SDLSurfaceUniquePtr RenderUTF8_Solid(TTF_Font *font, const char *text, SDL_Color fg) -{ - SDLSurfaceUniquePtr ret { TTF_RenderUTF8_Solid(font, text, fg) }; - if (ret == nullptr) - ErrTtf(); - - return ret; -} - -} //namespace TTFWrap - -} //namespace devilution diff --git a/android-project/3rdParty/SDL2_ttf/CMakeLists.txt b/android-project/3rdParty/SDL2_ttf/CMakeLists.txt deleted file mode 100644 index 17731d2f3..000000000 --- a/android-project/3rdParty/SDL2_ttf/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(BUILD_SHARED_LIBS ON) - -include(FetchContent_MakeAvailableExcludeFromAll) -include(FetchContent) - -FetchContent_Declare(SDL2_ttf - URL https://github.com/libsdl-org/SDL_ttf/archive/33cdd1881e31184b49a68b4890d1d256fc0c6dc1.tar.gz - URL_HASH MD5=7cfa28e6170618acf50d6a9cd27091ab -) -FetchContent_MakeAvailableExcludeFromAll(SDL2_ttf) - -# SDL2_ttf only provides an INSTALL_INTERFACE directory -# so use the source directory for the BUILD_INTERFACE -target_include_directories(SDL2_ttf PUBLIC $) - -add_library(SDL2::SDL2_ttf ALIAS SDL2_ttf) \ No newline at end of file diff --git a/android-project/CMake/FindFreetype.cmake b/android-project/CMake/FindFreetype.cmake deleted file mode 100644 index 51e6b1ee1..000000000 --- a/android-project/CMake/FindFreetype.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# Use globbing to find the source directory regardless of the version number -file(GLOB freetype_SOURCE_DIR ${SDL_ttf_SOURCE_DIR}/external/freetype*) -add_subdirectory(${freetype_SOURCE_DIR}) - -# freetype only provides an INSTALL_INTERFACE directory -# so use the source directory for the BUILD_INTERFACE -target_include_directories(freetype PUBLIC $) - -add_library(Freetype::Freetype ALIAS freetype) \ No newline at end of file diff --git a/android-project/CMake/android_defs.cmake b/android-project/CMake/android_defs.cmake index ff272e37e..7aa6d58c0 100644 --- a/android-project/CMake/android_defs.cmake +++ b/android-project/CMake/android_defs.cmake @@ -11,12 +11,5 @@ if(BINARY_RELEASE OR CMAKE_BUILD_TYPE STREQUAL "Release") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto=full") endif() -#additional compilation definitions -set(TTF_FONT_DIR \"\") - -file( - COPY "${DevilutionX_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf" - DESTINATION "${DevilutionX_SOURCE_DIR}/android-project/app/src/main/assets") - file(GLOB VirtualGamepadArt "${DevilutionX_SOURCE_DIR}/Packaging/resources/assets/ui_art/*") file(COPY ${VirtualGamepadArt} DESTINATION "${DevilutionX_SOURCE_DIR}/android-project/app/src/main/assets/ui_art") diff --git a/docs/building.md b/docs/building.md index 4a3174bc6..45acd654d 100644 --- a/docs/building.md +++ b/docs/building.md @@ -12,11 +12,11 @@ although we have a fallback if necessary. ### Installing dependencies on Debian and Ubuntu ``` -sudo apt-get install cmake g++ libsdl2-ttf-dev libsodium-dev libpng-dev +sudo apt-get install cmake g++ libsdl2-dev libsodium-dev libpng-dev ``` ### Installing dependencies on Fedora ``` -sudo dnf install cmake gcc-c++ glibc-devel SDL2-devel SDL2_ttf-devel libsodium-devel libpng-devel libasan libubsan +sudo dnf install cmake gcc-c++ glibc-devel SDL2-devel libsodium-devel libpng-devel libasan libubsan ``` ### Compiling ``` @@ -41,7 +41,7 @@ cmake --build . -j $(sysctl -n hw.physicalcpu) ### Installing dependencies ``` -pkg install cmake sdl2_ttf libsodium libpng +pkg install cmake sdl2 libsodium libpng ``` ### Compiling ``` @@ -54,7 +54,7 @@ cmake --build . -j $(sysctl -n hw.ncpu) ### Installing dependencies ``` -pkgin install cmake SDL2_ttf libsodium libpng +pkgin install cmake SDL2 libsodium libpng ``` ### Compiling ``` @@ -68,7 +68,7 @@ cmake --build . -j $(sysctl -n hw.ncpu) ### Installing dependencies ``` -pkg_add cmake sdl2-ttf libsodium libpng gmake +pkg_add cmake sdl2 libsodium libpng gmake ``` ### Compiling ``` @@ -84,7 +84,7 @@ cmake --build . -j $(sysctl -n hw.ncpuonline) ### 32-bit -Download the 32bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php), [SDL2_ttf](https://www.libsdl.org/projects/SDL_ttf/) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.11.tar.gz) and place them in `/usr/i686-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep.sh`. +Download the 32bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.11.tar.gz) and place them in `/usr/i686-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep.sh`. ``` sudo apt-get install cmake gcc-mingw-w64-i686 g++-mingw-w64-i686 pkg-config-mingw-w64-i686 @@ -92,7 +92,7 @@ sudo apt-get install cmake gcc-mingw-w64-i686 g++-mingw-w64-i686 pkg-config-ming ### 64-bit -Download the 64bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php), [SDL2_ttf](https://www.libsdl.org/projects/SDL_ttf/) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.11.tar.gz) and place them in `/usr/x86_64-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep64.sh`. +Download the 64bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.11.tar.gz) and place them in `/usr/x86_64-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep64.sh`. ``` sudo apt-get install cmake gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 pkg-config-mingw-w64-x86-64 @@ -190,7 +190,7 @@ https://devkitpro.org/wiki/Getting_Started ``` sudo (dkp-)pacman -S \ devkitARM general-tools 3dstools devkitpro-pkgbuild-helpers \ - libctru citro3d 3ds-sdl 3ds-sdl_ttf 3ds-freetype 3ds-libpng \ + libctru citro3d 3ds-sdl 3ds-libpng \ 3ds-cmake 3ds-pkg-config picasso 3dslink ``` - Download or compile [bannertool](https://github.com/Steveice10/bannertool/releases) and [makerom](https://github.com/jakcron/Project_CTR/releases) @@ -226,11 +226,11 @@ make ### Installing dependencies on 32 bit Haiku ``` -pkgman install cmake_x86 devel:libsdl2_x86 devel:libsdl2_ttf_x86 devel:libsodium_x86 devel:libpng_x86 +pkgman install cmake_x86 devel:libsdl2_x86 devel:libsodium_x86 devel:libpng_x86 ``` ### Installing dependencies on 64 bit Haiku ``` -pkgman install cmake devel:libsdl2 devel:libsdl2_ttf devel:libsodium devel:libpng +pkgman install cmake devel:libsdl2 devel:libsodium devel:libpng ``` ### Compiling on 32 bit Haiku ``` @@ -321,7 +321,7 @@ Outside of the Docker container, from the DevilutionX directory, run: ~~~ bash sudo chown -R "${USER}:" build-amiga -cp Packaging/amiga/devilutionx.info Packaging/amiga/LiberationSerif-Bold.ttf build-amiga/ +cp Packaging/amiga/devilutionx.info build-amiga/ ~~~ To actually start DevilutionX, increase the stack size to 50KiB in Amiga. diff --git a/vcpkg.json b/vcpkg.json index 254deda9e..2422129e1 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -3,11 +3,9 @@ "version-string": "1.2.1", "dependencies": [ "fmt", - "freetype", "libpng", "libsodium", - "sdl2", - "sdl2-ttf" + "sdl2" ], "features": { "translations": { @@ -24,4 +22,4 @@ "dependencies": [ "gtest" ] } } -} \ No newline at end of file +}