|
|
@@ -7,6 +7,8 @@
|
|
|
#define __BGFX_P_H__
|
|
|
|
|
|
#include "bgfx.h"
|
|
|
+#include "config.h"
|
|
|
+
|
|
|
#include <inttypes.h>
|
|
|
#include <stdarg.h> // va_list
|
|
|
#include <stdio.h>
|
|
|
@@ -14,17 +16,16 @@
|
|
|
#include <string.h>
|
|
|
#include <alloca.h>
|
|
|
|
|
|
-extern void dbgPrintf(const char* _format, ...);
|
|
|
-extern void dbgPrintfData(const void* _data, uint32_t _size, const char* _format, ...);
|
|
|
-
|
|
|
-#ifndef BGFX_CONFIG_DEBUG
|
|
|
-# define BGFX_CONFIG_DEBUG 0
|
|
|
-#endif // BGFX_CONFIG_DEBUG
|
|
|
+namespace bgfx
|
|
|
+{
|
|
|
+ void fatal(Fatal::Enum _code, const char* _format, ...);
|
|
|
+ void dbgPrintf(const char* _format, ...);
|
|
|
+}
|
|
|
|
|
|
#if BGFX_CONFIG_DEBUG
|
|
|
# define BX_TRACE(_format, ...) \
|
|
|
do { \
|
|
|
- dbgPrintf(BX_FILE_LINE_LITERAL "BGFX " _format "\n", ##__VA_ARGS__); \
|
|
|
+ bgfx::dbgPrintf(BX_FILE_LINE_LITERAL "BGFX " _format "\n", ##__VA_ARGS__); \
|
|
|
} while(0)
|
|
|
|
|
|
# define BX_WARN(_condition, _format, ...) \
|
|
|
@@ -40,7 +41,7 @@ extern void dbgPrintfData(const void* _data, uint32_t _size, const char* _format
|
|
|
if (!(_condition) ) \
|
|
|
{ \
|
|
|
BX_TRACE("CHECK " _format, ##__VA_ARGS__); \
|
|
|
- bx::debugBreak(); \
|
|
|
+ bgfx::fatal(bgfx::Fatal::DebugCheck, _format, ##__VA_ARGS__); \
|
|
|
} \
|
|
|
} while(0)
|
|
|
#endif // 0
|
|
|
@@ -65,6 +66,7 @@ extern void dbgPrintfData(const void* _data, uint32_t _size, const char* _format
|
|
|
#include <bx/ringbuffer.h>
|
|
|
#include <bx/uint32_t.h>
|
|
|
#include <bx/readerwriter.h>
|
|
|
+#include <bx/string.h>
|
|
|
|
|
|
#include "dds.h"
|
|
|
|
|
|
@@ -109,8 +111,6 @@ namespace stl {
|
|
|
# include <xtl.h>
|
|
|
#endif // BX_PLATFORM_*
|
|
|
|
|
|
-#include "config.h"
|
|
|
-
|
|
|
#include <bx/cpu.h>
|
|
|
#include <bx/thread.h>
|
|
|
#include <bx/timer.h>
|
|
|
@@ -196,7 +196,6 @@ namespace bgfx
|
|
|
extern ReallocFn g_realloc;
|
|
|
extern FreeFn g_free;
|
|
|
|
|
|
- void fatal(Fatal::Enum _code, const char* _format, ...);
|
|
|
void release(const Memory* _mem);
|
|
|
void saveTga(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bool _grayscale = false, bool _yflip = false);
|
|
|
const char* getAttribName(Attrib::Enum _attr);
|
|
|
@@ -323,7 +322,7 @@ namespace bgfx
|
|
|
{
|
|
|
char* temp = (char*)alloca(m_width);
|
|
|
|
|
|
- uint32_t num = vsnprintf(temp, m_width, _format, _argList);
|
|
|
+ uint32_t num = bx::vsnprintf(temp, m_width, _format, _argList);
|
|
|
|
|
|
uint8_t* mem = &m_mem[(_y*m_width+_x)*2];
|
|
|
for (uint32_t ii = 0, xx = _x; ii < num && xx < m_width; ++ii, ++xx)
|
|
|
@@ -986,7 +985,11 @@ namespace bgfx
|
|
|
|
|
|
if (0 < m_numDropped)
|
|
|
{
|
|
|
- BX_TRACE("Too many draw calls: %d, dropped %d (max: %d)", m_num+m_numDropped, m_numDropped, BGFX_CONFIG_MAX_DRAW_CALLS);
|
|
|
+ BX_TRACE("Too many draw calls: %d, dropped %d (max: %d)"
|
|
|
+ , m_num+m_numDropped
|
|
|
+ , m_numDropped
|
|
|
+ , BGFX_CONFIG_MAX_DRAW_CALLS
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|