diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-06-11 04:46:22 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-06-11 04:46:22 +0400 |
commit | c711665ce2f13fabf8774752e3a7ecc80555b8fb (patch) | |
tree | 6e943583698cdcef635a018b6432295de3e906e6 /source/blender/editors | |
parent | 0df68aacb10a7f947673d925e09a539ee8c4bb9c (diff) |
Code cleanup - Removing/commenting out various bits of legacy cruft related to
old Grease Pencil stuff
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 59 | ||||
-rw-r--r-- | source/blender/editors/include/ED_gpencil.h | 8 | ||||
-rw-r--r-- | source/blender/editors/include/ED_sequencer.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 2 |
8 files changed, 22 insertions, 67 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index e4a24f13a0e..fa555b0ddb8 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -664,7 +664,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy, // ............................ /* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */ -void draw_gpencil_2dimage(bContext *C) +void draw_gpencil_2dimage(const bContext *C) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -726,7 +726,7 @@ void draw_gpencil_2dimage(bContext *C) /* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly * Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, second time with onlyv2d=0 for screen-aligned strokes */ -void draw_gpencil_view2d(bContext *C, short onlyv2d) +void draw_gpencil_view2d(const bContext *C, short onlyv2d) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 7094aa086ba..7708d99e990 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -78,7 +78,7 @@ /* Context Wrangling... */ /* Get pointer to active Grease Pencil datablock, and an RNA-pointer to trace back to whatever owns it */ -bGPdata **gpencil_data_get_pointers(bContext *C, PointerRNA *ptr) +bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr) { ID *screen_id = (ID *)CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); @@ -181,7 +181,7 @@ bGPdata **gpencil_data_get_pointers(bContext *C, PointerRNA *ptr) } /* Get the active Grease Pencil datablock */ -bGPdata *gpencil_data_get_active(bContext *C) +bGPdata *gpencil_data_get_active(const bContext *C) { bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); return (gpd_ptr) ? *(gpd_ptr) : NULL; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 5eef34f4afe..9d5779e448e 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -968,16 +968,6 @@ static int gp_session_initdata(bContext *C, tGPsdata *p) printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable\n"); return 0; } - -#if 0 // XXX will this sort of antiquated stuff be restored? - /* check that gpencil data is allowed to be drawn */ - if ((v3d->flag2 & V3D_DISPGP) == 0) { - p->status = GP_STATUS_ERROR; - if (G.debug & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown\n"); - return 0; - } -#endif } break; @@ -989,16 +979,6 @@ static int gp_session_initdata(bContext *C, tGPsdata *p) p->sa = curarea; p->ar = ar; p->v2d = &ar->v2d; - -#if 0 // XXX will this sort of antiquated stuff be restored? - /* check that gpencil data is allowed to be drawn */ - if ((snode->flag & SNODE_DISPGP) == 0) { - p->status = GP_STATUS_ERROR; - if (G.debug & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown\n"); - return 0; - } -#endif } break; case SPACE_SEQ: @@ -1017,14 +997,6 @@ static int gp_session_initdata(bContext *C, tGPsdata *p) printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil\n"); return 0; } -#if 0 // XXX will this sort of antiquated stuff be restored? - if ((sseq->flag & SEQ_DRAW_GPENCIL) == 0) { - p->status = GP_STATUS_ERROR; - if (G.debug & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown\n"); - return 0; - } -#endif } break; case SPACE_IMAGE: @@ -1035,48 +1007,36 @@ static int gp_session_initdata(bContext *C, tGPsdata *p) p->sa = curarea; p->ar = ar; p->v2d = &ar->v2d; - //p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - -#if 0 // XXX disabled for now - /* check that gpencil data is allowed to be drawn */ - if ((sima->flag & SI_DISPGP) == 0) { - p->status = GP_STATUS_ERROR; - if (G.debug & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown\n"); - return 0; - } -#endif } break; case SPACE_CLIP: { SpaceClip *sc = curarea->spacedata.first; - + /* set the current area */ p->sa = curarea; p->ar = ar; p->v2d = &ar->v2d; - //p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - + invert_m4_m4(p->imat, sc->unistabmat); - + /* custom color for new layer */ p->custom_color[0] = 1.0f; p->custom_color[1] = 0.0f; p->custom_color[2] = 0.5f; p->custom_color[3] = 0.9f; - + if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) { int framenr = sc->user.framenr; MovieTrackingTrack *track = BKE_tracking_active_track(&sc->clip->tracking); MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr); - + p->imat[3][0] -= marker->pos[0]; p->imat[3][1] -= marker->pos[1]; } } break; - + /* unsupported views */ default: { @@ -1157,7 +1117,7 @@ static void gp_paint_initstroke(tGPsdata *p, short paintmode) p->gpl = gpencil_layer_getactive(p->gpd); if (p->gpl == NULL) { p->gpl = gpencil_layer_addnew(p->gpd); - + if (p->custom_color[3]) copy_v3_v3(p->gpl->color, p->custom_color); } @@ -1465,8 +1425,9 @@ static void gpencil_draw_apply_event(wmOperator *op, wmEvent *event) float mousef[2]; int tablet = 0; - /* convert from window-space to area-space mouse coordintes */ - // NOTE: float to ints conversions, +1 factor is probably used to ensure a bit more accurate rounding... + /* convert from window-space to area-space mouse coordintes + * NOTE: float to ints conversions, +1 factor is probably used to ensure a bit more accurate rounding... + */ p->mval[0] = event->mval[0] + 1; p->mval[1] = event->mval[1] + 1; diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 8a480271635..1d461f797d6 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -64,8 +64,8 @@ typedef struct tGPspoint { /* ----------- Grease Pencil Tools/Context ------------- */ -struct bGPdata **gpencil_data_get_pointers(struct bContext *C, struct PointerRNA *ptr); -struct bGPdata *gpencil_data_get_active(struct bContext *C); +struct bGPdata **gpencil_data_get_pointers(const struct bContext *C, struct PointerRNA *ptr); +struct bGPdata *gpencil_data_get_active(const struct bContext *C); struct bGPdata *gpencil_data_get_active_v3d(struct Scene *scene); /* for offscreen rendering */ /* ----------- Grease Pencil Operators ----------------- */ @@ -76,8 +76,8 @@ void ED_operatortypes_gpencil(void); /* ------------ Grease-Pencil Drawing API ------------------ */ /* drawgpencil.c */ -void draw_gpencil_2dimage(struct bContext *C); -void draw_gpencil_view2d(struct bContext *C, short onlyv2d); +void draw_gpencil_2dimage(const struct bContext *C); +void draw_gpencil_view2d(const struct bContext *C, short onlyv2d); void draw_gpencil_view3d(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, short only3d); void gpencil_panel_standard(const struct bContext *C, struct Panel *pa); diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index c731245949e..cea567254de 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -27,8 +27,6 @@ #ifndef __ED_SEQUENCER_H__ #define __ED_SEQUENCER_H__ -#define SEQ_ZOOM_FAC(szoom) ((szoom) > 0.0f) ? (szoom) : ((szoom) == 0.0f) ? (1.0f) : (-1.0f / (szoom)) - struct Scene; struct Sequence; diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 998ebac1cb9..ac71eb972f6 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -565,7 +565,6 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d) /* draw in View2D space? */ if (onlyv2d) { /* draw grease-pencil ('image' strokes) */ - //if (sima->flag & SI_DISPGP) draw_gpencil_2dimage(C); } else { @@ -573,7 +572,6 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d) //SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C); /* draw grease-pencil ('screen' strokes) */ - //if (sima->flag & SI_DISPGP) draw_gpencil_view2d(C, 0); } } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 921aceb7b2e..c65bbd6e15f 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1138,15 +1138,15 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) glDisable(GL_BLEND); /* draw grease-pencil ('canvas' strokes) */ - if (/*(snode->flag & SNODE_DISPGP) &&*/ (snode->nodetree)) - draw_gpencil_view2d((bContext*)C, 1); + if (snode->nodetree) + draw_gpencil_view2d(C, 1); /* reset view matrix */ UI_view2d_view_restore(C); /* draw grease-pencil (screen strokes, and also paintbuffer) */ - if (/*(snode->flag & SNODE_DISPGP) && */(snode->nodetree)) - draw_gpencil_view2d((bContext*)C, 0); + if (snode->nodetree) + draw_gpencil_view2d(C, 0); /* scrollers */ scrollers= UI_view2d_scrollers_calc(C, v2d, 10, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 3119c2d44f8..e48450e93bd 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -976,7 +976,6 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq } /* draw grease-pencil (image aligned) */ -// if (sseq->flag & SEQ_DRAW_GPENCIL) draw_gpencil_2dimage(C); IMB_freeImBuf(ibuf); @@ -985,7 +984,6 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq UI_view2d_view_restore(C); /* draw grease-pencil (screen aligned) */ -// if (sseq->flag & SEQ_DRAW_GPENCIL) draw_gpencil_view2d(C, 0); //if (sc->mode == SC_MODE_MASKEDIT) { |