From f2c52aa0e1a5a6905849daa299ab907e60cab983 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Jun 2021 20:13:55 +1000 Subject: Cleanup: use 'const' arguments in transform calculation Use const arguments to simplify further optimizations. Transforming elements shouldn't need to change their containers data-structures. ElementResize for grease pencil stroke thickness was modifying TransInfo.num & TransInfo.values_final. Now copies are operated on to preserve const correctness although it's worth investigating if this can be avoided altogether. --- source/blender/editors/transform/transform.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/transform/transform.h') diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 2df0d86d02b..4f97c3b6713 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -356,22 +356,22 @@ typedef struct TransCon { /** Apply function pointer for linear vectorial transformation * The last three parameters are pointers to the in/out/printable vectors. */ - void (*applyVec)(struct TransInfo *t, - struct TransDataContainer *tc, + void (*applyVec)(const struct TransInfo *t, + const struct TransDataContainer *tc, struct TransData *td, const float in[3], - float out[3]); + float r_out[3]); /** Apply function pointer for size transformation. */ - void (*applySize)(struct TransInfo *t, - struct TransDataContainer *tc, + void (*applySize)(const struct TransInfo *t, + const struct TransDataContainer *tc, struct TransData *td, - float smat[3][3]); + float r_smat[3][3]); /** Apply function pointer for rotation transformation */ - void (*applyRot)(struct TransInfo *t, - struct TransDataContainer *tc, + void (*applyRot)(const struct TransInfo *t, + const struct TransDataContainer *tc, struct TransData *td, - float vec[3], - float *angle); + float r_axis[3], + float *r_angle); } TransCon; typedef struct MouseInput { -- cgit v1.2.3