[Bf-blender-cvs] [01a2253] particles_refactor: Fix for dupli type bit flags exceeding short range.

Lukas Tönne noreply at git.blender.org
Tue Apr 22 16:00:31 CEST 2014


Commit: 01a2253dfd14f4c5564fd203adefb6dedccec670
Author: Lukas Tönne
Date:   Tue Apr 22 15:52:13 2014 +0200
https://developer.blender.org/rB01a2253dfd14f4c5564fd203adefb6dedccec670

Fix for dupli type bit flags exceeding short range.

The nparticle dupli flag was using 1<<15, which gives issues with signed
short variables. Fortunately there are unused bits in the
Object.transflag, now reuse the deprecated OB_POWERTRACK flag for this.

Also replaced dupli context int type with short to avoid errors with
strict compiler flags.

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

M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/makesdna/DNA_object_types.h

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

diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 30bbf5e..d3b8db5 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -93,7 +93,7 @@ typedef struct DupliContext {
 } DupliContext;
 
 typedef struct DupliGenerator {
-	int type;				/* dupli type */
+	short type;				/* dupli type */
 	void (*make_duplis)(const DupliContext *ctx);
 } DupliGenerator;
 
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index ab4eb5a..80ee250 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -398,7 +398,7 @@ enum {
 	OB_DUPLIVERTS       = 1 << 4,
 	OB_DUPLIROT         = 1 << 5,
 	OB_DUPLINOSPEED     = 1 << 6,
-/*	OB_POWERTRACK       = 1 << 7,*/ /*UNUSED*/
+	OB_DUPLI_NPARTICLE  = 1 << 7,
 	OB_DUPLIGROUP       = 1 << 8,
 	OB_DUPLIFACES       = 1 << 9,
 	OB_DUPLIFACES_SCALE = 1 << 10,
@@ -406,7 +406,6 @@ enum {
 	OB_RENDER_DUPLI     = 1 << 12,
 	OB_NO_CONSTRAINTS   = 1 << 13,  /* runtime constraints disable */
 	OB_NO_PSYS_UPDATE   = 1 << 14,  /* hack to work around particle issue */
-	OB_DUPLI_NPARTICLE  = 1 << 15,  /* hack to work around particle issue */
 
 	OB_DUPLI            = OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLIGROUP | OB_DUPLIFACES | OB_DUPLIPARTS | OB_DUPLI_NPARTICLE,
 };




More information about the Bf-blender-cvs mailing list