mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 07:52:31 +00:00
imgui: changed config & log file path to use portable dir
This commit is contained in:
parent
d6c0943720
commit
7c7b85ed7f
@ -4,6 +4,7 @@
|
|||||||
#include <SDL3/SDL_events.h>
|
#include <SDL3/SDL_events.h>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
|
#include "common/path_util.h"
|
||||||
#include "imgui/imgui_layer.h"
|
#include "imgui/imgui_layer.h"
|
||||||
#include "imgui_core.h"
|
#include "imgui_core.h"
|
||||||
#include "imgui_impl_sdl3.h"
|
#include "imgui_impl_sdl3.h"
|
||||||
@ -30,12 +31,18 @@ namespace Core {
|
|||||||
void Initialize(const ::Vulkan::Instance& instance, const Frontend::WindowSDL& window,
|
void Initialize(const ::Vulkan::Instance& instance, const Frontend::WindowSDL& window,
|
||||||
const u32 image_count, vk::Format surface_format,
|
const u32 image_count, vk::Format surface_format,
|
||||||
const vk::AllocationCallbacks* allocator) {
|
const vk::AllocationCallbacks* allocator) {
|
||||||
|
|
||||||
|
const auto config_path = GetUserPath(Common::FS::PathType::UserDir) / "imgui.ini";
|
||||||
|
const auto log_path = GetUserPath(Common::FS::PathType::LogDir) / "imgui_log.txt";
|
||||||
|
|
||||||
CreateContext();
|
CreateContext();
|
||||||
ImGuiIO& io = GetIO();
|
ImGuiIO& io = GetIO();
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||||
io.DisplaySize = ImVec2((float)window.getWidth(), (float)window.getHeight());
|
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());
|
||||||
StyleColorsDark();
|
StyleColorsDark();
|
||||||
|
|
||||||
Sdl::Init(window.GetSdlWindow());
|
Sdl::Init(window.GetSdlWindow());
|
||||||
@ -65,9 +72,16 @@ void OnResize() {
|
|||||||
void Shutdown(const vk::Device& device) {
|
void Shutdown(const vk::Device& device) {
|
||||||
device.waitIdle();
|
device.waitIdle();
|
||||||
|
|
||||||
|
const ImGuiIO& io = GetIO();
|
||||||
|
const auto ini_filename = (void*)io.IniFilename;
|
||||||
|
const auto log_filename = (void*)io.LogFilename;
|
||||||
|
|
||||||
Vulkan::Shutdown();
|
Vulkan::Shutdown();
|
||||||
Sdl::Shutdown();
|
Sdl::Shutdown();
|
||||||
DestroyContext();
|
DestroyContext();
|
||||||
|
|
||||||
|
SDL_free(ini_filename);
|
||||||
|
SDL_free(log_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProcessEvent(SDL_Event* event) {
|
bool ProcessEvent(SDL_Event* event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user