diff options
author | Antonioya <blendergit@gmail.com> | 2019-05-29 21:17:46 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-05-29 21:17:46 +0300 |
commit | fee600f4798082b73ff668fc0cc45535e2a949e5 (patch) | |
tree | 637a0dbc3e9a0fc0cab321bf12a61e0a45810543 /source/blender/draw | |
parent | a8a95806b3cd19e4e1a1be559f23026d904f8b87 (diff) |
GPencil: Cleanup - Remove storage Grid matrix and replace with local variable
Now the matrix is copied when creating shading group and don't need to be saved in storage.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.c | 16 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.h | 1 |
2 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 000fb65e0c3..5a8c36d7b8a 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -591,6 +591,7 @@ void GPENCIL_cache_populate(void *vedata, Object *ob) ToolSettings *ts = scene->toolsettings; View3D *v3d = draw_ctx->v3d; const View3DCursor *cursor = &scene->cursor; + float grid_matrix[4][4]; if (ob->type == OB_GPENCIL && ob->data) { bGPdata *gpd = (bGPdata *)ob->data; @@ -658,32 +659,31 @@ void GPENCIL_cache_populate(void *vedata, Object *ob) switch (ts->gp_sculpt.lock_axis) { case GP_LOCKAXIS_VIEW: { /* align always to view */ - invert_m4_m4(stl->storage->grid_matrix, draw_ctx->rv3d->viewmat); + invert_m4_m4(grid_matrix, draw_ctx->rv3d->viewmat); /* copy ob location */ - copy_v3_v3(stl->storage->grid_matrix[3], ob->obmat[3]); + copy_v3_v3(grid_matrix[3], ob->obmat[3]); break; } case GP_LOCKAXIS_CURSOR: { float scale[3] = {1.0f, 1.0f, 1.0f}; - loc_eul_size_to_mat4( - stl->storage->grid_matrix, cursor->location, cursor->rotation_euler, scale); + loc_eul_size_to_mat4(grid_matrix, cursor->location, cursor->rotation_euler, scale); break; } default: { - copy_m4_m4(stl->storage->grid_matrix, ob->obmat); + copy_m4_m4(grid_matrix, ob->obmat); break; } } /* Move the origin to Object or Cursor */ if (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) { - copy_v3_v3(stl->storage->grid_matrix[3], cursor->location); + copy_v3_v3(grid_matrix[3], cursor->location); } else { - copy_v3_v3(stl->storage->grid_matrix[3], ob->obmat[3]); + copy_v3_v3(grid_matrix[3], ob->obmat[3]); } - DRW_shgroup_call(stl->g_data->shgrps_grid, e_data.batch_grid, stl->storage->grid_matrix); + DRW_shgroup_call(stl->g_data->shgrps_grid, e_data.batch_grid, grid_matrix); } } } diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index 5dab0a56b63..6b66f1374bb 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -190,7 +190,6 @@ typedef struct GPENCIL_Storage { DRWView *view; float view_vecs[2][4]; /* vec4[2] */ - float grid_matrix[4][4]; int shade_render[2]; Object *camera; /* camera pointer for render mode */ |