summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/entry_android.cpp
diff options
context:
space:
mode:
author Бранимир Караџић <branimirkaradzic@gmail.com>2021-08-10 20:28:56 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2021-08-10 20:28:56 +0200
commit1a6a018fc3b393e6f769d7db3aea397175aba459 (patch)
tree1fd0418f1044b221537c682e3e7f02a4a2a72af2 /3rdparty/bgfx/examples/common/entry/entry_android.cpp
parent702c9b45cc3a0d3eaaf29cd595b7e3511316a348 (diff)
Update bgfx to latest
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry_android.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_android.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_android.cpp b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
index f56d649b99d..cd2baf9044f 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_android.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2019 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -108,18 +108,18 @@ namespace entry
virtual bool open(const bx::FilePath& _filePath, bx::Error* _err) override
{
- BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+ BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
if (NULL != m_file)
{
- BX_ERROR_SET(_err, BX_ERROR_READERWRITER_ALREADY_OPEN, "FileReader: File is already open.");
+ BX_ERROR_SET(_err, bx::kErrorReaderWriterAlreadyOpen, "FileReader: File is already open.");
return false;
}
m_file = AAssetManager_open(m_assetManager, _filePath.getCPtr(), AASSET_MODE_RANDOM);
if (NULL == m_file)
{
- BX_ERROR_SET(_err, BX_ERROR_READERWRITER_OPEN, "FileReader: Failed to open file.");
+ BX_ERROR_SET(_err, bx::kErrorReaderWriterOpen, "FileReader: Failed to open file.");
return false;
}
@@ -139,22 +139,22 @@ namespace entry
virtual int64_t seek(int64_t _offset, bx::Whence::Enum _whence) override
{
- BX_CHECK(NULL != m_file, "Reader/Writer file is not open.");
+ BX_ASSERT(NULL != m_file, "Reader/Writer file is not open.");
return AAsset_seek64(m_file, _offset, _whence);
}
virtual int32_t read(void* _data, int32_t _size, bx::Error* _err) override
{
- BX_CHECK(NULL != m_file, "Reader/Writer file is not open.");
- BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+ BX_ASSERT(NULL != m_file, "Reader/Writer file is not open.");
+ BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
int32_t size = (int32_t)AAsset_read(m_file, _data, _size);
if (size != _size)
{
if (0 == AAsset_getRemainingLength(m_file) )
{
- BX_ERROR_SET(_err, BX_ERROR_READERWRITER_EOF, "FileReader: EOF.");
+ BX_ERROR_SET(_err, bx::kErrorReaderWriterEof, "FileReader: EOF.");
}
return size >= 0 ? size : 0;
@@ -197,8 +197,8 @@ namespace entry
, 0
);
- const char* const argv[1] = { "android.so" };
- m_mte.m_argc = 1;
+ static const char* const argv[] = { "android.so" };
+ m_mte.m_argc = BX_COUNTOF(argv);
m_mte.m_argv = argv;
while (0 == m_app->destroyRequested)
@@ -555,7 +555,7 @@ namespace entry
BX_UNUSED(_thread);
int32_t result = chdir("/sdcard/bgfx/examples/runtime");
- BX_CHECK(0 == result, "Failed to chdir to dir. android.permission.WRITE_EXTERNAL_STORAGE?", errno);
+ BX_ASSERT(0 == result, "Failed to chdir to dir. android.permission.WRITE_EXTERNAL_STORAGE?", errno);
MainThreadEntry* self = (MainThreadEntry*)_userData;
result = main(self->m_argc, self->m_argv);