From 774022260a215dbd9ec3f978c1259f288fecb77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 20 May 2019 20:33:56 +0200 Subject: Workbench: Use DRWView instead of DRW_viewport_matrix_* Continuing the transition to the new API --- source/blender/draw/engines/workbench/workbench_data.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/draw/engines/workbench/workbench_data.c') diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index e4b2d0920b4..fce1d725133 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -147,7 +147,7 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) const int ssao_samples = scene->display.matcap_ssao_samples; float invproj[4][4]; - const bool is_persp = DRW_viewport_is_persp_get(); + const bool is_persp = DRW_view_is_persp_get(NULL); /* view vectors for the corners of the view frustum. * Can be used to recreate the world space position easily */ float viewvecs[3][4] = { @@ -170,9 +170,8 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) wpd->shading.cavity_ridge_factor, scene->display.matcap_ssao_attenuation); - /* invert the view matrix */ - DRW_viewport_matrix_get(wpd->winmat, DRW_MAT_WIN); - invert_m4_m4(invproj, wpd->winmat); + DRW_view_winmat_get(NULL, wpd->winmat, false); + DRW_view_winmat_get(NULL, invproj, true); /* convert the view vectors to view space */ for (i = 0; i < 3; i++) { @@ -212,7 +211,7 @@ void workbench_private_data_get_light_direction(WORKBENCH_PrivateData *wpd, Scene *scene = draw_ctx->scene; WORKBENCH_UBO_World *wd = &wpd->world_data; float view_matrix[4][4]; - DRW_viewport_matrix_get(view_matrix, DRW_MAT_VIEW); + DRW_view_viewmat_get(NULL, view_matrix, false); copy_v3_v3(r_light_direction, scene->display.light_direction); SWAP(float, r_light_direction[2], r_light_direction[1]); -- cgit v1.2.3