summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2023-01-04 23:29:18 -0500
committer GitHub <noreply@github.com>2023-01-04 23:29:18 -0500
commit94b1e168b2b97b48b81f7a8f64406b0a6f64184e (patch)
treef57362a0fa01bfe8f0ad75a447c4c9e10bc15756 /3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
parent5581eaa50a42256242f32569f59ce10d70ddd8c2 (diff)
Revert "Update BGFX, BX and BIMG (#10750)" (#10787)
This reverts commit 5581eaa50a42256242f32569f59ce10d70ddd8c2 due to link failure on macOS.
Diffstat (limited to '3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp72
1 files changed, 35 insertions, 37 deletions
diff --git a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
index eee5aef0816..782e3ddeba5 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
+++ b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include <bgfx/bgfx.h>
@@ -9,7 +9,6 @@
#include "../bgfx_utils.h"
#include "../packrect.h"
-#include <bx/debug.h>
#include <bx/mutex.h>
#include <bx/math.h>
#include <bx/sort.h>
@@ -1027,7 +1026,6 @@ struct DebugDrawEncoderImpl
void init(bgfx::Encoder* _encoder)
{
m_defaultEncoder = _encoder;
- m_state = State::Count;
}
void shutdown()
@@ -1036,7 +1034,7 @@ struct DebugDrawEncoderImpl
void begin(bgfx::ViewId _viewId, bool _depthTestLess, bgfx::Encoder* _encoder)
{
- BX_ASSERT(State::Count == m_state, "");
+ BX_ASSERT(State::Count == m_state);
m_viewId = _viewId;
m_encoder = _encoder == NULL ? m_defaultEncoder : _encoder;
@@ -1081,14 +1079,14 @@ struct DebugDrawEncoderImpl
void push()
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
++m_stack;
m_attrib[m_stack] = m_attrib[m_stack-1];
}
void pop()
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
const Attrib& curr = m_attrib[m_stack];
const Attrib& prev = m_attrib[m_stack-1];
if (curr.m_stipple != prev.m_stipple
@@ -1101,7 +1099,7 @@ struct DebugDrawEncoderImpl
void setDepthTestLess(bool _depthTestLess)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
if (m_depthTestLess != _depthTestLess)
{
m_depthTestLess = _depthTestLess;
@@ -1117,7 +1115,7 @@ struct DebugDrawEncoderImpl
void setTransform(const void* _mtx, uint16_t _num = 1, bool _flush = true)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
if (_flush)
{
flush();
@@ -1153,7 +1151,7 @@ struct DebugDrawEncoderImpl
void pushTransform(const void* _mtx, uint16_t _num, bool _flush = true)
{
BX_ASSERT(m_mtxStackCurrent < BX_COUNTOF(m_mtxStack), "Out of matrix stack!");
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
if (_flush)
{
flush();
@@ -1183,7 +1181,7 @@ struct DebugDrawEncoderImpl
void popTransform(bool _flush = true)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
if (_flush)
{
flush();
@@ -1243,25 +1241,25 @@ struct DebugDrawEncoderImpl
void setColor(uint32_t _abgr)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
m_attrib[m_stack].m_abgr = _abgr;
}
void setLod(uint8_t _lod)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
m_attrib[m_stack].m_lod = _lod;
}
void setWireframe(bool _wireframe)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
m_attrib[m_stack].m_wireframe = _wireframe;
}
void setStipple(bool _stipple, float _scale = 1.0f, float _offset = 0.0f)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
Attrib& attrib = m_attrib[m_stack];
@@ -1283,7 +1281,7 @@ struct DebugDrawEncoderImpl
void moveTo(float _x, float _y, float _z = 0.0f)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
softFlush();
@@ -1303,7 +1301,7 @@ struct DebugDrawEncoderImpl
void moveTo(const bx::Vec3& _pos)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
moveTo(_pos.x, _pos.y, _pos.z);
}
@@ -1314,7 +1312,7 @@ struct DebugDrawEncoderImpl
void lineTo(float _x, float _y, float _z = 0.0f)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
if (State::None == m_state)
{
moveTo(_x, _y, _z);
@@ -1367,7 +1365,7 @@ struct DebugDrawEncoderImpl
void lineTo(const bx::Vec3& _pos)
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
lineTo(_pos.x, _pos.y, _pos.z);
}
@@ -1378,14 +1376,14 @@ struct DebugDrawEncoderImpl
void close()
{
- BX_ASSERT(State::Count != m_state, "");
+ BX_ASSERT(State::Count != m_state);
DebugVertex& vertex = m_cache[m_vertexPos];
lineTo(vertex.m_x, vertex.m_y, vertex.m_z);
m_state = State::None;
}
- void draw(const bx::Aabb& _aabb)
+ void draw(const Aabb& _aabb)
{
const Attrib& attrib = m_attrib[m_stack];
if (attrib.m_wireframe)
@@ -1416,23 +1414,23 @@ struct DebugDrawEncoderImpl
}
else
{
- bx::Obb obb;
+ Obb obb;
toObb(obb, _aabb);
draw(DebugMesh::Cube, obb.mtx, 1, false);
}
}
- void draw(const bx::Cylinder& _cylinder, bool _capsule)
+ void draw(const Cylinder& _cylinder, bool _capsule)
{
drawCylinder(_cylinder.pos, _cylinder.end, _cylinder.radius, _capsule);
}
- void draw(const bx::Disk& _disk)
+ void draw(const Disk& _disk)
{
drawCircle(_disk.normal, _disk.center, _disk.radius, 0.0f);
}
- void draw(const bx::Obb& _obb)
+ void draw(const Obb& _obb)
{
const Attrib& attrib = m_attrib[m_stack];
if (attrib.m_wireframe)
@@ -1471,7 +1469,7 @@ struct DebugDrawEncoderImpl
}
}
- void draw(const bx::Sphere& _sphere)
+ void draw(const Sphere& _sphere)
{
const Attrib& attrib = m_attrib[m_stack];
float mtx[16];
@@ -1493,7 +1491,7 @@ struct DebugDrawEncoderImpl
draw(DebugMesh::Enum(DebugMesh::Sphere0 + lod), mtx, 1, attrib.m_wireframe);
}
- void draw(const bx::Triangle& _triangle)
+ void draw(const Triangle& _triangle)
{
Attrib& attrib = m_attrib[m_stack];
if (attrib.m_wireframe)
@@ -1957,7 +1955,7 @@ struct DebugDrawEncoderImpl
;
draw(DebugMesh::Enum(DebugMesh::Capsule0 + lod), mtx[0], 2, attrib.m_wireframe);
- bx::Sphere sphere;
+ Sphere sphere;
sphere.center = _from;
sphere.radius = _radius;
draw(sphere);
@@ -2427,42 +2425,42 @@ void DebugDrawEncoder::close()
DEBUG_DRAW_ENCODER(close() );
}
-void DebugDrawEncoder::draw(const bx::Aabb& _aabb)
+void DebugDrawEncoder::draw(const Aabb& _aabb)
{
DEBUG_DRAW_ENCODER(draw(_aabb) );
}
-void DebugDrawEncoder::draw(const bx::Cylinder& _cylinder)
+void DebugDrawEncoder::draw(const Cylinder& _cylinder)
{
DEBUG_DRAW_ENCODER(draw(_cylinder, false) );
}
-void DebugDrawEncoder::draw(const bx::Capsule& _capsule)
+void DebugDrawEncoder::draw(const Capsule& _capsule)
{
- DEBUG_DRAW_ENCODER(draw(*( (const bx::Cylinder*)&_capsule), true) );
+ DEBUG_DRAW_ENCODER(draw(*( (const Cylinder*)&_capsule), true) );
}
-void DebugDrawEncoder::draw(const bx::Disk& _disk)
+void DebugDrawEncoder::draw(const Disk& _disk)
{
DEBUG_DRAW_ENCODER(draw(_disk) );
}
-void DebugDrawEncoder::draw(const bx::Obb& _obb)
+void DebugDrawEncoder::draw(const Obb& _obb)
{
DEBUG_DRAW_ENCODER(draw(_obb) );
}
-void DebugDrawEncoder::draw(const bx::Sphere& _sphere)
+void DebugDrawEncoder::draw(const Sphere& _sphere)
{
DEBUG_DRAW_ENCODER(draw(_sphere) );
}
-void DebugDrawEncoder::draw(const bx::Triangle& _triangle)
+void DebugDrawEncoder::draw(const Triangle& _triangle)
{
DEBUG_DRAW_ENCODER(draw(_triangle) );
}
-void DebugDrawEncoder::draw(const bx::Cone& _cone)
+void DebugDrawEncoder::draw(const Cone& _cone)
{
DEBUG_DRAW_ENCODER(drawCone(_cone.pos, _cone.end, _cone.radius) );
}