[Bf-blender-cvs] [f595d558f0c] master: Cleanup: remove unused Material.pr_light

Campbell Barton noreply at git.blender.org
Wed Feb 27 03:09:21 CET 2019


Commit: f595d558f0ce2488dc299652680addedfcc6180f
Author: Campbell Barton
Date:   Wed Feb 27 13:08:06 2019 +1100
Branches: master
https://developer.blender.org/rBf595d558f0ce2488dc299652680addedfcc6180f

Cleanup: remove unused Material.pr_light

Also no need for 14 bytes of padding.

===================================================================

M	source/blender/blenkernel/intern/material.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/makesdna/DNA_material_types.h

===================================================================

diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index fdf0265c5f9..f6bd5a8cd06 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -135,7 +135,6 @@ void BKE_material_init(Material *ma)
 
 	ma->roughness = 0.25f;
 
-	ma->pr_light = 3;         /* two lights, is bits */
 	ma->pr_type = MA_SPHERE;
 
 	ma->preview = NULL;
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index cacd7e5720f..6bebb332c96 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1178,14 +1178,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
 
 	if (bmain->versionfile <= 233) {
 		bScreen *sc;
-		Material *ma = bmain->mat.first;
-		/* Object *ob = bmain->object.first; */
-
-		while (ma) {
-			if (ma->pr_light == 0)
-				ma->pr_light = 3;
-			ma = ma->id.next;
-		}
 
 		for (sc = bmain->screen.first; sc; sc = sc->id.next) {
 			ScrArea *sa;
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 117ad1cab0d..8030a66cf3b 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -134,7 +134,8 @@ typedef struct Material {
 	/** Animation data (must be immediately after id for utilities to use it). */
 	struct AnimData *adt;
 
-	short flag, pad1[7];
+	short flag;
+	char _pad1[2];
 
 	/* Colors from Blender Internal that we are still using. */
 	float r, g, b, a;
@@ -146,13 +147,13 @@ typedef struct Material {
 	float gloss_mir  DNA_DEPRECATED;
 	float roughness;
 	float metallic;
-	float pad4;
+	char _pad0[2];
 
-	/* Ror buttons and render. */
+	/** For buttons and render. */
 	char pr_type, use_nodes;
-	short pr_light, pr_texture;
+	short pr_texture;
 
-	/* Index for render passes. */
+	/** Index for render passes. */
 	short index;
 
 	struct bNodeTree *nodetree;
@@ -169,7 +170,7 @@ typedef struct Material {
 	short paint_active_slot;
 	short paint_clone_slot;
 	short tot_slots;
-	short pad2[3];
+	char _pad2[2];
 
 	/* Transparency. */
 	float alpha_threshold;
@@ -177,7 +178,7 @@ typedef struct Material {
 	char blend_method;
 	char blend_shadow;
 	char blend_flag;
-	char pad3[5];
+	char _pad3[1];
 
 	/**
 	 * Cached slots for texture painting, must be refreshed in



More information about the Bf-blender-cvs mailing list