From 9aa304f86fa24db8bcbf26f1f00e5ff0c8f1be16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 10 Apr 2015 19:21:31 -0700 Subject: [PATCH] Cleanup. --- src/bgfx.cpp | 19 ------------------- src/bgfx_p.h | 2 -- src/renderer_d3d11.cpp | 2 +- src/renderer_d3d9.cpp | 2 +- src/renderer_gl.cpp | 2 +- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index ff6b165d4..c45af73ab 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -278,25 +278,6 @@ namespace bgfx g_callback->fatal(_code, temp); } - void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far) - { - const float aa = 2.0f/(_right - _left); - const float bb = 2.0f/(_top - _bottom); - const float cc = 1.0f/(_far - _near); - const float dd = (_left + _right)/(_left - _right); - const float ee = (_top + _bottom)/(_bottom - _top); - const float ff = _near / (_near - _far); - - memset(_result, 0, sizeof(float)*16); - _result[0] = aa; - _result[5] = bb; - _result[10] = cc; - _result[12] = dd; - _result[13] = ee; - _result[14] = ff; - _result[15] = 1.0f; - } - #include "charset.h" void charsetFillTexture(const uint8_t* _charset, uint8_t* _rgba, uint32_t _height, uint32_t _pitch, uint32_t _bpp) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 5b4872e90..447ffb754 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -816,8 +816,6 @@ namespace bgfx } }; - void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far); - struct MatrixCache { MatrixCache() diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 273150ff5..4429e1e85 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1171,7 +1171,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); deviceCtx->IASetIndexBuffer(ib.m_ptr, DXGI_FORMAT_R16_UINT, 0); float proj[16]; - mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); + bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); PredefinedUniform& predefined = program.m_predefined[0]; uint8_t flags = predefined.m_type; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 44863b693..dfd0b5bea 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -944,7 +944,7 @@ namespace bgfx { namespace d3d9 DX_CHECK(device->SetIndices(ib.m_ptr) ); float proj[16]; - mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); + bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); PredefinedUniform& predefined = program.m_predefined[0]; uint8_t flags = predefined.m_type; diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index d5196a38a..d2ed78bcd 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1857,7 +1857,7 @@ namespace bgfx { namespace gl GL_CHECK(glUniform1i(program.m_sampler[0], 0) ); float proj[16]; - mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); + bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); GL_CHECK(glUniformMatrix4fv(program.m_predefined[0].m_loc , 1