diff --git a/CHANGES.md b/CHANGES.md index 85e5e4267c..d3a1418dda 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,5 @@ # 1.6.5 (future) +- 3DS: Fixes serious performance regression that affected every core; rewind was always implicitly enabled. - AUDIO: MOD/S3M/XM sound should now be properly mixed in with the core's sound. - LOCALIZATION: Update Italian translation - INPUT: Overlay controller response - when we press buttons on the gamepad or keyboard, the corresponding buttons on the overlay will be highlighted as well. diff --git a/audio/drivers/wasapi.c b/audio/drivers/wasapi.c index 117d0f3fb4..089bee8978 100644 --- a/audio/drivers/wasapi.c +++ b/audio/drivers/wasapi.c @@ -741,9 +741,9 @@ static ssize_t wasapi_write(void *wh, const void *data, size_t size) for (writen = 0, ir = -1; writen < size; writen += ir) { if (w->exclusive) - ir = wasapi_write_ex(w, data + writen, size - writen); + ir = wasapi_write_ex(w, (char*)data + writen, size - writen); else - ir = wasapi_write_sh(w, data + writen, size - writen); + ir = wasapi_write_sh(w, (char*)data + writen, size - writen); if (ir == -1) return -1; } diff --git a/command.c b/command.c index 01c0d61e0d..ad5c79c137 100644 --- a/command.c +++ b/command.c @@ -1865,13 +1865,17 @@ bool command_event(enum event_command cmd, void *data) if (settings->bools.cheevos_hardcore_mode_enable) return false; #endif + if (settings->bools.rewind_enable) + { #ifdef HAVE_NETWORKING - /* Only enable state manager if netplay is not underway - TODO: Add a setting for these tweaks */ - if (settings->bools.rewind_enable - && !netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)) + /* Only enable state manager if netplay is not underway +TODO: Add a setting for these tweaks */ + if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)) #endif - state_manager_event_init((unsigned)settings->rewind_buffer_size); + { + state_manager_event_init((unsigned)settings->rewind_buffer_size); + } + } } break; case CMD_EVENT_REWIND_TOGGLE: diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 2aa65eb10b..02ae1dd7d3 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -66,6 +66,7 @@ static void gfx_dwm_shutdown(void) static bool gfx_init_dwm(void) { + HRESULT (WINAPI *mmcss)(BOOL); static bool inited = false; if (inited) @@ -89,7 +90,7 @@ static bool gfx_init_dwm(void) DragAcceptFiles_func = (VOID (WINAPI*)(HWND, BOOL))dylib_proc(shell32lib, "DragAcceptFiles"); - HRESULT (WINAPI *mmcss)(BOOL) = + mmcss = (HRESULT (WINAPI*)(BOOL))dylib_proc(dwmlib, "DwmEnableMMCSS"); if (mmcss) { @@ -104,6 +105,7 @@ static bool gfx_init_dwm(void) static void gfx_set_dwm(void) { HRESULT ret; + HRESULT (WINAPI *composition_enable)(UINT); settings_t *settings = config_get_ptr(); if (!gfx_init_dwm()) @@ -112,7 +114,7 @@ static void gfx_set_dwm(void) if (settings->bools.video_disable_composition == dwm_composition_disabled) return; - HRESULT (WINAPI *composition_enable)(UINT) = + composition_enable = (HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition"); if (!composition_enable) { diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index b8f6c32fac..e2c64f2ffc 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -772,9 +772,12 @@ static void vulkan_check_dynamic_state( if (vk->tracker.dirty & VULKAN_DIRTY_DYNAMIC_BIT) { - const VkRect2D sci = { - { vk->vp.x, vk->vp.y }, - { vk->vp.width, vk->vp.height }}; + VkRect2D sci; + + sci.offset.x = vk->vp.x; + sci.offset.y = vk->vp.y; + sci.extent.width = vk->vp.width; + sci.extent.height = vk->vp.height; vkCmdSetViewport(vk->cmd, 0, 1, &vk->vk_vp); vkCmdSetScissor (vk->cmd, 0, 1, &sci); @@ -1144,8 +1147,15 @@ struct vk_buffer_chain vulkan_buffer_chain_init( VkDeviceSize alignment, VkBufferUsageFlags usage) { - struct vk_buffer_chain chain = { - block_size, alignment, 0, usage, NULL, NULL }; + struct vk_buffer_chain chain; + + chain.block_size = block_size; + chain.alignment = alignment; + chain.offset = 0; + chain.usage = usage; + chain.head = NULL; + chain.current = NULL; + return chain; } @@ -1487,12 +1497,13 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk) for (i = 0; i < queue_count; i++) { + VkQueueFlags required; VkBool32 supported = VK_FALSE; vkGetPhysicalDeviceSurfaceSupportKHR( vk->context.gpu, i, vk->vk_surface, &supported); - VkQueueFlags required = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT; + required = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT; if (supported && ((queue_properties[i].queueFlags & required) == required)) { vk->context.graphics_queue_index = i; @@ -1573,6 +1584,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk, { unsigned i; VkResult res; + PFN_vkGetInstanceProcAddr GetInstanceProcAddr; VkInstanceCreateInfo info = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO }; VkApplicationInfo app = { VK_STRUCTURE_TYPE_APPLICATION_INFO }; @@ -1647,7 +1659,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk, RARCH_LOG("Vulkan dynamic library loaded.\n"); - PFN_vkGetInstanceProcAddr GetInstanceProcAddr = + GetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)dylib_proc(vulkan_library, "vkGetInstanceProcAddr"); if (!GetInstanceProcAddr) @@ -2018,10 +2030,11 @@ bool vulkan_surface_create(gfx_ctx_vulkan_data_t *vk, case VULKAN_WSI_WIN32: #ifdef _WIN32 { + VkWin32SurfaceCreateInfoKHR surf_info; PFN_vkCreateWin32SurfaceKHR create; + if (!VULKAN_SYMBOL_WRAPPER_LOAD_INSTANCE_SYMBOL(vk->context.instance, "vkCreateWin32SurfaceKHR", create)) return false; - VkWin32SurfaceCreateInfoKHR surf_info; memset(&surf_info, 0, sizeof(surf_info)); diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index cfeb717de2..cdb1249668 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -205,9 +205,12 @@ static BOOL CALLBACK win32_monitor_enum_proc(HMONITOR hMonitor, void win32_monitor_from_window(void) { #ifndef _XBOX + ui_window_t *window = NULL; + win32_monitor_last = MonitorFromWindow(main_window.hwnd, MONITOR_DEFAULTTONEAREST); - const ui_window_t *window = ui_companion_driver_get_window_ptr(); + + window = (ui_window_t*)ui_companion_driver_get_window_ptr(); if (window) window->destroy(&main_window); diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 65732b7a95..01e4196e86 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1194,12 +1194,12 @@ error: static void vulkan_update_filter_chain(vk_t *vk) { - const struct vulkan_filter_chain_swapchain_info info = { - vk->vk_vp, - vk->context->swapchain_format, - vk->render_pass, - vk->context->num_swapchain_images, - }; + struct vulkan_filter_chain_swapchain_info info; + + info.viewport = vk->vk_vp; + info.format = vk->context->swapchain_format; + info.render_pass = vk->render_pass; + info.num_indices = vk->context->num_swapchain_images; if (!vulkan_filter_chain_update_swapchain_info((vulkan_filter_chain_t*)vk->filter_chain, &info)) RARCH_ERR("Failed to update filter chain info. This will probably lead to a crash ...\n"); @@ -1346,9 +1346,10 @@ static void vulkan_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen) { - (void)data; gfx_ctx_mode_t mode; + (void)data; + mode.width = width; mode.height = height; mode.fullscreen = fullscreen; diff --git a/gfx/drivers_context/gdi_ctx.c b/gfx/drivers_context/gdi_ctx.c index 3773a6d1c8..9721530311 100644 --- a/gfx/drivers_context/gdi_ctx.c +++ b/gfx/drivers_context/gdi_ctx.c @@ -19,7 +19,7 @@ /* necessary for mingw32 multimon defines: */ #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 //_WIN32_WINNT_WIN2K +#define _WIN32_WINNT 0x0500 /*_WIN32_WINNT_WIN2K */ #endif #include @@ -104,9 +104,10 @@ static void gfx_ctx_gdi_update_window_title(void *data, void *data2) static void gfx_ctx_gdi_get_video_size(void *data, unsigned *width, unsigned *height) { - (void)data; HWND window = win32_get_window(); + (void)data; + if (!window) { RECT mon_rect; @@ -219,9 +220,10 @@ static void gfx_ctx_gdi_input_driver(void *data, const char *joypad_name, const input_driver_t **input, void **input_data) { - (void)data; settings_t *settings = config_get_ptr(); + (void)data; + #if _WIN32_WINNT >= 0x0501 /* winraw only available since XP */ if (string_is_equal_fast(settings->arrays.input_driver, "raw", 4)) diff --git a/gfx/drivers_context/khr_display_ctx.c b/gfx/drivers_context/khr_display_ctx.c index fd69cb1620..745d770055 100644 --- a/gfx/drivers_context/khr_display_ctx.c +++ b/gfx/drivers_context/khr_display_ctx.c @@ -113,6 +113,7 @@ static bool gfx_ctx_khr_display_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen) { + struct vulkan_display_surface_info info; khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data; if (!fullscreen) @@ -121,7 +122,9 @@ static bool gfx_ctx_khr_display_set_video_mode(void *data, height = 0; } - struct vulkan_display_surface_info info = { width, height }; + info.width = width; + info.height = height; + if (!vulkan_surface_create(&khr->vk, VULKAN_WSI_DISPLAY, &info, NULL, 0, 0, khr->swap_interval)) { diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 5e19fbfa67..0766516cb5 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -435,9 +435,10 @@ static void gfx_ctx_wgl_update_title(void *data, void *data2) static void gfx_ctx_wgl_get_video_size(void *data, unsigned *width, unsigned *height) { - (void)data; HWND window = win32_get_window(); + (void)data; + if (!window) { RECT mon_rect; diff --git a/gfx/drivers_font/vulkan_raster_font.c b/gfx/drivers_font/vulkan_raster_font.c index c1036d217d..871c5f6e4c 100644 --- a/gfx/drivers_font/vulkan_raster_font.c +++ b/gfx/drivers_font/vulkan_raster_font.c @@ -271,15 +271,15 @@ static void vulkan_raster_font_render_message( static void vulkan_raster_font_flush(vulkan_raster_t *font) { - const struct vk_draw_triangles call = { - font->vk->pipelines.font, - &font->texture_optimal, - font->vk->samplers.mipmap_linear, - &font->vk->mvp, - sizeof(font->vk->mvp), - &font->range, - font->vertices, - }; + struct vk_draw_triangles call; + + call.pipeline = font->vk->pipelines.font; + call.texture = &font->texture_optimal; + call.sampler = font->vk->samplers.mipmap_linear; + call.uniform = &font->vk->mvp; + call.uniform_size = sizeof(font->vk->mvp); + call.vbo = &font->range; + call.vertices = font->vertices; if(font->needs_update) { diff --git a/gfx/include/vulkan/vk_platform.h b/gfx/include/vulkan/vk_platform.h index 5d0fc766ec..3771c169e1 100644 --- a/gfx/include/vulkan/vk_platform.h +++ b/gfx/include/vulkan/vk_platform.h @@ -1,6 +1,7 @@ -// -// File: vk_platform.h -// +/* + * File: vk_platform.h + */ + /* ** Copyright (c) 2014-2015 The Khronos Group Inc. ** @@ -24,7 +25,7 @@ #ifdef __cplusplus extern "C" { -#endif // __cplusplus +#endif /* __cplusplus */ /* *************************************************************************************************** @@ -47,22 +48,22 @@ extern "C" * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); */ #if defined(_WIN32) - // On Windows, Vulkan commands use the stdcall convention + /* On Windows, Vulkan commands use the stdcall convention */ #define VKAPI_ATTR #define VKAPI_CALL __stdcall #define VKAPI_PTR VKAPI_CALL #elif defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__) - // Android does not support Vulkan in native code using the "armeabi" ABI. + /* Android does not support Vulkan in native code using the "armeabi" ABI. */ #error "Vulkan requires the 'armeabi-v7a' or 'armeabi-v7a-hard' ABI on 32-bit ARM CPUs" #elif defined(__ANDROID__) && defined(__ARM_ARCH_7A__) - // On Android/ARMv7a, Vulkan functions use the armeabi-v7a-hard calling - // convention, even if the application's native code is compiled with the - // armeabi-v7a calling convention. + /* On Android/ARMv7a, Vulkan functions use the armeabi-v7a-hard calling + * convention, even if the application's native code is compiled with the + * armeabi-v7a calling convention. */ #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) #define VKAPI_CALL #define VKAPI_PTR VKAPI_ATTR #else - // On other platforms, use the default calling convention + /* On other platforms, use the default calling convention */ #define VKAPI_ATTR #define VKAPI_CALL #define VKAPI_PTR @@ -83,15 +84,15 @@ extern "C" #else #include #endif -#endif // !defined(VK_NO_STDINT_H) +#endif /* !defined(VK_NO_STDINT_H) */ #ifdef __cplusplus -} // extern "C" -#endif // __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ -// Platform-specific headers required by platform window system extensions. -// These are enabled prior to #including "vulkan.h". The same enable then -// controls inclusion of the extension interfaces in vulkan.h. +/* Platform-specific headers required by platform window system extensions. + * These are enabled prior to #including "vulkan.h". The same enable then + * controls inclusion of the extension interfaces in vulkan.h. */ #ifdef VK_USE_PLATFORM_ANDROID_KHR #include diff --git a/gfx/include/vulkan/vk_sdk_platform.h b/gfx/include/vulkan/vk_sdk_platform.h index ef9a000fb2..29653774ff 100644 --- a/gfx/include/vulkan/vk_sdk_platform.h +++ b/gfx/include/vulkan/vk_sdk_platform.h @@ -1,6 +1,7 @@ -// -// File: vk_sdk_platform.h -// +/* + * File: vk_sdk_platform.h + */ + /* * Copyright (c) 2015-2016 The Khronos Group Inc. * Copyright (c) 2015-2016 Valve Corporation @@ -27,20 +28,20 @@ #ifndef __cplusplus #undef inline #define inline __inline -#endif // __cplusplus +#endif /* __cplusplus */ #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) -// C99: -// Microsoft didn't implement C99 in Visual Studio; but started adding it with -// VS2013. However, VS2013 still didn't have snprintf(). The following is a -// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the -// "CMakeLists.txt" file). -// NOTE: This is fixed in Visual Studio 2015. +/* C99: + * Microsoft didn't implement C99 in Visual Studio; but started adding it with + * VS2013. However, VS2013 still didn't have snprintf(). The following is a + * work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the + * "CMakeLists.txt" file). + * NOTE: This is fixed in Visual Studio 2015. */ #define snprintf _snprintf #endif #define strdup _strdup -#endif // _WIN32 +#endif /* _WIN32 */ -#endif // VK_SDK_PLATFORM_H +#endif /* VK_SDK_PLATFORM_H */ diff --git a/gfx/include/vulkan/vulkan.h b/gfx/include/vulkan/vulkan.h index 9b91e62973..121738c08f 100644 --- a/gfx/include/vulkan/vulkan.h +++ b/gfx/include/vulkan/vulkan.h @@ -33,16 +33,18 @@ extern "C" { #define VK_MAKE_VERSION(major, minor, patch) \ (((major) << 22) | ((minor) << 12) | (patch)) -// DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. -//#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) +/* DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. */ +#if 0 +#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) +#endif -// Vulkan 1.0 version number +/* Vulkan 1.0 version number */ #define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0) #define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) -// Version of this file +/* Version of this file */ #define VK_HEADER_VERSION 17 diff --git a/gfx/include/vulkan/vulkan_intel.h b/gfx/include/vulkan/vulkan_intel.h index 1f77128961..15b5a02ad0 100644 --- a/gfx/include/vulkan/vulkan_intel.h +++ b/gfx/include/vulkan/vulkan_intel.h @@ -29,16 +29,16 @@ #ifdef __cplusplus extern "C" { -#endif // __cplusplus +#endif /* __cplusplus */ #define VK_STRUCTURE_TYPE_DMA_BUF_IMAGE_CREATE_INFO_INTEL 1024 typedef struct VkDmaBufImageCreateInfo_ { - VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DMA_BUF_IMAGE_CREATE_INFO_INTEL - const void* pNext; // Pointer to next structure. + VkStructureType sType; /* Must be VK_STRUCTURE_TYPE_DMA_BUF_IMAGE_CREATE_INFO_INTEL */ + const void* pNext; /* Pointer to next structure. */ int fd; VkFormat format; - VkExtent3D extent; // Depth must be 1 + VkExtent3D extent; /* Depth must be 1 */ uint32_t strideInBytes; } VkDmaBufImageCreateInfo; @@ -56,7 +56,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDmaBufImageINTEL( #endif #ifdef __cplusplus -} // extern "C" -#endif // __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ -#endif // __VULKAN_INTEL_H__ +#endif /* __VULKAN_INTEL_H__ */ diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 4314ce04f5..b1b34051c8 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -222,6 +222,8 @@ static void dinput_poll(void *data) if (di->mouse) { DIMOUSESTATE2 mouse_state; + POINT point = {0}; + memset(&mouse_state, 0, sizeof(mouse_state)); if (FAILED(IDirectInputDevice8_GetDeviceState( @@ -237,8 +239,8 @@ static void dinput_poll(void *data) di->mouse_rel_y = mouse_state.lY; - if (!mouse_state.rgbButtons[0]) - unset_doubleclick_on_titlebar(); + if (!mouse_state.rgbButtons[0]) + unset_doubleclick_on_titlebar(); if (doubleclick_on_titlebar_pressed()) di->mouse_l = 0; else @@ -248,7 +250,6 @@ static void dinput_poll(void *data) /* No simple way to get absolute coordinates * for RETRO_DEVICE_POINTER. Just use Win32 APIs. */ - POINT point = {0}; GetCursorPos(&point); ScreenToClient((HWND)video_driver_window_get(), &point); di->mouse_x = point.x; diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index 3c77f48547..eacba9e370 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -375,11 +375,11 @@ static bool xinput_joypad_button(unsigned port_num, uint16_t joykey) static int16_t xinput_joypad_axis (unsigned port_num, uint32_t joyaxis) { int xuser; - int16_t val = 0; - int axis = -1; - - bool is_neg = false; - bool is_pos = false; + int16_t val = 0; + int axis = -1; + bool is_neg = false; + bool is_pos = false; + XINPUT_GAMEPAD* pad = NULL; if (joyaxis == AXIS_NONE) return 0; @@ -404,7 +404,7 @@ static int16_t xinput_joypad_axis (unsigned port_num, uint32_t joyaxis) is_pos = true; } - XINPUT_GAMEPAD* pad = &(g_xinput_states[xuser].xstate.Gamepad); + pad = &(g_xinput_states[xuser].xstate.Gamepad); switch (axis) { diff --git a/input/input_autodetect_builtin.c b/input/input_autodetect_builtin.c index f49c4dc5cc..5931bb2c76 100644 --- a/input/input_autodetect_builtin.c +++ b/input/input_autodetect_builtin.c @@ -19,6 +19,8 @@ #include "../config.h" #endif +#include + #include "../tasks/tasks_internal.h" #include "input_config.h" @@ -498,6 +500,7 @@ const char* const input_builtin_autoconfs[] = #if defined(_WIN32) && defined(_XBOX) DECL_AUTOCONF_DEVICE("XInput Controller", "xdk", XINPUT_DEFAULT_BINDS), #elif defined(_WIN32) +#if !defined(__STDC_C89__) && !defined(__STDC_C89_AMENDMENT_1__) DECL_AUTOCONF_DEVICE("XInput Controller (User 1)", "xinput", XINPUT_DEFAULT_BINDS), DECL_AUTOCONF_DEVICE("XInput Controller (User 2)", "xinput", XINPUT_DEFAULT_BINDS), DECL_AUTOCONF_DEVICE("XInput Controller (User 3)", "xinput", XINPUT_DEFAULT_BINDS), @@ -507,6 +510,7 @@ const char* const input_builtin_autoconfs[] = DECL_AUTOCONF_DEVICE("XBOX One Controller (User 3)", "xinput", XINPUT_DEFAULT_BINDS), DECL_AUTOCONF_DEVICE("XBOX One Controller (User 4)", "xinput", XINPUT_DEFAULT_BINDS), #endif +#endif #ifdef HAVE_SDL2 DECL_AUTOCONF_DEVICE("Standard Gamepad", "sdl2", SDL2_DEFAULT_BINDS), #endif diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 8417b5701c..47ed227e03 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -703,9 +703,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_HIDE_IN_MENU, MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR, "Tipo di ritardo") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_EARLY, - "Presto") + "Anticipato") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_LATE, - "Tardi") + "Ritardato") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_NORMAL, "Normale") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_PREFER_FRONT_TOUCH, @@ -865,7 +865,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_CLIENT, MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST, "Avvia host netplay") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DISABLE_HOST, - "Stop netplay host") + "Ferma host netplay") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS, "Indirizzo Server") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS, @@ -2104,11 +2104,11 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_INPUT_POLL_TYPE_BEHAVIOR, - "Influisce come il polling degli input che viene fatto all'interno di RetroArch. L'impostazione 'Early' o 'Late' può causare una minore latenza, a seconda della configurazione." + "Influisce come il polling degli input che viene fatto all'interno di RetroArch. L'impostazione 'Anticipato' o 'Ritardato' può causare una minore latenza, a seconda della configurazione." ) MSG_HASH( MENU_ENUM_SUBLABEL_INPUT_ALL_USERS_CONTROL_MENU, - "Allows any user to control the menu. If disabled, only User 1 can control the menu." + "Consente a qualsiasi utente di controllare il menu. Se disattivato, solo l'utente 1 può controllare il menu." ) MSG_HASH( MENU_ENUM_SUBLABEL_AUDIO_VOLUME, @@ -2242,7 +2242,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_HISTORY_LIST_ENABLE, MSG_HASH(MENU_ENUM_SUBLABEL_CONTENT_HISTORY_SIZE, "Limit the number of entries in recent playlist for games, images, music, and videos.") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_UNIFIED_MENU_CONTROLS, - "Unified Menu Controls") + "Controlli del menu unificati") MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_UNIFIED_MENU_CONTROLS, "Utilizzare gli stessi controlli sia per il menu che per il gioco. Si applica alla tastiera.") MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_FONT_ENABLE, @@ -2399,3 +2399,13 @@ MSG_HASH(MENU_ENUM_SUBLABEL_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABL "Filtra i file visualizzati nel filebrowser con estensioni supportate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_FILTER_BY_CURRENT_CORE, "Filtra per core corrente") +MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY_DISCONNECT, + "Disconnette da una connessione Netplay attiva.") +MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_META_REWIND, + "Gestisce le impostazioni di riavvolgimento.") +MSG_HASH(MENU_ENUM_SUBLABEL_REWIND_ENABLE, + "Attiva il riavvolgimento.Richiederà maggiori prestazioni durante il gioco.") +MSG_HASH(MENU_ENUM_SUBLABEL_REWIND_GRANULARITY, + "Quando si riavvolge un numero definito di fotogrammi, è possibile riavvolgere più fotogrammi alla volta, aumentando la velocità di riavvolgimento.") + MSG_HASH(MENU_ENUM_SUBLABEL_FASTFORWARD_RATIO, + "La velocità massima in cui il contenuto verrà eseguito quando si utilizza l'avanzamento veloce (ad esempio, 5,0x per 60 fps = 300 fps). Se impostato a 0.0x, il rapporto dell'avanzamneto veloce è illimitato (nessun cap FPS)." ) diff --git a/libretro-common/rthreads/rthreads.c b/libretro-common/rthreads/rthreads.c index a059bc2f04..5f1f98c724 100644 --- a/libretro-common/rthreads/rthreads.c +++ b/libretro-common/rthreads/rthreads.c @@ -530,12 +530,14 @@ static bool _scond_wait_win32(scond_t *cond, slock_t *lock, DWORD dwMilliseconds { #if _WIN32_WINNT >= 0x0500 LARGE_INTEGER now; + LONGLONG elapsed; + QueryPerformanceCounter(&now); - LONGLONG elapsed = now.QuadPart - tsBegin.QuadPart; + elapsed = now.QuadPart - tsBegin.QuadPart; elapsed *= 1000; elapsed /= performanceCounterFrequency.QuadPart; #else - DWORD now = timeGetTime(); + DWORD now = timeGetTime(); DWORD elapsed = now - tsBegin; #endif diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index 488e103e46..8e5c6cdddb 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -388,7 +388,6 @@ static int bind_left_generic(unsigned type, const char *label, static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs, const char *label, uint32_t label_hash, const char *menu_label) { - unsigned i; if (cbs->setting) { @@ -402,21 +401,25 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs, } } - for (i = 0; i < MAX_USERS; i++) + if (strstr(label, "input_player") && strstr(label, "_joypad_index")) { - uint32_t label_setting_hash; - char label_setting[128]; - - label_setting[0] = '\0'; + unsigned i; + for (i = 0; i < MAX_USERS; i++) + { + uint32_t label_setting_hash; + char label_setting[128]; - snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1); - label_setting_hash = msg_hash_calculate(label_setting); + label_setting[0] = '\0'; - if (label_hash != label_setting_hash) - continue; + snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1); + label_setting_hash = msg_hash_calculate(label_setting); - BIND_ACTION_LEFT(cbs, bind_left_generic); - return 0; + if (label_hash != label_setting_hash) + continue; + + BIND_ACTION_LEFT(cbs, bind_left_generic); + return 0; + } } if (string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB))) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index a73475adb3..4f7d7e3944 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -3536,14 +3536,10 @@ static int action_ok_netplay_lan_scan(const char *path, netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL); /* Enable Netplay */ - if (!command_event(CMD_EVENT_NETPLAY_INIT_DIRECT, (void *) host)) - return -1; - - return generic_action_ok_command(CMD_EVENT_RESUME); - -#else - return -1; + if (command_event(CMD_EVENT_NETPLAY_INIT_DIRECT, (void *) host)) + return generic_action_ok_command(CMD_EVENT_RESUME); #endif + return -1; } static int action_ok_browse_url_list(const char *path, @@ -4226,12 +4222,10 @@ static int action_ok_load_archive_detect_core(const char *path, } return 0; case 0: - { - idx = menu_navigation_get_selection(); - return generic_action_ok_displaylist_push(path, NULL, - label, type, - idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST); - } + idx = menu_navigation_get_selection(); + return generic_action_ok_displaylist_push(path, NULL, + label, type, + idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST); default: break; } @@ -4343,15 +4337,10 @@ static int action_ok_netplay_enable_host(const char *path, } /* Enable Netplay itself */ - if (!command_event(CMD_EVENT_NETPLAY_INIT, NULL)) - return -1; - - return generic_action_ok_command(CMD_EVENT_RESUME); - -#else - return -1; - + if (command_event(CMD_EVENT_NETPLAY_INIT, NULL)) + return generic_action_ok_command(CMD_EVENT_RESUME); #endif + return -1; } #ifdef HAVE_NETWORKING @@ -4406,13 +4395,10 @@ static int action_ok_netplay_enable_client(const char *path, line.label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS); line.label_setting = "no_setting"; line.cb = action_ok_netplay_enable_client_hostname_cb; - if (!menu_input_dialog_start(&line)) - return -1; - return 0; - -#else - return -1; + if (menu_input_dialog_start(&line)) + return 0; #endif + return -1; } static int action_ok_netplay_disconnect(const char *path, @@ -4492,25 +4478,22 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, if (cbs->enum_idx != MSG_UNKNOWN) { - unsigned i; + const char *str = msg_hash_to_str(cbs->enum_idx); - for (i = 0; i < MAX_USERS; i++) + if (str && strstr(str, "input_binds_list")) { - unsigned first_char = 0; - const char *str = msg_hash_to_str(cbs->enum_idx); + unsigned i; - if (!str) - continue; - if (!strstr(str, "input_binds_list")) - continue; + for (i = 0; i < MAX_USERS; i++) + { + unsigned first_char = atoi(&str[0]); - first_char = atoi(&str[0]); + if (first_char != ((i+1))) + continue; - if (first_char != ((i+1))) - continue; - - BIND_ACTION_OK(cbs, action_ok_push_user_binds_list); - return 0; + BIND_ACTION_OK(cbs, action_ok_push_user_binds_list); + return 0; + } } } diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index 665d2d7aef..3756ae3c2e 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -488,7 +488,6 @@ static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs, static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs, const char *label, uint32_t label_hash, const char *menu_label) { - unsigned i; if (cbs->setting) { @@ -502,21 +501,25 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs, } } - for (i = 0; i < MAX_USERS; i++) + if (strstr(label, "input_player") && strstr(label, "_joypad_index")) { - uint32_t label_setting_hash; - char label_setting[128]; + unsigned i; + for (i = 0; i < MAX_USERS; i++) + { + uint32_t label_setting_hash; + char label_setting[128]; - label_setting[0] = '\0'; + label_setting[0] = '\0'; - snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1); - label_setting_hash = msg_hash_calculate(label_setting); + snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1); + label_setting_hash = msg_hash_calculate(label_setting); - if (label_hash != label_setting_hash) - continue; + if (label_hash != label_setting_hash) + continue; - BIND_ACTION_RIGHT(cbs, bind_right_generic); - return 0; + BIND_ACTION_RIGHT(cbs, bind_right_generic); + return 0; + } } if (string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB))) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 555b26c6e6..f1ff6b54fc 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2435,16 +2435,16 @@ static void xmb_render(void *data, bool is_idle) if (pointer_enable || mouse_enable) { - size_t selection = menu_navigation_get_selection(); + size_t selection = menu_navigation_get_selection(); + int16_t pointer_y = menu_input_pointer_state(MENU_POINTER_Y_AXIS); + int16_t mouse_y = menu_input_mouse_state(MENU_MOUSE_Y_AXIS) + + (xmb->cursor.size/2); for (i = 0; i < end; i++) { float item_y1 = xmb->margins.screen.top + xmb_item_y(xmb, (int)i, selection); float item_y2 = item_y1 + xmb->icon.size; - int16_t pointer_y = menu_input_pointer_state(MENU_POINTER_Y_AXIS); - int16_t mouse_y = menu_input_mouse_state(MENU_MOUSE_Y_AXIS) - + (xmb->cursor.size/2); if (pointer_enable) { diff --git a/menu/drivers_display/menu_display_vulkan.c b/menu/drivers_display/menu_display_vulkan.c index 5b7577b088..e95353ef33 100644 --- a/menu/drivers_display/menu_display_vulkan.c +++ b/menu/drivers_display/menu_display_vulkan.c @@ -254,19 +254,20 @@ static void menu_display_vk_draw(void *data) default: { - const struct vk_draw_triangles call = { - vk->display.pipelines[ - to_display_pipeline(draw->prim_type, vk->display.blend)], - texture, - texture->mipmap ? - vk->samplers.mipmap_linear : - (texture->default_smooth ? vk->samplers.linear : vk->samplers.nearest), - draw->matrix_data - ? draw->matrix_data : menu_display_vk_get_default_mvp(), - sizeof(math_matrix_4x4), - &range, - draw->coords->vertices, - }; + struct vk_draw_triangles call; + + call.pipeline = vk->display.pipelines[ + to_display_pipeline(draw->prim_type, vk->display.blend)]; + call.texture = texture; + call.sampler = texture->mipmap ? + vk->samplers.mipmap_linear : + (texture->default_smooth ? vk->samplers.linear : vk->samplers.nearest); + call.uniform = draw->matrix_data + ? draw->matrix_data : menu_display_vk_get_default_mvp(); + call.uniform_size = sizeof(math_matrix_4x4); + call.vbo = ⦥ + call.vertices = draw->coords->vertices; + vulkan_draw_triangles(vk, &call); break; } diff --git a/menu/menu_animation.c b/menu/menu_animation.c index 8464a7876c..8b517fb2d7 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -673,7 +673,7 @@ bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data) (menu_animation_ctx_subject_t*)data; float **sub = (float**)subject->data; - for (i = 0; i < anim.size; ++i) + for (i = 0; i < anim.size && killed < subject->count; ++i) { if (!anim.list[i].alive) continue; diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 116c7844e6..5b2a411390 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -101,7 +101,7 @@ typedef struct HWND label_title; HWND label_val; } trackbar; - }; + } elems; } shader_param_ctrl_t; typedef struct @@ -128,7 +128,7 @@ static bool shader_dlg_refresh_trackbar_label(int index, snprintf(val_buffer, sizeof(val_buffer), "%.2f", shader_info->data->parameters[index].current); - SendMessage(g_shader_dlg.controls[index].trackbar.label_val, + SendMessage(g_shader_dlg.controls[index].elems.trackbar.label_val, WM_SETTEXT, 0, (LPARAM)val_buffer); return true; @@ -155,7 +155,7 @@ static void shader_dlg_params_refresh(void) bool checked = shader_info.data ? (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum) : false; - SendMessage(control->checkbox.hwnd, BM_SETCHECK, checked, 0); + SendMessage(control->elems.checkbox.hwnd, BM_SETCHECK, checked, 0); } break; case SHADER_PARAM_CTRL_TRACKBAR: @@ -167,14 +167,14 @@ static void shader_dlg_params_refresh(void) if (shader_info.data) { - SendMessage(control->trackbar.hwnd, + SendMessage(control->elems.trackbar.hwnd, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); - SendMessage(control->trackbar.hwnd, + SendMessage(control->elems.trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].maximum - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); - SendMessage(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, + SendMessage(control->elems.trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].current - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); @@ -207,13 +207,13 @@ static void shader_dlg_params_clear(void) { const ui_window_t *window = ui_companion_driver_get_window_ptr(); if (window) - window->destroy(&control->checkbox); + window->destroy(&control->elems.checkbox); } break; case SHADER_PARAM_CTRL_TRACKBAR: - DestroyWindow(control->trackbar.label_title); - DestroyWindow(control->trackbar.label_val); - DestroyWindow(control->trackbar.hwnd); + DestroyWindow(control->elems.trackbar.label_title); + DestroyWindow(control->elems.trackbar.label_val); + DestroyWindow(control->elems.trackbar.hwnd); break; } @@ -260,12 +260,12 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_CHECKBOX; - control->checkbox.hwnd = CreateWindowEx(0, "BUTTON", + control->elems.checkbox.hwnd = CreateWindowEx(0, "BUTTON", shader_info.data->parameters[i].desc, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->elems.checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; } else @@ -277,29 +277,29 @@ void shader_dlg_params_reload(void) pos_x += SHADER_DLG_WIDTH; } - control->type = SHADER_PARAM_CTRL_TRACKBAR; - control->trackbar.label_title = CreateWindowEx(0, "STATIC", + control->type = SHADER_PARAM_CTRL_TRACKBAR; + control->elems.trackbar.label_title = CreateWindowEx(0, "STATIC", shader_info.data->parameters[i].desc, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->elems.trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_LABEL_HEIGHT; - control->trackbar.hwnd = CreateWindowEx(0, (LPCSTR)TRACKBAR_CLASS, "", + control->elems.trackbar.hwnd = CreateWindowEx(0, (LPCSTR)TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - control->trackbar.label_val = CreateWindowEx(0, "STATIC", "", + control->elems.trackbar.label_val = CreateWindowEx(0, "STATIC", "", WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->elems.trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); - SendMessage(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, - (LPARAM)control->trackbar.label_val); + SendMessage(control->elems.trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, + (LPARAM)control->elems.trackbar.label_val); pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -402,7 +402,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, video_shader_ctx_t shader_info; video_shader_driver_get_current_shader(&shader_info); - if (SendMessage(g_shader_dlg.controls[i].checkbox.hwnd, + if (SendMessage(g_shader_dlg.controls[i].elems.checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; @@ -424,7 +424,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR) break; - pos = (int)SendMessage(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); + pos = (int)SendMessage(g_shader_dlg.controls[i].elems.trackbar.hwnd, TBM_GETPOS, 0, 0); { diff --git a/ui/drivers/win32/ui_win32_browser_window.c b/ui/drivers/win32/ui_win32_browser_window.c index 93dcaa8a55..61c05e6907 100644 --- a/ui/drivers/win32/ui_win32_browser_window.c +++ b/ui/drivers/win32/ui_win32_browser_window.c @@ -25,17 +25,33 @@ static bool ui_browser_window_win32_core(ui_browser_window_state_t *state, bool save) { - OPENFILENAME ofn = {}; + OPENFILENAME ofn; - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = (HWND)state->window; - ofn.lpstrFilter = state->filters; /* actually const */ - ofn.lpstrFile = state->path; - ofn.lpstrTitle = state->title; - ofn.lpstrInitialDir = state->startdir; - ofn.lpstrDefExt = ""; - ofn.nMaxFile = PATH_MAX; - ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = (HWND)state->window; + ofn.hInstance = NULL; + ofn.lpstrFilter = state->filters; /* actually const */ + ofn.lpstrCustomFilter = NULL; + ofn.nMaxCustFilter = 0; + ofn.nFilterIndex = 0; + ofn.lpstrFile = state->path; + ofn.nMaxFile = PATH_MAX; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = state->startdir; + ofn.lpstrTitle = state->title; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; + ofn.nFileOffset = 0; + ofn.nFileExtension = 0; + ofn.lpstrDefExt = ""; + ofn.lCustData = 0; + ofn.lpfnHook = NULL; + ofn.lpTemplateName = NULL; +#if (_WIN32_WINNT >= 0x0500) + ofn.pvReserved = NULL; + ofn.dwReserved = 0; + ofn.FlagsEx = 0; +#endif if (!save && !GetOpenFileName(&ofn)) return false;