From e225a64b62b726f4917fab152b1c3e4b4303a6ee Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Sat, 8 Sep 2018 22:51:53 +0200 Subject: [PATCH] Address review comments --- externals/CMakeLists.txt | 2 +- src/core/hle/service/ns/pl_u.cpp | 36 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 2d502eb421..3d8e10c2b5 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -44,7 +44,7 @@ add_library(microprofile INTERFACE) target_include_directories(microprofile INTERFACE ./microprofile) # Open Source Archives -add_subdirectory(open_source_archives) +add_subdirectory(open_source_archives EXCLUDE_FROM_ALL) # Unicorn add_library(unicorn-headers INTERFACE) diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index ada44ef19a..77f635ae29 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp @@ -2,6 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include +#include +#include +#include +#include +#include + #include "common/common_paths.h" #include "common/file_util.h" #include "core/core.h" @@ -13,13 +20,6 @@ #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/ns/pl_u.h" -#include "FontChineseSimplified.ttf.h" -#include "FontChineseTraditional.ttf.h" -#include "FontExtendedChineseSimplified.ttf.h" -#include "FontKorean.ttf.h" -#include "FontNintendoExtended.ttf.h" -#include "FontStandard.ttf.h" - namespace Service::NS { enum class FontArchives : u64 { @@ -228,18 +228,18 @@ PL_U::PL_U() : ServiceFramework("pl:u") { LOG_WARNING(Service_NS, "Shared Font file missing. Loading open source replacement from memory"); - std::vector> open_source_shared_fonts_ttf; - // clang-format off - open_source_shared_fonts_ttf.push_back(std::vector(std::begin(FontChineseSimplified), std::end(FontChineseSimplified))); - open_source_shared_fonts_ttf.push_back(std::vector(std::begin(FontChineseTraditional), std::end(FontChineseTraditional))); - open_source_shared_fonts_ttf.push_back(std::vector(std::begin(FontExtendedChineseSimplified),std::end(FontExtendedChineseSimplified))); - open_source_shared_fonts_ttf.push_back(std::vector(std::begin(FontKorean), std::end(FontKorean))); - open_source_shared_fonts_ttf.push_back(std::vector(std::begin(FontNintendoExtended), std::end(FontNintendoExtended))); - open_source_shared_fonts_ttf.push_back(std::vector(std::begin(FontStandard), std::end(FontStandard))); - // clang-format on + const std::vector> open_source_shared_fonts_ttf = { + {std::begin(FontChineseSimplified), std::end(FontChineseSimplified)}, + {std::begin(FontChineseTraditional), std::end(FontChineseTraditional)}, + {std::begin(FontExtendedChineseSimplified), + std::end(FontExtendedChineseSimplified)}, + {std::begin(FontNintendoExtended), std::end(FontNintendoExtended)}, + {std::begin(FontStandard), std::end(FontStandard)}, + }; - for (std::vector font_ttf : open_source_shared_fonts_ttf) { - FontRegion region{static_cast(offset + 8), static_cast(font_ttf.size())}; + for (const std::vector& font_ttf : open_source_shared_fonts_ttf) { + const FontRegion region{static_cast(offset + 8), + static_cast(font_ttf.size())}; EncryptSharedFont(font_ttf, *shared_font, offset); SHARED_FONT_REGIONS.push_back(region); }