mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-04-06 12:24:23 -04:00
SDL: Fixed crash when loading gamecontrollerdb.
This commit is contained in:
parent
60f068c648
commit
55e72a2dd1
1 changed files with 5 additions and 5 deletions
|
@ -425,14 +425,14 @@ namespace entry
|
|||
WindowHandle defaultWindow = { 0 };
|
||||
setWindowSize(defaultWindow, m_width, m_height, true);
|
||||
|
||||
bx::FileReaderI* reader = getFileReader();
|
||||
if (bx::open(reader, "gamecontrollerdb.txt") )
|
||||
bx::CrtFileReader reader;
|
||||
if (bx::open(&reader, "gamecontrollerdb.txt") )
|
||||
{
|
||||
bx::AllocatorI* allocator = getAllocator();
|
||||
uint32_t size = (uint32_t)bx::getSize(reader);
|
||||
uint32_t size = (uint32_t)bx::getSize(&reader);
|
||||
void* data = BX_ALLOC(allocator, size);
|
||||
bx::read(reader, data, size);
|
||||
bx::close(reader);
|
||||
bx::read(&reader, data, size);
|
||||
bx::close(&reader);
|
||||
|
||||
SDL_GameControllerAddMapping( (char*)data);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue