diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-13 16:47:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-13 17:14:03 +0400 |
commit | 4c9a3a53bd3154954bc2bcf73684b87a79332a71 (patch) | |
tree | ca297c79f831f46117e1638640a187e98ddbd01c /SConstruct | |
parent | 08981f3a91a687efa8d28d308d6033e5a9e68b1f (diff) |
UI Icons: store icons in git as uncompressed pixmaps (D196)
this allows for updating icons without committing a new PNG each time
(which is inefficient with git). The data files are converted into a
PNG at builds time and used just as they were before.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index 02cd309607b..c4bffab661e 100644 --- a/SConstruct +++ b/SConstruct @@ -653,6 +653,27 @@ def data_to_c_simple(FILE_FROM): data_to_c(FILE_FROM, FILE_TO, VAR_NAME) +def data_to_c_simple_icon(PATH_FROM): + + # first handle import + import sys + path = "source/blender/datatoc" + if path not in sys.path: + sys.path.append(path) + + # convert the pixmaps to a png + import datatoc_icon + + filename_only = os.path.basename(PATH_FROM) + FILE_TO_PNG = os.path.join(env['DATA_SOURCES'], filename_only + ".png") + FILE_TO = FILE_TO_PNG + ".c" + argv = [PATH_FROM, FILE_TO_PNG] + datatoc_icon.main_ex(argv) + + # then the png to a c file + data_to_c_simple(FILE_TO_PNG) + + if B.targets != ['cudakernels']: data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl", B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h", @@ -680,8 +701,12 @@ if B.targets != ['cudakernels']: data_to_c_simple("release/datafiles/bmonofont.ttf") data_to_c_simple("release/datafiles/splash.png") - data_to_c_simple("release/datafiles/blender_icons16.png") - data_to_c_simple("release/datafiles/blender_icons32.png") + + # data_to_c_simple("release/datafiles/blender_icons16.png") + # data_to_c_simple("release/datafiles/blender_icons32.png") + data_to_c_simple_icon("release/datafiles/blender_icons16") + data_to_c_simple_icon("release/datafiles/blender_icons32") + data_to_c_simple("release/datafiles/prvicons.png") data_to_c_simple("release/datafiles/brushicons/add.png") |