Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-11-24 13:43:16 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-11-27 14:11:56 +0300
commit37fc23dd9e7738de7187e889f058cda845544ffb (patch)
treeb1423676fcc8f2cc07fdeb8125152e4d7d105b6a /source/blender/editors/include/ED_view3d.h
parentff9cf0664529db88bd2ea6e13dde6f002054c745 (diff)
Refactor view3d offscreen drawing to avoid having multiple boolean arguments
This is fully unreadable to have lots of boolean arguments scattered across the whole argument list. What does `false, true, true` mean in terms of behavior? Replace those with bitfield which has advantage of having more human readable meaning.
Diffstat (limited to 'source/blender/editors/include/ED_view3d.h')
-rw-r--r--source/blender/editors/include/ED_view3d.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 85fb0ee4447..0a87360e58d 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -367,15 +367,26 @@ void ED_view3d_draw_setup_view(
struct wmWindow *win, struct Scene *scene, struct ARegion *ar, struct View3D *v3d,
float viewmat[4][4], float winmat[4][4], const struct rcti *rect);
+enum {
+ V3D_OFSDRAW_NONE = (0),
+
+ V3D_OFSDRAW_USE_BACKGROUND = (1 << 0),
+ V3D_OFSDRAW_USE_FULL_SAMPLE = (1 << 1),
+
+ /* Only works with ED_view3d_draw_offscreen_imbuf_simple(). */
+ V3D_OFSDRAW_USE_GPENCIL = (1 << 2),
+ V3D_OFSDRAW_USE_SOLID_TEX = (1 << 2),
+};
+
struct ImBuf *ED_view3d_draw_offscreen_imbuf(
struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey,
- unsigned int flag, bool draw_background,
- int alpha_mode, int samples, bool full_samples, const char *viewname,
+ unsigned int flag, unsigned int draw_flags,
+ int alpha_mode, int samples, const char *viewname,
struct GPUFX *fx, struct GPUOffScreen *ofs, char err_out[256]);
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(
struct Scene *scene, struct Object *camera, int width, int height,
- unsigned int flag, int drawtype, bool use_solid_tex, bool use_gpencil, bool draw_background,
- int alpha_mode, int samples, bool full_samples, const char *viewname,
+ unsigned int flag, unsigned int draw_flags, int drawtype, int alpha_mode,
+ int samples, const char *viewname,
struct GPUFX *fx, struct GPUOffScreen *ofs, char err_out[256]);
struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);