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:
authorJoshua Leung <aligorith@gmail.com>2012-06-11 04:46:22 +0400
committerJoshua Leung <aligorith@gmail.com>2012-06-11 04:46:22 +0400
commitc711665ce2f13fabf8774752e3a7ecc80555b8fb (patch)
tree6e943583698cdcef635a018b6432295de3e906e6 /source/blender/editors/gpencil
parent0df68aacb10a7f947673d925e09a539ee8c4bb9c (diff)
Code cleanup - Removing/commenting out various bits of legacy cruft related to
old Grease Pencil stuff
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c59
3 files changed, 14 insertions, 53 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;