diff options
author | 2016-01-04 19:00:51 +0100 | |
---|---|---|
committer | 2016-01-04 19:00:51 +0100 | |
commit | fc07cc3621be84d6b54b9a02f946ca9e33272758 (patch) | |
tree | 8e906945079bd6b41eb6051a2b71f0f196c06c04 /3rdparty/bgfx/examples/common/bgfx_utils.cpp | |
parent | 3f4fe77c75571ff17436909c3e579da27b646368 (diff) |
Added latest BX and BGFX (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/bgfx_utils.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/bgfx_utils.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.cpp b/3rdparty/bgfx/examples/common/bgfx_utils.cpp index b1897c8f592..cdec2abbdfc 100644 --- a/3rdparty/bgfx/examples/common/bgfx_utils.cpp +++ b/3rdparty/bgfx/examples/common/bgfx_utils.cpp @@ -1,6 +1,6 @@ /* - * Copyright 2011-2015 Branimir Karadzic. All rights reserved. - * License: http://www.opensource.org/licenses/BSD-2-Clause + * Copyright 2011-2016 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ #include <string.h> // strlen @@ -22,7 +22,7 @@ namespace stl = tinystl; #include "bgfx_utils.h" -void* load(bx::FileReaderI* _reader, bx::ReallocatorI* _allocator, const char* _filePath, uint32_t* _size) +void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _filePath, uint32_t* _size) { if (0 == bx::open(_reader, _filePath) ) { @@ -36,6 +36,10 @@ void* load(bx::FileReaderI* _reader, bx::ReallocatorI* _allocator, const char* _ } return data; } + else + { + DBG("Failed to open: %s.", _filePath); + } if (NULL != _size) { @@ -66,10 +70,11 @@ static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePa return mem; } + DBG("Failed to load %s.", _filePath); return NULL; } -static void* loadMem(bx::FileReaderI* _reader, bx::ReallocatorI* _allocator, const char* _filePath, uint32_t* _size) +static void* loadMem(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _filePath, uint32_t* _size) { if (0 == bx::open(_reader, _filePath) ) { @@ -85,6 +90,7 @@ static void* loadMem(bx::FileReaderI* _reader, bx::ReallocatorI* _allocator, con return data; } + DBG("Failed to load %s.", _filePath); return NULL; } @@ -175,7 +181,7 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _name, uin } bgfx::TextureHandle handle = BGFX_INVALID_HANDLE; - bx::ReallocatorI* allocator = entry::getAllocator(); + bx::AllocatorI* allocator = entry::getAllocator(); uint32_t size = 0; void* data = loadMem(_reader, allocator, filePath, &size); @@ -399,7 +405,7 @@ struct Mesh Group group; - bx::ReallocatorI* allocator = entry::getAllocator(); + bx::AllocatorI* allocator = entry::getAllocator(); uint32_t chunk; while (4 == bx::read(_reader, chunk) ) |