diff options
author | 2023-09-08 05:14:35 +1000 | |
---|---|---|
committer | 2023-09-08 05:14:35 +1000 | |
commit | 44eb5ea3c69dcec37e2b687e479297af5303efc3 (patch) | |
tree | 2784753bdf56564ce3b4cf0f410bf07709854fdd /3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp | |
parent | 1147d8fc44c701ed0235e9374f97d218fae37b32 (diff) |
Revert "Updated bgfx, bx and bimg to current upstream versions. (#11493)"
This reverts commit 1c61ccfe840cdae7a9f92292946a45f3b47e2412.
Diffstat (limited to '3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp index 201262c900f..eee5aef0816 100644 --- a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp +++ b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2022 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -640,11 +640,11 @@ struct DebugDrawShared const uint32_t numVertices = genSphere(tess); const uint32_t numIndices = numVertices; - vertices[id] = bx::alloc(m_allocator, numVertices*stride); + vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); bx::memSet(vertices[id], 0, numVertices*stride); genSphere(tess, vertices[id], stride); - uint16_t* trilist = (uint16_t*)bx::alloc(m_allocator, numIndices*sizeof(uint16_t) ); + uint16_t* trilist = (uint16_t*)BX_ALLOC(m_allocator, numIndices*sizeof(uint16_t) ); for (uint32_t ii = 0; ii < numIndices; ++ii) { trilist[ii] = uint16_t(ii); @@ -658,7 +658,7 @@ struct DebugDrawShared , numIndices , false ); - indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); uint16_t* indicesOut = indices[id]; bx::memCopy(indicesOut, trilist, numIndices*sizeof(uint16_t) ); @@ -681,7 +681,7 @@ struct DebugDrawShared startVertex += numVertices; startIndex += numIndices + numLineListIndices; - bx::free(m_allocator, trilist); + BX_FREE(m_allocator, trilist); } for (uint32_t mesh = 0; mesh < 4; ++mesh) @@ -695,8 +695,8 @@ struct DebugDrawShared const uint32_t numIndices = num*6; const uint32_t numLineListIndices = num*4; - vertices[id] = bx::alloc(m_allocator, numVertices*stride); - indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); + indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); bx::memSet(indices[id], 0, (numIndices + numLineListIndices)*sizeof(uint16_t) ); DebugShapeVertex* vertex = (DebugShapeVertex*)vertices[id]; @@ -756,8 +756,8 @@ struct DebugDrawShared const uint32_t numIndices = num*12; const uint32_t numLineListIndices = num*6; - vertices[id] = bx::alloc(m_allocator, numVertices*stride); - indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); + indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); bx::memSet(indices[id], 0, (numIndices + numLineListIndices)*sizeof(uint16_t) ); DebugShapeVertex* vertex = (DebugShapeVertex*)vertices[id]; @@ -826,8 +826,8 @@ struct DebugDrawShared const uint32_t numIndices = num*6; const uint32_t numLineListIndices = num*6; - vertices[id] = bx::alloc(m_allocator, numVertices*stride); - indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); + indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); bx::memSet(indices[id], 0, (numIndices + numLineListIndices)*sizeof(uint16_t) ); DebugShapeVertex* vertex = (DebugShapeVertex*)vertices[id]; @@ -919,8 +919,8 @@ struct DebugDrawShared , (m_mesh[id].m_numIndices[0]+m_mesh[id].m_numIndices[1])*sizeof(uint16_t) ); - bx::free(m_allocator, vertices[id]); - bx::free(m_allocator, indices[id]); + BX_FREE(m_allocator, vertices[id]); + BX_FREE(m_allocator, indices[id]); } bx::memCopy(&vb->data[m_mesh[DebugMesh::Quad].m_startVertex * stride] @@ -1650,7 +1650,7 @@ struct DebugDrawEncoderImpl void drawFrustum(const float* _viewProj) { - bx::Plane planes[6] = { bx::InitNone, bx::InitNone, bx::InitNone, bx::InitNone, bx::InitNone, bx::InitNone }; + bx::Plane planes[6] = { bx::init::None, bx::init::None, bx::init::None, bx::init::None, bx::init::None, bx::init::None }; buildFrustumPlanes(planes, _viewProj); const bx::Vec3 points[8] = @@ -1747,8 +1747,8 @@ struct DebugDrawEncoderImpl const float step = bx::kPi * 2.0f / num; _weight = bx::clamp(_weight, 0.0f, 2.0f); - bx::Vec3 udir(bx::InitNone); - bx::Vec3 vdir(bx::InitNone); + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); float xy0[2]; @@ -1819,8 +1819,8 @@ struct DebugDrawEncoderImpl const Attrib& attrib = m_attrib[m_stack]; if (attrib.m_wireframe) { - bx::Vec3 udir(bx::InitNone); - bx::Vec3 vdir(bx::InitNone); + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); const float halfExtent = _size*0.5f; @@ -1861,8 +1861,8 @@ struct DebugDrawEncoderImpl const Attrib& attrib = m_attrib[m_stack]; - bx::Vec3 udir(bx::InitNone); - bx::Vec3 vdir(bx::InitNone); + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); const Pack2D& pack = s_dds.m_sprite.get(_handle); @@ -1982,8 +1982,8 @@ struct DebugDrawEncoderImpl if (_thickness > 0.0f) { const bx::Vec3 from = { _x, _y, _z }; - bx::Vec3 mid(bx::InitNone); - bx::Vec3 to(bx::InitNone); + bx::Vec3 mid(bx::init::None); + bx::Vec3 to(bx::init::None); setColor(Axis::X == _highlight ? 0xff00ffff : 0xff0000ff); mid = { _x + _len - _thickness, _y, _z }; @@ -2025,8 +2025,8 @@ struct DebugDrawEncoderImpl { const Attrib& attrib = m_attrib[m_stack]; - bx::Vec3 udir(bx::InitNone); - bx::Vec3 vdir(bx::InitNone); + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); udir = bx::mul(udir, _step); |