From 49f7c99c7786ce257fae28dfeae2f8ee5810424c Mon Sep 17 00:00:00 2001 From: Branimir Karadžić Date: Wed, 29 Mar 2017 17:09:40 +0200 Subject: Update BGFX and BX (nw) --- 3rdparty/bgfx/examples/common/camera.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to '3rdparty/bgfx/examples/common/camera.cpp') diff --git a/3rdparty/bgfx/examples/common/camera.cpp b/3rdparty/bgfx/examples/common/camera.cpp index e721bd2e2fd..a2a1c31dc78 100644 --- a/3rdparty/bgfx/examples/common/camera.cpp +++ b/3rdparty/bgfx/examples/common/camera.cpp @@ -15,32 +15,32 @@ int cmdMove(CmdContext* /*_context*/, void* /*_userData*/, int _argc, char const { if (_argc > 1) { - if (0 == strcmp(_argv[1], "forward") ) + if (0 == bx::strncmp(_argv[1], "forward") ) { cameraSetKeyState(CAMERA_KEY_FORWARD, true); return 0; } - else if (0 == strcmp(_argv[1], "left") ) + else if (0 == bx::strncmp(_argv[1], "left") ) { cameraSetKeyState(CAMERA_KEY_LEFT, true); return 0; } - else if (0 == strcmp(_argv[1], "right") ) + else if (0 == bx::strncmp(_argv[1], "right") ) { cameraSetKeyState(CAMERA_KEY_RIGHT, true); return 0; } - else if (0 == strcmp(_argv[1], "backward") ) + else if (0 == bx::strncmp(_argv[1], "backward") ) { cameraSetKeyState(CAMERA_KEY_BACKWARD, true); return 0; } - else if (0 == strcmp(_argv[1], "up") ) + else if (0 == bx::strncmp(_argv[1], "up") ) { cameraSetKeyState(CAMERA_KEY_UP, true); return 0; } - else if (0 == strcmp(_argv[1], "down") ) + else if (0 == bx::strncmp(_argv[1], "down") ) { cameraSetKeyState(CAMERA_KEY_DOWN, true); return 0; @@ -166,16 +166,16 @@ struct Camera float direction[3] = { - cosf(m_verticalAngle) * sinf(m_horizontalAngle), - sinf(m_verticalAngle), - cosf(m_verticalAngle) * cosf(m_horizontalAngle), + bx::fcos(m_verticalAngle) * bx::fsin(m_horizontalAngle), + bx::fsin(m_verticalAngle), + bx::fcos(m_verticalAngle) * bx::fcos(m_horizontalAngle), }; float right[3] = { - sinf(m_horizontalAngle - bx::piHalf), + bx::fsin(m_horizontalAngle - bx::piHalf), 0, - cosf(m_horizontalAngle - bx::piHalf), + bx::fcos(m_horizontalAngle - bx::piHalf), }; float up[3]; @@ -264,7 +264,7 @@ struct Camera void setPosition(const float* _pos) { - memcpy(m_eye, _pos, sizeof(float)*3); + bx::memCopy(m_eye, _pos, sizeof(float)*3); } void setVerticalAngle(float _verticalAngle) @@ -334,12 +334,12 @@ void cameraGetViewMtx(float* _viewMtx) void cameraGetPosition(float* _pos) { - memcpy(_pos, s_camera->m_eye, 3*sizeof(float) ); + bx::memCopy(_pos, s_camera->m_eye, 3*sizeof(float) ); } void cameraGetAt(float* _at) { - memcpy(_at, s_camera->m_at, 3*sizeof(float) ); + bx::memCopy(_at, s_camera->m_at, 3*sizeof(float) ); } void cameraUpdate(float _deltaTime, const entry::MouseState& _mouseState) -- cgit v1.2.3-70-g09d2