mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-04 17:53:17 +00:00
Save fixes (#1031)
* Add ElfInfo to track current game info in a singleton * SaveData compatibility with old firmwares * sceKernelOpen: fix for write-only mode * imgui: add font to render non-ascii characters * save_data: fix Backup Job including old backup in the new backup * Save backup: fix to avoid filling the queue Also limiting 1 backup / 10sec * Save backup: fix search not handling empty pattern *backup time improv
This commit is contained in:
parent
a5001d11a8
commit
10d29cc007
17 changed files with 421 additions and 105 deletions
32
src/imgui/renderer/CMakeLists.txt
Normal file
32
src/imgui/renderer/CMakeLists.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
project(ImGui_Resources)
|
||||
|
||||
add_executable(Dear_ImGui_FontEmbed ${CMAKE_SOURCE_DIR}/externals/dear_imgui/misc/fonts/binary_to_compressed_c.cpp)
|
||||
|
||||
set(FONT_LIST
|
||||
NotoSansJP-Regular.ttf
|
||||
)
|
||||
|
||||
set(OutputList "")
|
||||
FOREACH (FONT_FILE ${FONT_LIST})
|
||||
string(REGEX REPLACE "-" "_" fontname ${FONT_FILE})
|
||||
string(TOLOWER ${fontname} fontname)
|
||||
string(REGEX REPLACE ".ttf" "" fontname_cpp ${fontname})
|
||||
set(fontname_cpp "imgui_font_${fontname_cpp}")
|
||||
|
||||
MESSAGE(STATUS "Embedding font ${FONT_FILE}")
|
||||
set(OUTPUT "generated_fonts/imgui_fonts/${fontname}")
|
||||
add_custom_command(
|
||||
OUTPUT "${OUTPUT}.g.cpp"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "generated_fonts/imgui_fonts"
|
||||
COMMAND $<TARGET_FILE:Dear_ImGui_FontEmbed> -nostatic "${CMAKE_CURRENT_SOURCE_DIR}/fonts/${FONT_FILE}" ${fontname_cpp} > "${OUTPUT}.g.cpp"
|
||||
DEPENDS Dear_ImGui_FontEmbed "fonts/${FONT_FILE}"
|
||||
USES_TERMINAL
|
||||
)
|
||||
list(APPEND OutputList "${OUTPUT}.g.cpp")
|
||||
ENDFOREACH ()
|
||||
|
||||
add_library(ImGui_Resources STATIC ${OutputList})
|
||||
set(IMGUI_RESOURCES_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/generated_fonts PARENT_SCOPE)
|
BIN
src/imgui/renderer/fonts/NotoSansJP-Regular.ttf
Normal file
BIN
src/imgui/renderer/fonts/NotoSansJP-Regular.ttf
Normal file
Binary file not shown.
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <SDL3/SDL_events.h>
|
||||
#include <imgui.h>
|
||||
|
||||
#include "common/config.h"
|
||||
#include "common/path_util.h"
|
||||
#include "imgui/imgui_layer.h"
|
||||
|
@ -14,6 +15,8 @@
|
|||
#include "texture_manager.h"
|
||||
#include "video_core/renderer_vulkan/renderer_vulkan.h"
|
||||
|
||||
#include "imgui_fonts/notosansjp_regular.ttf.g.cpp"
|
||||
|
||||
static void CheckVkResult(const vk::Result err) {
|
||||
LOG_ERROR(ImGui, "Vulkan error {}", vk::to_string(err));
|
||||
}
|
||||
|
@ -50,6 +53,22 @@ void Initialize(const ::Vulkan::Instance& instance, const Frontend::WindowSDL& w
|
|||
io.DisplaySize = ImVec2((float)window.getWidth(), (float)window.getHeight());
|
||||
io.IniFilename = SDL_strdup(config_path.string().c_str());
|
||||
io.LogFilename = SDL_strdup(log_path.string().c_str());
|
||||
|
||||
ImFontGlyphRangesBuilder rb{};
|
||||
rb.AddRanges(io.Fonts->GetGlyphRangesDefault());
|
||||
rb.AddRanges(io.Fonts->GetGlyphRangesGreek());
|
||||
rb.AddRanges(io.Fonts->GetGlyphRangesKorean());
|
||||
rb.AddRanges(io.Fonts->GetGlyphRangesJapanese());
|
||||
rb.AddRanges(io.Fonts->GetGlyphRangesCyrillic());
|
||||
ImVector<ImWchar> ranges{};
|
||||
rb.BuildRanges(&ranges);
|
||||
ImFontConfig font_cfg{};
|
||||
font_cfg.OversampleH = 2;
|
||||
font_cfg.OversampleV = 1;
|
||||
io.Fonts->AddFontFromMemoryCompressedTTF(imgui_font_notosansjp_regular_compressed_data,
|
||||
imgui_font_notosansjp_regular_compressed_size, 16.0f,
|
||||
&font_cfg, ranges.Data);
|
||||
|
||||
StyleColorsDark();
|
||||
|
||||
Sdl::Init(window.GetSdlWindow());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue