From a269287f36cfb99621fc8a5172c050f4a1046ba1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Nov 2015 15:31:11 +1100 Subject: Cleanup: use single struct for freestyle globals Was shadowing local vars. --- source/blender/freestyle/intern/application/AppView.cpp | 6 +++--- source/blender/freestyle/intern/application/Controller.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender/freestyle/intern/application') diff --git a/source/blender/freestyle/intern/application/AppView.cpp b/source/blender/freestyle/intern/application/AppView.cpp index 9de426b91ab..c331d1de9c9 100644 --- a/source/blender/freestyle/intern/application/AppView.cpp +++ b/source/blender/freestyle/intern/application/AppView.cpp @@ -110,7 +110,7 @@ real AppView::distanceToSceneCenter() { BBox bbox = _ModelRootNode->bbox(); - Vec3r v(freestyle_viewpoint[0], freestyle_viewpoint[1], freestyle_viewpoint[2]); + Vec3r v(UNPACK3(g_freestyle.viewpoint)); v -= 0.5 * (bbox.getMin() + bbox.getMax()); return v.norm(); @@ -121,7 +121,7 @@ real AppView::znear() BBox bbox = _ModelRootNode->bbox(); Vec3r u = bbox.getMin(); Vec3r v = bbox.getMax(); - Vec3r cameraCenter(freestyle_viewpoint[0], freestyle_viewpoint[1], freestyle_viewpoint[2]); + Vec3r cameraCenter(UNPACK3(g_freestyle.viewpoint)); Vec3r w1(u[0], u[1], u[2]); Vec3r w2(v[0], u[1], u[2]); @@ -156,7 +156,7 @@ real AppView::zfar() BBox bbox = _ModelRootNode->bbox(); Vec3r u = bbox.getMin(); Vec3r v = bbox.getMax(); - Vec3r cameraCenter(freestyle_viewpoint[0], freestyle_viewpoint[1], freestyle_viewpoint[2]); + Vec3r cameraCenter(UNPACK3(g_freestyle.viewpoint)); Vec3r w1(u[0], u[1], u[2]); Vec3r w2(v[0], u[1], u[2]); diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp index eb6a4702cba..136fec3dd1c 100644 --- a/source/blender/freestyle/intern/application/Controller.cpp +++ b/source/blender/freestyle/intern/application/Controller.cpp @@ -289,14 +289,14 @@ int Controller::LoadMesh(Render *re, SceneRenderLayer *srl) if (_EnableViewMapCache) { NodeCamera *cam; - if (freestyle_proj[3][3] != 0.0) + if (g_freestyle.proj[3][3] != 0.0) cam = new NodeOrthographicCamera; else cam = new NodePerspectiveCamera; double proj[16]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { - proj[i * 4 + j] = freestyle_proj[i][j]; + proj[i * 4 + j] = g_freestyle.proj[i][j]; } } cam->setProjectionMatrix(proj); @@ -477,7 +477,7 @@ void Controller::ComputeViewMap() // Restore the context of view: // we need to perform all these operations while the // 3D context is on. - Vec3f vp(freestyle_viewpoint[0], freestyle_viewpoint[1], freestyle_viewpoint[2]); + Vec3f vp(UNPACK3(g_freestyle.viewpoint)); #if 0 if (G.debug & G_DEBUG_FREESTYLE) { @@ -487,7 +487,7 @@ void Controller::ComputeViewMap() real mv[4][4]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { - mv[i][j] = freestyle_mv[i][j]; + mv[i][j] = g_freestyle.mv[i][j]; #if 0 if (G.debug & G_DEBUG_FREESTYLE) { cout << mv[i][j] << " "; @@ -509,7 +509,7 @@ void Controller::ComputeViewMap() real proj[4][4]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { - proj[i][j] = freestyle_proj[i][j]; + proj[i][j] = g_freestyle.proj[i][j]; #if 0 if (G.debug & G_DEBUG_FREESTYLE) { cout << proj[i][j] << " "; @@ -525,7 +525,7 @@ void Controller::ComputeViewMap() int viewport[4]; for (int i = 0; i < 4; i++) - viewport[i] = freestyle_viewport[i]; + viewport[i] = g_freestyle.viewport[i]; #if 0 if (G.debug & G_DEBUG_FREESTYLE) { -- cgit v1.2.3