diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-07 16:48:52 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-07 16:48:52 +0400 |
commit | 925f21342709522afa334218e97e0b31f87f1516 (patch) | |
tree | 5fd06cc9a34227079fa47d8c9a7554c6441a7d32 /source/blender/blenkernel/BKE_DerivedMesh.h | |
parent | 43711d856891c46c1dc898554f40534d9b5f529f (diff) |
Code cleanup: simplify the DerivedMesh.drawMappedFaces interface.
This function pointer's 'setDrawOptions' parameter took a slightly
different type than the other drawing callbacks. In particular, it
could set a 'drawSmooth' value to indicate that smoothing should
always be enabled, overriding the face flag. However, all callbacks
either did not set this value, or set it unconditionally to
1. Replaced this by adding a new 'flag' parameter to drawFacesMapped,
which can be set to DM_DRAW_ALWAYS_SMOOTH where appropriate.
Also removed the 'useColors' parameter and replaced it with another
flag value, DM_DRAW_USE_COLORS.
Removed the 'wpaint__setSolidDrawOptions' callback, was only being
used to set the shading to smooth.
Diffstat (limited to 'source/blender/blenkernel/BKE_DerivedMesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_DerivedMesh.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 3fb245ff0fa..6b49235a0b7 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -130,7 +130,11 @@ typedef int (*DMCompareDrawOptions)(void *userData, int cur_index, int next_inde typedef void (*DMSetDrawInterpOptions)(void *userData, int index, float t); typedef int (*DMSetDrawOptions)(void *userData, int index); typedef int (*DMSetDrawOptionsTex)(struct MTFace *tface, int has_vcol, int matnr); -typedef int (*DMSetDrawOptionsShading)(void *userData, int index, int *drawSmooth_r); + +typedef enum DMDrawFlag { + DM_DRAW_USE_COLORS = 1, + DM_DRAW_ALWAYS_SMOOTH = 2 +} DMDrawFlag; typedef struct DerivedMesh DerivedMesh; struct DerivedMesh { @@ -346,10 +350,11 @@ struct DerivedMesh { * smooth shaded. */ void (*drawMappedFaces)(DerivedMesh *dm, - DMSetDrawOptionsShading setDrawOptions, + DMSetDrawOptions setDrawOptions, DMSetMaterial setMaterial, DMCompareDrawOptions compareDrawOptions, - void *userData, int useColors); + void *userData, + DMDrawFlag flag); /* Draw mapped faces using MTFace * o Drawing options too complicated to enumerate, look at code. |