diff options
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/joypad.cpp | 14 | ||||
-rw-r--r-- | platform/windows/joypad.h | 1 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 17 |
3 files changed, 10 insertions, 22 deletions
diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp index f2848268fc..4c1eeb425a 100644 --- a/platform/windows/joypad.cpp +++ b/platform/windows/joypad.cpp @@ -87,16 +87,6 @@ bool JoypadWindows::have_device(const GUID &p_guid) { return false; } -int JoypadWindows::check_free_joy_slot() const { - - for (int i = 0; i < JOYPADS_MAX; i++) { - - if (!attached_joypads[i]) - return i; - } - return -1; -} - // adapted from SDL2, works a lot better than the MSDN version bool JoypadWindows::is_xinput_device(const GUID *p_guid) { @@ -146,7 +136,7 @@ bool JoypadWindows::is_xinput_device(const GUID *p_guid) { bool JoypadWindows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) { HRESULT hr; - int num = check_free_joy_slot(); + int num = input->get_unused_joy_id(); if (have_device(instance->guidInstance) || num == -1) return false; @@ -296,7 +286,7 @@ void JoypadWindows::probe_joypads() { dwResult = xinput_get_state(i, &x_joypads[i].state); if ( dwResult == ERROR_SUCCESS) { - int id = check_free_joy_slot(); + int id = input->get_unused_joy_id(); if (id != -1 && !x_joypads[i].attached) { x_joypads[i].attached = true; diff --git a/platform/windows/joypad.h b/platform/windows/joypad.h index 63eee8c015..d6670c90db 100644 --- a/platform/windows/joypad.h +++ b/platform/windows/joypad.h @@ -132,7 +132,6 @@ private: void load_xinput(); void unload_xinput(); - int check_free_joy_slot() const; unsigned int post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad); bool have_device(const GUID &p_guid); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 1afbfd5230..0ef964522b 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1255,6 +1255,10 @@ void OS_Windows::finalize() { main_loop=NULL; + for (int i = 0; i < get_audio_driver_count(); i++) { + AudioDriverManager::get_driver(i)->finish(); + } + memdelete(joypad); memdelete(input); @@ -1282,13 +1286,8 @@ void OS_Windows::finalize() { memdelete(physics_2d_server); monitor_info.clear(); - - for (int i = 0; i < get_audio_driver_count(); i++) - { - AudioDriverManager::get_driver(i)->finish(); - } - } + void OS_Windows::finalize_core() { memdelete(process_map); @@ -1969,10 +1968,10 @@ Error OS_Windows::execute(const String& p_path, const List<String>& p_arguments, String argss; argss="\"\""+p_path+"\""; + + for (const List<String>::Element* E=p_arguments.front(); E; E=E->next()) { - for(int i=0;i<p_arguments.size();i++) { - - argss+=String(" \"")+p_arguments[i]+"\""; + argss+=String(" \"")+E->get()+"\""; } //print_line("ARGS: "+argss); |