From 71d00a432786be857284f8f4d80cd09d64fd9975 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Sat, 25 Jun 2022 21:19:12 +0200 Subject: [PATCH] Remove unused functions --- src/core/host_display.h | 8 -------- src/core/host_interface.cpp | 15 --------------- src/core/host_interface.h | 12 ------------ src/libretro/libretro_d3d11_host_display.cpp | 17 ++--------------- src/libretro/libretro_d3d11_host_display.h | 3 --- src/libretro/libretro_host_display.cpp | 10 ---------- src/libretro/libretro_host_display.h | 3 --- src/libretro/libretro_host_interface.cpp | 15 --------------- src/libretro/libretro_host_interface.h | 6 ------ src/libretro/libretro_opengl_host_display.cpp | 16 ++-------------- src/libretro/libretro_opengl_host_display.h | 3 --- src/libretro/libretro_vulkan_host_display.cpp | 10 ---------- src/libretro/libretro_vulkan_host_display.h | 3 --- 13 files changed, 4 insertions(+), 117 deletions(-) diff --git a/src/core/host_display.h b/src/core/host_display.h index ef3a8844..d7d7e21f 100644 --- a/src/core/host_display.h +++ b/src/core/host_display.h @@ -56,12 +56,6 @@ public: RightOrBottom }; - struct AdapterAndModeList - { - std::vector adapter_names; - std::vector fullscreen_modes; - }; - virtual ~HostDisplay(); ALWAYS_INLINE s32 GetWindowWidth() const { return static_cast(m_window_info.surface_width); } @@ -84,8 +78,6 @@ public: bool threaded_presentation) = 0; virtual bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device, bool threaded_presentation) = 0; - virtual bool MakeRenderContextCurrent() = 0; - virtual bool DoneRenderContextCurrent() = 0; virtual void DestroyRenderDevice() = 0; virtual void DestroyRenderSurface() = 0; virtual bool ChangeRenderWindow(const WindowInfo& wi) = 0; diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 5c4a8d0b..78bd4b9f 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -79,14 +79,12 @@ bool HostInterface::BootSystem(std::shared_ptr parameters) g_host_interface->TranslateString("System", "System failed to boot. The log may contain more information.")); } - OnSystemDestroyed(); m_audio_stream.reset(); ReleaseHostDisplay(); return false; } UpdateSoftwareCursor(); - OnSystemCreated(); m_audio_stream->PauseOutput(false); return true; @@ -107,8 +105,6 @@ void HostInterface::PauseSystem(bool paused) if (!paused) m_audio_stream->EmptyBuffers(); m_audio_stream->PauseOutput(paused); - - OnSystemPaused(paused); } void HostInterface::DestroySystem() @@ -120,7 +116,6 @@ void HostInterface::DestroySystem() m_audio_stream.reset(); UpdateSoftwareCursor(); ReleaseHostDisplay(); - OnSystemDestroyed(); } void HostInterface::ReportError(const char* message) @@ -194,16 +189,6 @@ void HostInterface::AddFormattedOSDMessage(float duration, const char* format, . AddOSDMessage(std::move(message), duration); } -void HostInterface::AddKeyedFormattedOSDMessage(std::string key, float duration, const char* format, ...) -{ - std::va_list ap; - va_start(ap, format); - std::string message = StringUtil::StdStringFromFormatV(format, ap); - va_end(ap); - - AddKeyedOSDMessage(std::move(key), std::move(message), duration); -} - std::string HostInterface::GetBIOSDirectory() { std::string dir = GetStringSettingValue("BIOS", "SearchDirectory", ""); diff --git a/src/core/host_interface.h b/src/core/host_interface.h index 344db023..81495a8b 100644 --- a/src/core/host_interface.h +++ b/src/core/host_interface.h @@ -68,10 +68,7 @@ public: /// Adds OSD messages, duration is in seconds. virtual void AddOSDMessage(std::string message, float duration = 2.0f) = 0; - virtual void AddKeyedOSDMessage(std::string key, std::string message, float duration = 2.0f) = 0; - virtual void RemoveKeyedOSDMessage(std::string key) = 0; void AddFormattedOSDMessage(float duration, const char* format, ...) printflike(3, 4); - void AddKeyedFormattedOSDMessage(std::string key, float duration, const char* format, ...) printflike(4, 5); /// Returns the base user directory path. ALWAYS_INLINE const std::string& GetUserDirectory() const { return m_user_directory; } @@ -82,9 +79,6 @@ public: /// Returns a path relative to the application directory (for system files). std::string GetProgramDirectoryRelativePath(const char* format, ...) const printflike(2, 3); - /// Returns a string which can be used as part of a filename, based on the current date/time. - static TinyString GetTimestampStringForFileName(); - /// Displays a loading screen with the logo, rendered with ImGui. Use when executing possibly-time-consuming tasks /// such as compiling shaders when starting up. virtual void DisplayLoadingScreen(const char* message, int progress_min = -1, int progress_max = -1, @@ -117,9 +111,6 @@ public: /// Returns a float setting from the configuration. virtual float GetFloatSettingValue(const char* section, const char* key, float default_value = 0.0f); - /// Returns a string list from the configuration. - virtual std::vector GetSettingStringList(const char* section, const char* key) = 0; - /// Translates a string to the current language. virtual TinyString TranslateString(const char* context, const char* str, const char* disambiguation = nullptr, int n = -1) const; @@ -143,9 +134,6 @@ protected: virtual void ReleaseHostDisplay() = 0; virtual std::unique_ptr CreateAudioStream() = 0; - virtual void OnSystemCreated() = 0; - virtual void OnSystemPaused(bool paused) = 0; - virtual void OnSystemDestroyed() = 0; virtual void OnControllerTypeChanged(u32 slot) = 0; /// Loads settings to m_settings and any frontend-specific parameters. diff --git a/src/libretro/libretro_d3d11_host_display.cpp b/src/libretro/libretro_d3d11_host_display.cpp index 05139f31..c13d7f6d 100644 --- a/src/libretro/libretro_d3d11_host_display.cpp +++ b/src/libretro/libretro_d3d11_host_display.cpp @@ -181,12 +181,9 @@ bool LibretroD3D11HostDisplay::CreateRenderDevice(const WindowInfo& wi, std::str } bool LibretroD3D11HostDisplay::InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device, - bool threaded_presentation) + bool threaded_presentation) { - if (!CreateResources()) - return false; - - return true; + return CreateResources(); } void LibretroD3D11HostDisplay::DestroyRenderDevice() @@ -198,16 +195,6 @@ void LibretroD3D11HostDisplay::DestroyRenderDevice() m_device.Reset(); } -bool LibretroD3D11HostDisplay::MakeRenderContextCurrent() -{ - return true; -} - -bool LibretroD3D11HostDisplay::DoneRenderContextCurrent() -{ - return true; -} - void LibretroD3D11HostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height) { m_window_info.surface_width = static_cast(new_window_width); diff --git a/src/libretro/libretro_d3d11_host_display.h b/src/libretro/libretro_d3d11_host_display.h index ac16d611..1dfc9a1f 100644 --- a/src/libretro/libretro_d3d11_host_display.h +++ b/src/libretro/libretro_d3d11_host_display.h @@ -23,9 +23,6 @@ public: bool threaded_presentation) override; void DestroyRenderDevice() override; - bool MakeRenderContextCurrent() override; - bool DoneRenderContextCurrent() override; - void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override; bool ChangeRenderWindow(const WindowInfo& new_wi) override; diff --git a/src/libretro/libretro_host_display.cpp b/src/libretro/libretro_host_display.cpp index 680ec245..029ff892 100644 --- a/src/libretro/libretro_host_display.cpp +++ b/src/libretro/libretro_host_display.cpp @@ -77,16 +77,6 @@ bool LibretroHostDisplay::InitializeRenderDevice(std::string_view shader_cache_d return true; } -bool LibretroHostDisplay::MakeRenderContextCurrent() -{ - return true; -} - -bool LibretroHostDisplay::DoneRenderContextCurrent() -{ - return true; -} - void LibretroHostDisplay::DestroyRenderDevice() { ClearSoftwareCursor(); diff --git a/src/libretro/libretro_host_display.h b/src/libretro/libretro_host_display.h index b6b8bbc0..5f8efc8e 100644 --- a/src/libretro/libretro_host_display.h +++ b/src/libretro/libretro_host_display.h @@ -18,9 +18,6 @@ public: bool threaded_presentation) override; void DestroyRenderDevice() override; - bool MakeRenderContextCurrent() override; - bool DoneRenderContextCurrent() override; - bool ChangeRenderWindow(const WindowInfo& wi) override; void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override; void DestroyRenderSurface() override; diff --git a/src/libretro/libretro_host_interface.cpp b/src/libretro/libretro_host_interface.cpp index 435bced4..05f7782a 100644 --- a/src/libretro/libretro_host_interface.cpp +++ b/src/libretro/libretro_host_interface.cpp @@ -311,10 +311,6 @@ void LibretroHostInterface::AddOSDMessage(std::string message, float duration /* g_retro_environment_callback(RETRO_ENVIRONMENT_SET_MESSAGE, &msg); } -void LibretroHostInterface::AddKeyedOSDMessage(std::string key, std::string message, float duration /* = 2.0f */) {} - -void LibretroHostInterface::RemoveKeyedOSDMessage(std::string key) {} - void LibretroHostInterface::retro_get_system_av_info(struct retro_system_av_info* info) { const bool use_resolution_scale = (g_settings.gpu_renderer != GPURenderer::Software); @@ -690,12 +686,6 @@ std::unique_ptr LibretroHostInterface::CreateAudioStream() { return std::make_unique(); } -void LibretroHostInterface::OnSystemCreated() {} - -void LibretroHostInterface::OnSystemPaused(bool paused) {} - -void LibretroHostInterface::OnSystemDestroyed() {} - void LibretroHostInterface::OnControllerTypeChanged(u32 slot) {} void LibretroHostInterface::SetMouseMode(bool relative, bool hide_cursor) {} @@ -958,11 +948,6 @@ void LibretroHostInterface::LoadSettings() } -std::vector LibretroHostInterface::GetSettingStringList(const char* section, const char* key) -{ - return {}; -} - void LibretroHostInterface::UpdateSettings() { Settings old_settings(std::move(g_settings)); diff --git a/src/libretro/libretro_host_interface.h b/src/libretro/libretro_host_interface.h index 948eb3c6..25ae33c8 100644 --- a/src/libretro/libretro_host_interface.h +++ b/src/libretro/libretro_host_interface.h @@ -40,8 +40,6 @@ public: void ReportMessage(const char* message) override; bool ConfirmMessage(const char* message) override; void AddOSDMessage(std::string message, float duration = 2.0f) override; - void AddKeyedOSDMessage(std::string key, std::string message, float duration = 2.0f) override; - void RemoveKeyedOSDMessage(std::string key) override; void DisplayLoadingScreen(const char* message, int progress_min = -1, int progress_max = -1, int progress_value = -1) override; @@ -50,7 +48,6 @@ public: std::string GetGameMemoryCardPath(const char* game_code, u32 slot) const override; std::string GetShaderCacheBasePath() const override; std::string GetStringSettingValue(const char* section, const char* key, const char* default_value = "") override; - std::vector GetSettingStringList(const char* section, const char* key) override; std::string GetBIOSDirectory() override; bool UpdateSystemAVInfo(bool use_resolution_scale); @@ -76,9 +73,6 @@ protected: void AcquireHostDisplay() override; void ReleaseHostDisplay() override; std::unique_ptr CreateAudioStream() override; - void OnSystemCreated() override; - void OnSystemPaused(bool paused) override; - void OnSystemDestroyed() override; void CheckForSettingsChanges(const Settings& old_settings) override; void OnRunningGameChanged(const std::string& path, CDImage* image, const std::string& game_code, const std::string& game_title) override; diff --git a/src/libretro/libretro_opengl_host_display.cpp b/src/libretro/libretro_opengl_host_display.cpp index 49511909..acb6629d 100644 --- a/src/libretro/libretro_opengl_host_display.cpp +++ b/src/libretro/libretro_opengl_host_display.cpp @@ -314,7 +314,7 @@ bool LibretroOpenGLHostDisplay::CreateRenderDevice(const WindowInfo& wi, std::st } bool LibretroOpenGLHostDisplay::InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device, - bool threaded_presentation) + bool threaded_presentation) { glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, reinterpret_cast(&m_uniform_buffer_alignment)); @@ -328,19 +328,7 @@ bool LibretroOpenGLHostDisplay::InitializeRenderDevice(std::string_view shader_c glEnable(GL_DEBUG_OUTPUT); } - if (!CreateResources()) - return false; - return true; -} - -bool LibretroOpenGLHostDisplay::MakeRenderContextCurrent() -{ - return true; -} - -bool LibretroOpenGLHostDisplay::DoneRenderContextCurrent() -{ - return true; + return CreateResources(); } void LibretroOpenGLHostDisplay::DestroyRenderDevice() diff --git a/src/libretro/libretro_opengl_host_display.h b/src/libretro/libretro_opengl_host_display.h index 741dcbd3..5b51b3ee 100644 --- a/src/libretro/libretro_opengl_host_display.h +++ b/src/libretro/libretro_opengl_host_display.h @@ -34,9 +34,6 @@ public: bool threaded_presentation) override; void DestroyRenderDevice() override; - bool MakeRenderContextCurrent() override; - bool DoneRenderContextCurrent() override; - void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override; bool ChangeRenderWindow(const WindowInfo& new_wi) override; diff --git a/src/libretro/libretro_vulkan_host_display.cpp b/src/libretro/libretro_vulkan_host_display.cpp index 51e25017..42bf8922 100644 --- a/src/libretro/libretro_vulkan_host_display.cpp +++ b/src/libretro/libretro_vulkan_host_display.cpp @@ -291,16 +291,6 @@ void LibretroVulkanHostDisplay::DestroyRenderDevice() Vulkan::ResetVulkanLibraryFunctionPointers(); } -bool LibretroVulkanHostDisplay::MakeRenderContextCurrent() -{ - return true; -} - -bool LibretroVulkanHostDisplay::DoneRenderContextCurrent() -{ - return true; -} - bool LibretroVulkanHostDisplay::CreateResources() { static constexpr char fullscreen_quad_vertex_shader[] = R"( diff --git a/src/libretro/libretro_vulkan_host_display.h b/src/libretro/libretro_vulkan_host_display.h index 925cbcad..9bfd52a8 100644 --- a/src/libretro/libretro_vulkan_host_display.h +++ b/src/libretro/libretro_vulkan_host_display.h @@ -26,9 +26,6 @@ public: bool threaded_presentation) override; void DestroyRenderDevice() override; - bool MakeRenderContextCurrent() override; - bool DoneRenderContextCurrent() override; - void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override; bool ChangeRenderWindow(const WindowInfo& new_wi) override;