diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-29 13:13:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-29 13:23:30 +0300 |
commit | f2c52aa0e1a5a6905849daa299ab907e60cab983 (patch) | |
tree | 66a0a61f511929ada3cfd08668a38980724e4a7e /source/blender/editors/transform/transform_mode.h | |
parent | 855f7fee63c4bc57d5e154ced0e7e51bf315ea32 (diff) |
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.
Diffstat (limited to 'source/blender/editors/transform/transform_mode.h')
-rw-r--r-- | source/blender/editors/transform/transform_mode.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_mode.h b/source/blender/editors/transform/transform_mode.h index a2b95eb3de4..027fb6b6982 100644 --- a/source/blender/editors/transform/transform_mode.h +++ b/source/blender/editors/transform/transform_mode.h @@ -41,22 +41,28 @@ typedef struct TransDataGenericSlideVert { /* transform_mode.c */ int transform_mode_really_used(struct bContext *C, int mode); -bool transdata_check_local_center(TransInfo *t, short around); +bool transdata_check_local_center(const TransInfo *t, short around); bool transform_mode_is_changeable(const int mode); void protectedTransBits(short protectflag, float vec[3]); void protectedSizeBits(short protectflag, float size[3]); -void constraintTransLim(TransInfo *t, TransData *td); -void constraintSizeLim(TransInfo *t, TransData *td); +void constraintTransLim(const TransInfo *t, TransData *td); +void constraintSizeLim(const TransInfo *t, TransData *td); void headerRotation(TransInfo *t, char *str, int str_size, float final); -void ElementRotation_ex(TransInfo *t, - TransDataContainer *tc, +void ElementRotation_ex(const TransInfo *t, + const TransDataContainer *tc, TransData *td, const float mat[3][3], const float *center); -void ElementRotation( - TransInfo *t, TransDataContainer *tc, TransData *td, float mat[3][3], const short around); +void ElementRotation(const TransInfo *t, + const TransDataContainer *tc, + TransData *td, + const float mat[3][3], + const short around); void headerResize(TransInfo *t, const float vec[3], char *str, int str_size); -void ElementResize(TransInfo *t, TransDataContainer *tc, TransData *td, float mat[3][3]); +void ElementResize(const TransInfo *t, + const TransDataContainer *tc, + TransData *td, + const float mat[3][3]); short getAnimEdit_SnapMode(TransInfo *t); void doAnimEdit_SnapFrame( TransInfo *t, TransData *td, TransData2D *td2d, struct AnimData *adt, short autosnap); |