mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-20 15:02:20 +00:00
Merge 9f4f3f96a4 into ada0db62dc
This commit is contained in:
commit
88f33c5e88
3 changed files with 19 additions and 6 deletions
|
|
@ -8,6 +8,11 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
option(UNLEASHED_RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF)
|
option(UNLEASHED_RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Undefine this to generate a font atlas file in working directory.
|
||||||
|
# You also need to do this if you are testing localization, as only
|
||||||
|
# characters in the locale get added to the atlas.
|
||||||
|
option(UNLEASHED_RECOMP_ENABLE_IM_FONT_ATLAS_SNAPSHOT "Use font atlas snapshot instead of generating one." ON)
|
||||||
|
|
||||||
function(BIN2C)
|
function(BIN2C)
|
||||||
cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN})
|
cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN})
|
||||||
|
|
||||||
|
|
@ -324,6 +329,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
target_compile_definitions(UnleashedRecomp PRIVATE SDL_VULKAN_ENABLED)
|
target_compile_definitions(UnleashedRecomp PRIVATE SDL_VULKAN_ENABLED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (UNLEASHED_RECOMP_ENABLE_IM_FONT_ATLAS_SNAPSHOT)
|
||||||
|
target_compile_definitions(UnleashedRecomp PRIVATE -DENABLE_IM_FONT_ATLAS_SNAPSHOT)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(directx-dxc REQUIRED)
|
find_package(directx-dxc REQUIRED)
|
||||||
find_package(CURL REQUIRED)
|
find_package(CURL REQUIRED)
|
||||||
|
|
||||||
|
|
@ -365,7 +374,6 @@ endif()
|
||||||
target_link_libraries(UnleashedRecomp PRIVATE
|
target_link_libraries(UnleashedRecomp PRIVATE
|
||||||
fmt::fmt
|
fmt::fmt
|
||||||
libzstd_static
|
libzstd_static
|
||||||
msdf-atlas-gen::msdf-atlas-gen
|
|
||||||
nfd::nfd
|
nfd::nfd
|
||||||
o1heap
|
o1heap
|
||||||
XenonUtils
|
XenonUtils
|
||||||
|
|
@ -377,6 +385,12 @@ target_link_libraries(UnleashedRecomp PRIVATE
|
||||||
CURL::libcurl
|
CURL::libcurl
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (NOT UNLEASHED_RECOMP_ENABLE_IM_FONT_ATLAS_SNAPSHOT)
|
||||||
|
target_link_libraries(UnleashedRecomp PRIVATE
|
||||||
|
msdf-atlas-gen::msdf-atlas-gen
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(UnleashedRecomp PRIVATE
|
target_include_directories(UnleashedRecomp PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/api"
|
"${CMAKE_CURRENT_SOURCE_DIR}/api"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "imgui_font_builder.h"
|
#include "imgui_font_builder.h"
|
||||||
|
|
||||||
|
#ifndef ENABLE_IM_FONT_ATLAS_SNAPSHOT
|
||||||
|
|
||||||
#include <msdf-atlas-gen/msdf-atlas-gen.h>
|
#include <msdf-atlas-gen/msdf-atlas-gen.h>
|
||||||
|
|
||||||
// Taken directly from msdf-atlas-gen, modified to support custom rectangles.
|
// Taken directly from msdf-atlas-gen, modified to support custom rectangles.
|
||||||
|
|
@ -321,3 +323,5 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
|
||||||
}
|
}
|
||||||
|
|
||||||
ImFontBuilderIO g_fontBuilderIO = { FontBuilder_Build };
|
ImFontBuilderIO g_fontBuilderIO = { FontBuilder_Build };
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Undefine this to generate a font atlas file in working directory.
|
|
||||||
// You also need to do this if you are testing localization, as only
|
|
||||||
// characters in the locale get added to the atlas.
|
|
||||||
#define ENABLE_IM_FONT_ATLAS_SNAPSHOT
|
|
||||||
|
|
||||||
struct ImFontAtlasSnapshot
|
struct ImFontAtlasSnapshot
|
||||||
{
|
{
|
||||||
std::vector<uint8_t> data;
|
std::vector<uint8_t> data;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue