[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32459] trunk/blender/source/blender/ editors: remove unused args in draw*.c and some in view*.c, tag some as UNUSED().

Campbell Barton ideasman42 at gmail.com
Thu Oct 14 03:22:27 CEST 2010


Revision: 32459
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32459
Author:   campbellbarton
Date:     2010-10-14 03:22:14 +0200 (Thu, 14 Oct 2010)

Log Message:
-----------
remove unused args in draw*.c and some in view*.c, tag some as UNUSED().

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_draw.c
    trunk/blender/source/blender/editors/gpencil/drawgpencil.c
    trunk/blender/source/blender/editors/include/UI_view2d.h
    trunk/blender/source/blender/editors/interface/view2d.c
    trunk/blender/source/blender/editors/screen/area.c
    trunk/blender/source/blender/editors/space_action/space_action.c
    trunk/blender/source/blender/editors/space_buttons/space_buttons.c
    trunk/blender/source/blender/editors/space_console/space_console.c
    trunk/blender/source/blender/editors/space_file/space_file.c
    trunk/blender/source/blender/editors/space_graph/space_graph.c
    trunk/blender/source/blender/editors/space_image/space_image.c
    trunk/blender/source/blender/editors/space_logic/space_logic.c
    trunk/blender/source/blender/editors/space_nla/space_nla.c
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/editors/space_node/node_draw.c
    trunk/blender/source/blender/editors/space_outliner/outliner.c
    trunk/blender/source/blender/editors/space_script/space_script.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
    trunk/blender/source/blender/editors/space_sound/space_sound.c
    trunk/blender/source/blender/editors/space_text/space_text.c
    trunk/blender/source/blender/editors/space_time/space_time.c
    trunk/blender/source/blender/editors/space_view3d/drawanimviz.c
    trunk/blender/source/blender/editors/space_view3d/drawarmature.c
    trunk/blender/source/blender/editors/space_view3d/drawmesh.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/editors/space_view3d/drawvolume.c
    trunk/blender/source/blender/editors/space_view3d/view3d_header.c
    trunk/blender/source/blender/editors/space_view3d/view3d_intern.h

Modified: trunk/blender/source/blender/editors/animation/anim_draw.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_draw.c	2010-10-14 00:33:39 UTC (rev 32458)
+++ trunk/blender/source/blender/editors/animation/anim_draw.c	2010-10-14 01:22:14 UTC (rev 32459)
@@ -256,7 +256,7 @@
 	
 	/* Draw current frame number in a little box */
 	if (flag & DRAWCFRA_SHOW_NUMBOX) {
-		UI_view2d_view_orthoSpecial(C, v2d, 1);
+		UI_view2d_view_orthoSpecial(CTX_wm_region(C), v2d, 1);
 		draw_cfra_number(scene, v2d, vec[0], (flag & DRAWCFRA_UNIT_SECONDS));
 	}
 }

Modified: trunk/blender/source/blender/editors/gpencil/drawgpencil.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/drawgpencil.c	2010-10-14 00:33:39 UTC (rev 32458)
+++ trunk/blender/source/blender/editors/gpencil/drawgpencil.c	2010-10-14 01:22:14 UTC (rev 32459)
@@ -199,7 +199,7 @@
 }
 
 /* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */
-static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy)
+static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thickness, short debug)
 {
 	bGPDspoint *pt;
 	float oldpressure = 0.0f;
@@ -501,7 +501,7 @@
 		if (gps->totpoints == 1)
 			gp_draw_stroke_point(gps->points, lthick, gps->flag, offsx, offsy, winx, winy);
 		else if (dflag & GP_DRAWDATA_ONLY3D)
-			gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
+			gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, debug);
 		else if (gps->totpoints > 1)	
 			gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, offsx, offsy, winx, winy);
 	}

Modified: trunk/blender/source/blender/editors/include/UI_view2d.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_view2d.h	2010-10-14 00:33:39 UTC (rev 32458)
+++ trunk/blender/source/blender/editors/include/UI_view2d.h	2010-10-14 01:22:14 UTC (rev 32459)
@@ -156,14 +156,14 @@
 int UI_view2d_tab_set(struct View2D *v2d, int tab);
 
 /* view matrix operations */
-void UI_view2d_view_ortho(const struct bContext *C, struct View2D *v2d);
-void UI_view2d_view_orthoSpecial(const struct bContext *C, struct View2D *v2d, short xaxis);
+void UI_view2d_view_ortho(struct View2D *v2d);
+void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, short xaxis);
 void UI_view2d_view_restore(const struct bContext *C);
 
 /* grid drawing */
-View2DGrid *UI_view2d_grid_calc(const struct bContext *C, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy);
-void UI_view2d_grid_draw(const struct bContext *C, struct View2D *v2d, View2DGrid *grid, int flag);
-void UI_view2d_constant_grid_draw(const struct bContext *C, struct View2D *v2d);
+View2DGrid *UI_view2d_grid_calc(struct Scene *scene, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy);
+void UI_view2d_grid_draw(struct View2D *v2d, View2DGrid *grid, int flag);
+void UI_view2d_constant_grid_draw(struct View2D *v2d);
 void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy);
 void UI_view2d_grid_free(View2DGrid *grid);
 

Modified: trunk/blender/source/blender/editors/interface/view2d.c
===================================================================
--- trunk/blender/source/blender/editors/interface/view2d.c	2010-10-14 00:33:39 UTC (rev 32458)
+++ trunk/blender/source/blender/editors/interface/view2d.c	2010-10-14 01:22:14 UTC (rev 32459)
@@ -967,7 +967,7 @@
 }
 
 /* Set view matrices to use 'cur' rect as viewing frame for View2D drawing */
-void UI_view2d_view_ortho(const bContext *C, View2D *v2d)
+void UI_view2d_view_ortho(View2D *v2d)
 {
 	rctf curmasked;
 	float xofs, yofs;
@@ -997,9 +997,8 @@
 /* Set view matrices to only use one axis of 'cur' only
  *	- xaxis 	= if non-zero, only use cur x-axis, otherwise use cur-yaxis (mostly this will be used for x)
  */
-void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis)
+void UI_view2d_view_orthoSpecial(ARegion *ar, View2D *v2d, short xaxis)
 {
-	ARegion *ar= CTX_wm_region(C);
 	rctf curmasked;
 	float xofs, yofs;
 	
@@ -1098,12 +1097,12 @@
  *	
  *	- xunits,yunits	= V2D_UNIT_*  grid steps in seconds or frames 
  *	- xclamp,yclamp	= V2D_CLAMP_* only show whole-number intervals
- *	- winx			= width of region we're drawing to
+ *	- winx			= width of region we're drawing to, note: not used but keeping for compleateness.
  *	- winy			= height of region we're drawing into
  */
-View2DGrid *UI_view2d_grid_calc(const bContext *C, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy)
+View2DGrid *UI_view2d_grid_calc(Scene *scene, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int UNUSED(winx), int winy)
 {
-	Scene *scene= CTX_data_scene(C);
+
 	View2DGrid *grid;
 	float space, pixels, seconddiv;
 	int secondgrid;
@@ -1174,7 +1173,7 @@
 }
 
 /* Draw gridlines in the given 2d-region */
-void UI_view2d_grid_draw(const bContext *C, View2D *v2d, View2DGrid *grid, int flag)
+void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
 {
 	float vec1[2], vec2[2];
 	int a, step;
@@ -1283,7 +1282,7 @@
 }
 
 /* Draw a constant grid in given 2d-region */
-void UI_view2d_constant_grid_draw(const bContext *C, View2D *v2d)
+void UI_view2d_constant_grid_draw(View2D *v2d)
 {
 	float start, step= 25.0f;
 
@@ -1481,7 +1480,7 @@
 		scrollers->yclamp= yclamp;
 		scrollers->yunits= yunits;
 		
-		scrollers->grid= UI_view2d_grid_calc(C, v2d, xunits, xclamp, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin));
+		scrollers->grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, xunits, xclamp, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin));
 	}
 	
 	/* return scrollers */
@@ -1489,7 +1488,7 @@
 }
 
 /* Print scale marking along a time scrollbar */
-static void scroll_printstr(View2DScrollers *scrollers, Scene *scene, float x, float y, float val, int power, short unit, char dir)
+static void scroll_printstr(Scene *scene, float x, float y, float val, int power, short unit, char dir)
 {
 	int len;
 	char str[32];
@@ -1614,16 +1613,16 @@
 					
 					switch (vs->xunits) {							
 						case V2D_UNIT_FRAMES:		/* frames (as whole numbers)*/
-							scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMES, 'h');
+							scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMES, 'h');
 							break;
 							
 						case V2D_UNIT_FRAMESCALE:	/* frames (not always as whole numbers) */
-							scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h');
+							scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h');
 							break;
 						
 						case V2D_UNIT_SECONDS:		/* seconds */
 							fac2= val/(float)FPS;
-							scroll_printstr(vs, scene, fac, h, fac2, grid->powerx, V2D_UNIT_SECONDS, 'h');
+							scroll_printstr(scene, fac, h, fac2, grid->powerx, V2D_UNIT_SECONDS, 'h');
 							break;
 							
 						case V2D_UNIT_SECONDSSEQ:	/* seconds with special calculations (only used for sequencer only) */
@@ -1634,13 +1633,13 @@
 							time= (float)floor(fac2);
 							fac2= fac2-time;
 							
-							scroll_printstr(vs, scene, fac, h, time+(float)FPS*fac2/100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
+							scroll_printstr(scene, fac, h, time+(float)FPS*fac2/100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
 						}
 							break;
 							
 						case V2D_UNIT_DEGREES:		/* Graph Editor for rotation Drivers */
 							/* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */
-							scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v');
+							scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v');
 							break;
 					}
 				}
@@ -1719,7 +1718,7 @@
 					if(fac < vert.ymin+10)
 						continue;
 					
-					scroll_printstr(vs, scene, (float)(vert.xmax)-2.0f, fac, val, grid->powery, vs->yunits, 'v');
+					scroll_printstr(scene, (float)(vert.xmax)-2.0f, fac, val, grid->powery, vs->yunits, 'v');
 				}
 				
 				BLF_disable_default(BLF_ROTATION);

Modified: trunk/blender/source/blender/editors/screen/area.c
===================================================================
--- trunk/blender/source/blender/editors/screen/area.c	2010-10-14 00:33:39 UTC (rev 32458)
+++ trunk/blender/source/blender/editors/screen/area.c	2010-10-14 01:22:14 UTC (rev 32459)
@@ -1244,7 +1244,7 @@
 	uiBeginPanels(C, ar);
 
 	/* set view2d view matrix for scrolling (without scrollers) */
-	UI_view2d_view_ortho(C, v2d);
+	UI_view2d_view_ortho(v2d);
 
 	for(pt= ar->type->paneltypes.first; pt; pt= pt->next) {
 		/* verify context */
@@ -1365,7 +1365,7 @@
 	UI_view2d_totRect_set(v2d, x+V2D_SCROLL_WIDTH, y+V2D_SCROLL_HEIGHT);
 
 	/* set the view */
-	UI_view2d_view_ortho(C, v2d);
+	UI_view2d_view_ortho(v2d);
 
 	/* this does the actual drawing! */
 	uiEndPanels(C, ar);
@@ -1414,7 +1414,7 @@
 	glClear(GL_COLOR_BUFFER_BIT);
 	
 	/* set view2d view matrix for scrolling (without scrollers) */
-	UI_view2d_view_ortho(C, &ar->v2d);
+	UI_view2d_view_ortho(&ar->v2d);
 
 	xco= maxco= 8;
 	yco= HEADERY-3;

Modified: trunk/blender/source/blender/editors/space_action/space_action.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/space_action.c	2010-10-14 00:33:39 UTC (rev 32458)
+++ trunk/blender/source/blender/editors/space_action/space_action.c	2010-10-14 01:22:14 UTC (rev 32459)
@@ -169,12 +169,12 @@
 	UI_ThemeClearColor(TH_BACK);
 	glClear(GL_COLOR_BUFFER_BIT);
 	
-	UI_view2d_view_ortho(C, v2d);
+	UI_view2d_view_ortho(v2d);
 	
 	/* time grid */
 	unit= (saction->flag & SACTION_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
-	grid= UI_view2d_grid_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
-	UI_view2d_grid_draw(C, v2d, grid, V2D_GRIDLINES_ALL);
+	grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
+	UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
 	UI_view2d_grid_free(grid);
 	
 	/* data */
@@ -188,11 +188,11 @@
 	ANIM_draw_cfra(C, v2d, flag);
 	

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list