[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46375] trunk/blender/source/blender/ blenloader/intern: Style cleanup in readfile versioning files

Sergey Sharybin sergey.vfx at gmail.com
Mon May 7 08:32:14 CEST 2012


Revision: 46375
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46375
Author:   nazgul
Date:     2012-05-07 06:32:14 +0000 (Mon, 07 May 2012)
Log Message:
-----------
Style cleanup in readfile versioning files

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/versioning_250.c
    trunk/blender/source/blender/blenloader/intern/versioning_legacy.c

Modified: trunk/blender/source/blender/blenloader/intern/versioning_250.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/versioning_250.c	2012-05-07 02:37:56 UTC (rev 46374)
+++ trunk/blender/source/blender/blenloader/intern/versioning_250.c	2012-05-07 06:32:14 UTC (rev 46375)
@@ -25,10 +25,10 @@
  *
  */
 
-/** \file blender/blenloader/intern/readfile_250.c
+/** \file blender/blenloader/intern/versioning_250.c
  *  \ingroup blenloader
  */
- 
+
 #include "zlib.h"
 
 #ifndef WIN32
@@ -111,20 +111,20 @@
 /* 2.50 patch */
 static void area_add_header_region(ScrArea *sa, ListBase *lb)
 {
-	ARegion *ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
-	
+	ARegion *ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
+
 	BLI_addtail(lb, ar);
-	ar->regiontype= RGN_TYPE_HEADER;
-	if (sa->headertype==HEADERDOWN)
-		ar->alignment= RGN_ALIGN_BOTTOM;
+	ar->regiontype = RGN_TYPE_HEADER;
+	if (sa->headertype == HEADERDOWN)
+		ar->alignment = RGN_ALIGN_BOTTOM;
 	else
-		ar->alignment= RGN_ALIGN_TOP;
-	
+		ar->alignment = RGN_ALIGN_TOP;
+
 	/* initialize view2d data for header region, to allow panning */
 	/* is copy from ui_view2d.c */
 	ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
 	ar->v2d.keepofs = V2D_LOCKOFS_Y;
-	ar->v2d.keeptot = V2D_KEEPTOT_STRICT; 
+	ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
 	ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
 	ar->v2d.flag = (V2D_PIXELOFS_X|V2D_PIXELOFS_Y);
 }
@@ -133,23 +133,23 @@
 {
 	// XXX a bit ugly still, copied from space_sequencer
 	/* NOTE: if you change values here, also change them in space_sequencer.c, sequencer_new */
-	ar->regiontype= RGN_TYPE_PREVIEW;
-	ar->alignment= RGN_ALIGN_TOP;
+	ar->regiontype = RGN_TYPE_PREVIEW;
+	ar->alignment = RGN_ALIGN_TOP;
 	ar->flag |= RGN_FLAG_HIDDEN;
-	ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM;
-	ar->v2d.minzoom= 0.00001f;
-	ar->v2d.maxzoom= 100000.0f;
+	ar->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM;
+	ar->v2d.minzoom = 0.00001f;
+	ar->v2d.maxzoom = 100000.0f;
 	ar->v2d.tot.xmin = -960.0f; /* 1920 width centered */
 	ar->v2d.tot.ymin = -540.0f; /* 1080 height centered */
 	ar->v2d.tot.xmax = 960.0f;
 	ar->v2d.tot.ymax = 540.0f;
-	ar->v2d.min[0]= 0.0f;
-	ar->v2d.min[1]= 0.0f;
-	ar->v2d.max[0]= 12000.0f;
-	ar->v2d.max[1]= 12000.0f;
-	ar->v2d.cur= ar->v2d.tot;
-	ar->v2d.align= V2D_ALIGN_FREE; // (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
-	ar->v2d.keeptot= V2D_KEEPTOT_FREE;
+	ar->v2d.min[0] = 0.0f;
+	ar->v2d.min[1] = 0.0f;
+	ar->v2d.max[0] = 12000.0f;
+	ar->v2d.max[1] = 12000.0f;
+	ar->v2d.cur = ar->v2d.tot;
+	ar->v2d.align = V2D_ALIGN_FREE; // (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
+	ar->v2d.keeptot = V2D_KEEPTOT_FREE;
 }
 
 static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
@@ -161,271 +161,271 @@
 		/* first channels for ipo action nla... */
 		switch (sl->spacetype) {
 			case SPACE_IPO:
-				ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+				ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_CHANNELS;
-				ar->alignment= RGN_ALIGN_LEFT; 
-				ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
-				
-					// for some reason, this doesn't seem to go auto like for NLA...
-				ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+				ar->regiontype = RGN_TYPE_CHANNELS;
+				ar->alignment = RGN_ALIGN_LEFT;
+				ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+
+				/* for some reason, this doesn't seem to go auto like for NLA... */
+				ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_UI;
-				ar->alignment= RGN_ALIGN_RIGHT;
-				ar->v2d.scroll= V2D_SCROLL_RIGHT;
+				ar->regiontype = RGN_TYPE_UI;
+				ar->alignment = RGN_ALIGN_RIGHT;
+				ar->v2d.scroll = V2D_SCROLL_RIGHT;
 				ar->v2d.flag = RGN_FLAG_HIDDEN;
 				break;
-				
+
 			case SPACE_ACTION:
-				ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+				ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_CHANNELS;
-				ar->alignment= RGN_ALIGN_LEFT;
-				ar->v2d.scroll= V2D_SCROLL_BOTTOM;
+				ar->regiontype = RGN_TYPE_CHANNELS;
+				ar->alignment = RGN_ALIGN_LEFT;
+				ar->v2d.scroll = V2D_SCROLL_BOTTOM;
 				ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
 				break;
-				
+
 			case SPACE_NLA:
-				ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+				ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_CHANNELS;
-				ar->alignment= RGN_ALIGN_LEFT;
-				ar->v2d.scroll= V2D_SCROLL_BOTTOM;
+				ar->regiontype = RGN_TYPE_CHANNELS;
+				ar->alignment = RGN_ALIGN_LEFT;
+				ar->v2d.scroll = V2D_SCROLL_BOTTOM;
 				ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
-				
-					// for some reason, some files still don't get this auto
-				ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+
+				/* for some reason, some files still don't get this auto */
+				ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_UI;
-				ar->alignment= RGN_ALIGN_RIGHT;
-				ar->v2d.scroll= V2D_SCROLL_RIGHT;
+				ar->regiontype = RGN_TYPE_UI;
+				ar->alignment = RGN_ALIGN_RIGHT;
+				ar->v2d.scroll = V2D_SCROLL_RIGHT;
 				ar->v2d.flag = RGN_FLAG_HIDDEN;
 				break;
-				
+
 			case SPACE_NODE:
-				ar= MEM_callocN(sizeof(ARegion), "nodetree area for node");
+				ar = MEM_callocN(sizeof(ARegion), "nodetree area for node");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_UI;
-				ar->alignment= RGN_ALIGN_LEFT;
+				ar->regiontype = RGN_TYPE_UI;
+				ar->alignment = RGN_ALIGN_LEFT;
 				ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
 				ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
 				/* temporarily hide it */
 				ar->flag = RGN_FLAG_HIDDEN;
 				break;
 			case SPACE_FILE:
-				ar= MEM_callocN(sizeof(ARegion), "nodetree area for node");
+				ar = MEM_callocN(sizeof(ARegion), "nodetree area for node");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_CHANNELS;
-				ar->alignment= RGN_ALIGN_LEFT;
+				ar->regiontype = RGN_TYPE_CHANNELS;
+				ar->alignment = RGN_ALIGN_LEFT;
 
-				ar= MEM_callocN(sizeof(ARegion), "ui area for file");
+				ar = MEM_callocN(sizeof(ARegion), "ui area for file");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_UI;
-				ar->alignment= RGN_ALIGN_TOP;
+				ar->regiontype = RGN_TYPE_UI;
+				ar->alignment = RGN_ALIGN_TOP;
 				break;
 			case SPACE_SEQ:
-				ar_main = (ARegion*)lb->first;
+				ar_main = (ARegion*) lb->first;
 				for (; ar_main; ar_main = ar_main->next) {
 					if (ar_main->regiontype == RGN_TYPE_WINDOW)
 						break;
 				}
-				ar= MEM_callocN(sizeof(ARegion), "preview area for sequencer");
+				ar = MEM_callocN(sizeof(ARegion), "preview area for sequencer");
 				BLI_insertlinkbefore(lb, ar_main, ar);
 				sequencer_init_preview_region(ar);
 				break;
 			case SPACE_VIEW3D:
 				/* toolbar */
-				ar= MEM_callocN(sizeof(ARegion), "toolbar for view3d");
-				
+				ar = MEM_callocN(sizeof(ARegion), "toolbar for view3d");
+
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_TOOLS;
-				ar->alignment= RGN_ALIGN_LEFT;
+				ar->regiontype = RGN_TYPE_TOOLS;
+				ar->alignment = RGN_ALIGN_LEFT;
 				ar->flag = RGN_FLAG_HIDDEN;
-				
+
 				/* tool properties */
-				ar= MEM_callocN(sizeof(ARegion), "tool properties for view3d");
-				
+				ar = MEM_callocN(sizeof(ARegion), "tool properties for view3d");
+
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_TOOL_PROPS;
-				ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
+				ar->regiontype = RGN_TYPE_TOOL_PROPS;
+				ar->alignment = RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
 				ar->flag = RGN_FLAG_HIDDEN;
-				
+
 				/* buttons/list view */
-				ar= MEM_callocN(sizeof(ARegion), "buttons for view3d");
-				
+				ar = MEM_callocN(sizeof(ARegion), "buttons for view3d");
+
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_UI;
-				ar->alignment= RGN_ALIGN_RIGHT;
+				ar->regiontype = RGN_TYPE_UI;
+				ar->alignment = RGN_ALIGN_RIGHT;
 				ar->flag = RGN_FLAG_HIDDEN;
 #if 0
 			case SPACE_BUTS:
 				/* context UI region */
-				ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+				ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
 				BLI_addtail(lb, ar);
-				ar->regiontype= RGN_TYPE_UI;
-				ar->alignment= RGN_ALIGN_RIGHT;
-				
+				ar->regiontype = RGN_TYPE_UI;
+				ar->alignment = RGN_ALIGN_RIGHT;
+
 				break;
 #endif
 		}
 	}
 
 	/* main region */
-	ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
-	
+	ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
+
 	BLI_addtail(lb, ar);
-	ar->winrct= sa->totrct;
-	
-	ar->regiontype= RGN_TYPE_WINDOW;
-	
+	ar->winrct = sa->totrct;
+
+	ar->regiontype = RGN_TYPE_WINDOW;
+
 	if (sl) {
 		/* if active spacetype has view2d data, copy that over to main region */
 		/* and we split view3d */
 		switch (sl->spacetype) {
 			case SPACE_VIEW3D:
 				blo_do_versions_view3d_split_250((View3D *)sl, lb);
-				break;		
-						
+				break;
+
 			case SPACE_OUTLINER:
-			{
-				SpaceOops *soops= (SpaceOops *)sl;
-				
-				memcpy(&ar->v2d, &soops->v2d, sizeof(View2D));
-				
-				ar->v2d.scroll &= ~V2D_SCROLL_LEFT;
-				ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM_O);
-				ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
-				ar->v2d.keepzoom |= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT);
-				ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
-				ar->v2d.minzoom= ar->v2d.maxzoom= 1.0f;
-				//ar->v2d.flag |= V2D_IS_INITIALISED;
-			}
+				{
+					SpaceOops *soops = (SpaceOops *)sl;
+
+					memcpy(&ar->v2d, &soops->v2d, sizeof(View2D));
+
+					ar->v2d.scroll &= ~V2D_SCROLL_LEFT;
+					ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM_O);
+					ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
+					ar->v2d.keepzoom |= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT);
+					ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
+					ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
+					//ar->v2d.flag |= V2D_IS_INITIALISED;
+				}
 				break;
 			case SPACE_TIME:
-			{
-				SpaceTime *stime= (SpaceTime *)sl;
-				memcpy(&ar->v2d, &stime->v2d, sizeof(View2D));
-				

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list