From fb8a82a5fdb2daa27c0f848dbb74b16d465afa9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 3 Jan 2019 14:30:59 -0800 Subject: [PATCH] Cleanup. --- examples/common/bounds.cpp | 14 ++------------ tools/texturev/texturev.cpp | 11 ++++------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/examples/common/bounds.cpp b/examples/common/bounds.cpp index 2d73dfcb9..6f0b02887 100644 --- a/examples/common/bounds.cpp +++ b/examples/common/bounds.cpp @@ -137,25 +137,15 @@ void toAabb(Aabb& _aabb, const float* _mtx, const void* _vertices, uint32_t _num { bx::Vec3 min, max; uint8_t* vertex = (uint8_t*)_vertices; + min = max = bx::mul(bx::load(vertex), _mtx); - float position[3]; - bx::vec3MulMtx(position, (float*)vertex, _mtx); - min.x = max.x = position[0]; - min.y = max.y = position[1]; - min.z = max.z = position[2]; vertex += _stride; for (uint32_t ii = 1; ii < _numVertices; ++ii) { - bx::vec3MulMtx(position, (float*)vertex, _mtx); + bx::Vec3 pos = bx::mul(bx::load(vertex), _mtx); vertex += _stride; - bx::Vec3 pos = - { - position[0], - position[1], - position[2], - }; min = bx::min(pos, min); max = bx::max(pos, max); } diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 3b694927d..b88eb0d5a 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -2054,14 +2054,11 @@ int _main_(int _argc, char** _argv) if (view.m_fit) { - float wh[3] = { float(view.m_textureInfo.width), float(view.m_textureInfo.height), 0.0f }; - float result[3]; - bx::vec3MulMtx(result, wh, orientation); - result[0] = bx::round(bx::abs(result[0]) ); - result[1] = bx::round(bx::abs(result[1]) ); + const bx::Vec3 wh = { float(view.m_textureInfo.width), float(view.m_textureInfo.height), 0.0f }; + const bx::Vec3 result = bx::round(bx::abs(bx::mul(wh, orientation) ) ); - scale.set(bx::min(float(view.m_width) / result[0] - , float(view.m_height) / result[1]) + scale.set(bx::min(float(view.m_width) / result.x + , float(view.m_height) / result.y) , 0.1f*view.m_transitionTime ); }