File tree Expand file tree Collapse file tree 5 files changed +46
-9
lines changed
src/Plugins.Win32.SDLAudio Expand file tree Collapse file tree 5 files changed +46
-9
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,13 @@ SPDX-License-Identifier: GPL-2.0-or-later
55]===]
66
77add_library (Mupen64RR.Plugins.Win32.SDLAudio MODULE
8- "Config.hpp"
98 "Main.cpp"
10- "Main.hpp"
119 "Main_Win32.cpp"
12- "Main_Win32.hpp"
1310 "SDLBackend.cpp"
11+
12+ "Config.hpp"
13+ "Main.hpp"
14+ "Main_Win32.hpp"
1415 "SDLBackend.hpp"
1516)
1617set_target_properties (Mupen64RR.Plugins.Win32.SDLAudio PROPERTIES
@@ -20,7 +21,7 @@ set_target_properties(Mupen64RR.Plugins.Win32.SDLAudio PROPERTIES
2021 LIBRARY_OUTPUT_DIRECTORY "${MUPEN64RR_PLUGIN_OUT_DIR} "
2122 PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} "
2223)
23- target_link_libraries (Mupen64RR.Plugins.Win32.SDLAudio PRIVATE
24+ target_link_libraries (Mupen64RR.Plugins.Win32.SDLAudio PRIVATE
2425 Mupen64RR.Plugins.Win32.Common
2526 SDL3::SDL3
2627)
Original file line number Diff line number Diff line change 1+
2+ #include " Config_Win32.hpp"
3+
4+ namespace SDLAudio {
5+ void show_config_win32 (HWND parent, Config &config) {
6+
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include " Config.hpp"
4+
5+ namespace SDLAudio {
6+ void show_config_win32 (HWND parent, Config& config);
7+ }
Original file line number Diff line number Diff line change 11#include " Main_Win32.hpp"
22#include < Views.Win32/ViewPlugin.h>
3+ #include < filesystem>
4+ #include < libloaderapi.h>
5+ #include < minwindef.h>
6+ #include < string>
7+ #include < vector>
38#include < winnt.h>
49
510HMODULE g_dll_handle = nullptr ;
11+ std::filesystem::path g_dll_path {};
612
713BOOL __stdcall DllMain (HMODULE hmod, DWORD reason, LPVOID)
814{
9- if (reason == DLL_PROCESS_ATTACH) {
10- g_dll_handle = hmod;
11- }
12- return TRUE ;
15+ if (reason == DLL_PROCESS_ATTACH)
16+ {
17+ g_dll_handle = hmod;
18+
19+ std::vector<wchar_t > dll_path_buf (MAX_PATH, L' \0 ' );
20+ DWORD gmfn_rc = GetModuleFileNameW (hmod, dll_path_buf.data (), dll_path_buf.size ());
21+
22+ // If the buffer isn't long enough, double the buffer size until it fits
23+ while (gmfn_rc == dll_path_buf.size ()) {
24+ dll_path_buf.resize (dll_path_buf.size () * 2 );
25+ gmfn_rc = GetModuleFileNameW (hmod, dll_path_buf.data (), dll_path_buf.size ());
26+ }
27+
28+ // set the DLL path
29+ g_dll_path = std::filesystem::path (dll_path_buf.data ());
30+ }
31+ return TRUE ;
1332}
1433EXPORT void CALL DllAbout (void *hParent)
1534{
Original file line number Diff line number Diff line change 11#pragma once
22
33#include < CommonPCH.h>
4+ #include < filesystem>
45#include " Main.hpp"
56
6- extern HMODULE g_dll_handle;
7+ extern HMODULE g_dll_handle;
8+ extern std::filesystem::path g_dll_path;
You can’t perform that action at this time.
0 commit comments