From c8b27d93db3577845661560e6bd51a184cc035c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 15 Jun 2016 17:34:59 -0700 Subject: [PATCH] Cleanup. --- examples/common/debugdraw/debugdraw.cpp | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/examples/common/debugdraw/debugdraw.cpp b/examples/common/debugdraw/debugdraw.cpp index b07395065..ea2019923 100644 --- a/examples/common/debugdraw/debugdraw.cpp +++ b/examples/common/debugdraw/debugdraw.cpp @@ -1440,31 +1440,33 @@ private: ); } + const float flip = 0 == (attrib.m_state & BGFX_STATE_CULL_CCW) ? 1.0f : -1.0f; + float params[4][4] = { - { - 0.0f, - -1.0f, - 0.0f, - 3.0f, + { // lightDir + 0.0f * flip, + -1.0f * flip, + 0.0f * flip, + 3.0f, // shininess }, - { + { // skyColor 1.0f, 0.9f, 0.8f, - 0.0f, + 0.0f, // unused }, - { + { // groundColor.xyz0 0.2f, 0.22f, 0.5f, - 0.0f, + 0.0f, // unused }, - { - ( (attrib.m_abgr>>24) )/255.0f, - ( (attrib.m_abgr>>16)&0xff)/255.0f, - ( (attrib.m_abgr>> 8)&0xff)/255.0f, + { // matColor ( (attrib.m_abgr )&0xff)/255.0f, + ( (attrib.m_abgr>> 8)&0xff)/255.0f, + ( (attrib.m_abgr>>16)&0xff)/255.0f, + ( (attrib.m_abgr>>24) )/255.0f, }, };