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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-09 23:40:46 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-09 23:40:46 +0400
commit297a53ebf833ebee7de8bd66a11d7cfe19f3ea8e (patch)
tree2276512004d18d0ccaf28ff98efd6b84854bded4 /source/blender/makesrna/intern/rna_internal_types.h
parent939b72247d536de0f09b526403c91cb7044cccca (diff)
RNA: multidimensional & dyanmic array changes
* Disable setting array length of dynamic array for now, this was not implemented correct, and it's not really needed now. * Allow all dimensions to be dynamic size, not just the first. * Change storage of multidimensional to be simpler. * Rename API functions to be more compact. * Fix some bugs in the implementation. * RenderLayer.rect and RenderPass.rect use a multidimensional dynamic array now.
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 2bd89dbd3bf..645bc50ed89 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -40,9 +40,9 @@ struct IDProperty;
struct GHash;
#ifdef UNIT_TEST
-#define RNA_MAX_ARRAY 64
+#define RNA_MAX_ARRAY_LENGTH 64
#else
-#define RNA_MAX_ARRAY 32
+#define RNA_MAX_ARRAY_LENGTH 32
#endif
#define RNA_MAX_ARRAY_DIMENSION 3
@@ -55,8 +55,7 @@ typedef struct IDProperty* (*IDPropertiesFunc)(struct PointerRNA *ptr, int creat
typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr);
typedef char *(*StructPathFunc)(struct PointerRNA *ptr);
-typedef int (*PropArrayLengthGetFunc)(struct PointerRNA *ptr);
-typedef int (*PropArrayLengthSetFunc)(struct PointerRNA *ptr, int length);
+typedef int (*PropArrayLengthGetFunc)(struct PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]);
typedef int (*PropBooleanGetFunc)(struct PointerRNA *ptr);
typedef void (*PropBooleanSetFunc)(struct PointerRNA *ptr, int value);
typedef void (*PropBooleanArrayGetFunc)(struct PointerRNA *ptr, int *values);
@@ -137,15 +136,13 @@ struct PropertyRNA {
PropertyType type;
/* subtype, 'interpretation' of the property */
PropertySubType subtype;
- /* if an array this is > 0, specifying the length */
- unsigned int arraylength;
/* if non-NULL, overrides arraylength. Must not return 0? */
PropArrayLengthGetFunc getlength;
- /* if NULL, length cannot be changed by a user */
- PropArrayLengthSetFunc setlength;
- unsigned short arraydimension;
- /* dimension sizes for dimensions greater than 1, first dimension size is not specified */
- unsigned short dimsize[RNA_MAX_ARRAY_DIMENSION - 1];
+ /* dimension of array */
+ unsigned int arraydimension;
+ /* array lengths lengths for all dimensions (when arraydimension > 0) */
+ unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION];
+ unsigned int totarraylength;
/* callback for updates on change */
UpdateFunc update;