diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2003-05-21 23:58:31 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2003-05-21 23:58:31 +0400 |
commit | 89e9090c861839e7f4289c13f26ab12d4b503610 (patch) | |
tree | d9127dc65337136f6f2fc39da0ad44dc046e99dc /source/blender/python/api2_2x/Image.c | |
parent | 000f92e204b54d117789209b00fee88f279be6e1 (diff) |
Implemented the compare callback for Camera, Image, Lamp and Text types:
Following a suggestion made by Jordi Rovira i Bonet, the comparison
now is made via the pointers to the Blender objects, not their py wrappers.
Diffstat (limited to 'source/blender/python/api2_2x/Image.c')
-rw-r--r-- | source/blender/python/api2_2x/Image.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c index 9d679672f78..56eec3caebb 100644 --- a/source/blender/python/api2_2x/Image.c +++ b/source/blender/python/api2_2x/Image.c @@ -318,6 +318,20 @@ static int ImageSetAttr (C_Image *self, char *name, PyObject *value) } /*****************************************************************************/ +/* Function: ImageCompare */ +/* Description: This is a callback function for the C_Image type. It */ +/* compares two Image_Type objects. Only the "==" and "!=" */ +/* comparisons are meaninful. Returns 0 for equality and -1 if */ +/* they don't point to the same Blender Image struct. */ +/* In Python it becomes 1 if they are equal, 0 otherwise. */ +/*****************************************************************************/ +static int ImageCompare (C_Image *a, C_Image *b) +{ + Image *pa = a->image, *pb = b->image; + return (pa == pb) ? 0:-1; +} + +/*****************************************************************************/ /* Function: ImagePrint */ /* Description: This is a callback function for the C_Image type. It */ /* builds a meaninful string to 'print' image objects. */ |