diff options
author | 2023-01-04 23:29:18 -0500 | |
---|---|---|
committer | 2023-01-04 23:29:18 -0500 | |
commit | 94b1e168b2b97b48b81f7a8f64406b0a6f64184e (patch) | |
tree | f57362a0fa01bfe8f0ad75a447c4c9e10bc15756 /3rdparty/bgfx/examples/common/entry/dialog.cpp | |
parent | 5581eaa50a42256242f32569f59ce10d70ddd8c2 (diff) |
Revert "Update BGFX, BX and BIMG (#10750)" (#10787)
This reverts commit 5581eaa50a42256242f32569f59ce10d70ddd8c2 due to link failure on macOS.
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/dialog.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/entry/dialog.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/dialog.cpp b/3rdparty/bgfx/examples/common/entry/dialog.cpp index 8c1bf9731e7..4041e23d17a 100644 --- a/3rdparty/bgfx/examples/common/entry/dialog.cpp +++ b/3rdparty/bgfx/examples/common/entry/dialog.cpp @@ -1,6 +1,6 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE + * Copyright 2010-2021 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ #include <bx/allocator.h> @@ -42,7 +42,6 @@ struct OPENFILENAMEA }; extern "C" bool __stdcall GetOpenFileNameA(OPENFILENAMEA* _ofn); -extern "C" bool __stdcall GetSaveFileNameA(OPENFILENAMEA * _ofn); extern "C" void* __stdcall GetModuleHandleA(const char* _moduleName); extern "C" uint32_t __stdcall GetModuleFileNameA(void* _module, char* _outFilePath, uint32_t _size); extern "C" void* __stdcall ShellExecuteA(void* _hwnd, void* _operation, void* _file, void* _parameters, void* _directory, int32_t _showCmd); @@ -105,17 +104,6 @@ private: char m_ch; }; -#if BX_PLATFORM_WINDOWS -extern "C" typedef bool(__stdcall* OPENFILENAMEFUNCTION)(OPENFILENAMEA* _ofn); -static const struct { OPENFILENAMEFUNCTION m_function; uint32_t m_flags; } -s_getFileNameA[] = -{ - { GetOpenFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 | /* OFN_FILEMUSTEXIST */ 0x00001000 }, - { GetSaveFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 }, -}; -BX_STATIC_ASSERT(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count); -#endif - #if !BX_PLATFORM_OSX bool openFileSelectionDialog( bx::FilePath& _inOutFilePath @@ -168,8 +156,7 @@ bool openFileSelectionDialog( } } #elif BX_PLATFORM_WINDOWS - if (_type < 0 || _type >= BX_COUNTOF(s_getFileNameA)) - return false; + BX_UNUSED(_type); char out[bx::kMaxFilePath] = { '\0' }; @@ -179,7 +166,11 @@ bool openFileSelectionDialog( ofn.initialDir = _inOutFilePath.getCPtr(); ofn.file = out; ofn.maxFile = sizeof(out); - ofn.flags = s_getFileNameA[_type].m_flags; + ofn.flags = 0 + | /* OFN_EXPLORER */ 0x00080000 + | /* OFN_FILEMUSTEXIST */ 0x00001000 + | /* OFN_DONTADDTORECENT */ 0x02000000 + ; char tmp[4096]; bx::StaticMemoryBlockWriter writer(tmp, sizeof(tmp) ); @@ -229,7 +220,7 @@ bool openFileSelectionDialog( bx::write(&writer, '\0', &err); if (err.isOk() - && s_getFileNameA[_type].m_function(&ofn)) + && GetOpenFileNameA(&ofn) ) { _inOutFilePath.set(ofn.file); return true; |