From 39176274946d70ff520f265dee8fbd16d5fe0000 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 1 Dec 2017 13:22:27 +0100 Subject: Updated GENie, BGFX, BX, added BIMG since it is separated now, updated all shader binaries and MAME part of code to support new interfaces [Miodrag Milanovic] --- 3rdparty/bgfx/examples/common/entry/entry_sdl.cpp | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to '3rdparty/bgfx/examples/common/entry/entry_sdl.cpp') diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp index b8476f77bff..62a59b5bc04 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp @@ -11,7 +11,7 @@ # define SDL_MAIN_HANDLED #endif // BX_PLATFORM_WINDOWS -#include +#include #include @@ -25,12 +25,10 @@ BX_PRAGMA_DIAGNOSTIC_POP() # undef None #endif // defined(None) -#include #include #include #include #include -#include #include #include @@ -251,7 +249,7 @@ namespace entry int m_argc; char** m_argv; - static int32_t threadFunc(void* _userData); + static int32_t threadFunc(bx::Thread* _thread, void* _userData); }; /// @@ -487,16 +485,25 @@ namespace entry WindowHandle defaultWindow = { 0 }; setWindowSize(defaultWindow, m_width, m_height, true); - bx::FileReaderI* reader = getFileReader(); + bx::FileReaderI* reader = NULL; + while (NULL == reader) + { + reader = getFileReader(); + bx::sleep(100); + } + if (bx::open(reader, "gamecontrollerdb.txt") ) { bx::AllocatorI* allocator = getAllocator(); uint32_t size = (uint32_t)bx::getSize(reader); - void* data = BX_ALLOC(allocator, size); + void* data = BX_ALLOC(allocator, size + 1); bx::read(reader, data, size); bx::close(reader); + ((char*)data)[size] = '\0'; - SDL_GameControllerAddMapping( (char*)data); + if (SDL_GameControllerAddMapping( (char*)data) < 0) { + DBG("SDL game controller add mapping failed: %s", SDL_GetError()); + } BX_FREE(allocator, data); } @@ -1083,8 +1090,10 @@ namespace entry sdlPostEvent(SDL_USER_WINDOW_MOUSE_LOCK, _handle, NULL, _lock); } - int32_t MainThreadEntry::threadFunc(void* _userData) + int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData) { + BX_UNUSED(_thread); + MainThreadEntry* self = (MainThreadEntry*)_userData; int32_t result = main(self->m_argc, self->m_argv); -- cgit v1.2.3-70-g09d2