diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-23 21:14:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-23 21:14:29 +0400 |
commit | 28fb329419b4e636bb9540ba090de8e2c28d582f (patch) | |
tree | b510b929ef1a2b16216d9b60bd29595470005164 /source/blender/makesrna/intern | |
parent | a91bd43d382b857abb4440fe5a2353a4fac0519d (diff) |
minor changes
- avoid duplicate image enum definitions.
- move image UI format & bw/rgb/rgba onto 1 line.
- add 'make config' convenience target to run ccmake or cmake-gui
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 116 |
1 files changed, 60 insertions, 56 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 8e162f27e52..c128657cfb3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -103,83 +103,87 @@ EnumPropertyItem snap_element_items[] = { {0, NULL, 0, NULL, NULL}}; -/* note on duplicate block, perhaps we should use some trick to avoid - * the duplicate, but with the inline defines it becomes very tricky - * this awaits someone who has very good preprocessor-fu. - * for now just make sure they stay in sync - campbell */ +/* workaround for duplice enums, + * have each enum line as a defne then conditionally set it or not + */ -EnumPropertyItem image_only_type_items[] = { +#define R_IMF_ENUM_BMP {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"}, +#define R_IMF_ENUM_IRIS {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"}, +#define R_IMF_ENUM_PNG {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"}, +#define R_IMF_ENUM_JPEG {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"}, +#define R_IMF_ENUM_TAGA {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"}, +#define R_IMF_ENUM_TAGA_RAW {R_IMF_IMTYPE_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"}, - /* --- duplicate block warning (see below) --- */ -#define IMAGE_TYPE_ITEMS_IMAGE_ONLY - {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"}, #ifdef WITH_DDS - {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"}, +# define R_IMF_ENUM_DDS {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"}, +#else +# define R_IMF_ENUM_DDS #endif - {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"}, - {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"}, - {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"}, + #ifdef WITH_OPENJPEG - {R_IMF_IMTYPE_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"}, +# define R_IMF_ENUM_JPEG2K {R_IMF_IMTYPE_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"}, +#else +# define R_IMF_ENUM_JPEG2K #endif - {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"}, - {R_IMF_IMTYPE_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"}, - {0, "", 0, " ", NULL}, + #ifdef WITH_CINEON - {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"}, - {R_IMF_IMTYPE_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"}, +# define R_IMF_ENUM_CINEON {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"}, +# define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"}, +#else +# define R_IMF_ENUM_CINEON +# define R_IMF_ENUM_DPX #endif + #ifdef WITH_OPENEXR - {R_IMF_IMTYPE_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"}, - {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"}, +# define R_IMF_ENUM_EXR_MULTI {R_IMF_IMTYPE_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"}, +# define R_IMF_ENUM_EXR {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"}, +#else +# define R_IMF_ENUM_EXR_MULTI +# define R_IMF_ENUM_EXR #endif + #ifdef WITH_HDR - {R_IMF_IMTYPE_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"}, +# define R_IMF_ENUM_HDR {R_IMF_IMTYPE_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"}, +#else +# define R_IMF_ENUM_HDR #endif + #ifdef WITH_TIFF - {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"}, +# define R_IMF_ENUM_TIFF {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"}, +#else +# define R_IMF_ENUM_TIFF #endif - /* --- end duplicate block (see below) --- */ - {0, NULL, 0, NULL, NULL}}; +#define IMAGE_TYPE_ITEMS_IMAGE_ONLY \ + R_IMF_ENUM_BMP \ + R_IMF_ENUM_DDS \ + R_IMF_ENUM_IRIS \ + R_IMF_ENUM_PNG \ + R_IMF_ENUM_JPEG \ + R_IMF_ENUM_JPEG2K \ + R_IMF_ENUM_TAGA \ + R_IMF_ENUM_TAGA_RAW \ + {0, "", 0, " ", NULL}, \ + R_IMF_ENUM_CINEON \ + R_IMF_ENUM_DPX \ + R_IMF_ENUM_EXR_MULTI \ + R_IMF_ENUM_EXR \ + R_IMF_ENUM_HDR \ + R_IMF_ENUM_TIFF \ -EnumPropertyItem image_type_items[] = { - {0, "", 0, "Image", NULL}, +EnumPropertyItem image_only_type_items[] = { - /* --- duplicate block warning (see above) --- */ -#define IMAGE_TYPE_ITEMS_IMAGE_ONLY - {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"}, -#ifdef WITH_DDS - {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"}, -#endif - {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"}, - {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"}, - {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"}, -#ifdef WITH_OPENJPEG - {R_IMF_IMTYPE_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"}, -#endif - {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"}, - {R_IMF_IMTYPE_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"}, - {0, "", 0, " ", NULL}, -#ifdef WITH_CINEON - {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"}, - {R_IMF_IMTYPE_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"}, -#endif -#ifdef WITH_OPENEXR - {R_IMF_IMTYPE_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"}, - {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"}, -#endif -#ifdef WITH_HDR - {R_IMF_IMTYPE_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"}, -#endif -#ifdef WITH_TIFF - {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"}, -#endif - /* --- end duplicate block (see above) --- */ + IMAGE_TYPE_ITEMS_IMAGE_ONLY + + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem image_type_items[] = { + {0, "", 0, "Image", NULL}, + IMAGE_TYPE_ITEMS_IMAGE_ONLY {0, "", 0, "Movie", NULL}, #ifdef _WIN32 |