diff options
author | Ton Roosendaal <ton@blender.org> | 2004-04-10 18:24:57 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-04-10 18:24:57 +0400 |
commit | 2a0bc1ee26b05e9d71c6080ab8674921e58eab89 (patch) | |
tree | 210396bddaf68cb6ba9977553d345b31a339d2a2 /source/blender/src/writeimage.c | |
parent | 71abd644370752db0be60addeb408c740d06c1d5 (diff) |
Bug 1136
Saving images from UV editing window was confused... initially I thought
it only used the same format as input image, but it did use the same
as F10 buttons specified, sorta. Fixes include:
- BIF_write_ibuf() now uses current Scene renderdata to check for
image type (it checked the global R struct instead, which is only
set correct after render)
- Fileselector now gives correct title in bar (like "SAVE TARGA")
- Pulldown menu in UV window now always gives the "Save" option
- removed the weird usage of BTST() to check for flags, and made it
using the #defines instead for readability
Diffstat (limited to 'source/blender/src/writeimage.c')
-rw-r--r-- | source/blender/src/writeimage.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/src/writeimage.c b/source/blender/src/writeimage.c index 23ead94c22d..27a81b00666 100644 --- a/source/blender/src/writeimage.c +++ b/source/blender/src/writeimage.c @@ -32,12 +32,17 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" // ImBuf{} + #include "DNA_scene_types.h" #include "DNA_texture_types.h" // EnvMap{} #include "DNA_image_types.h" // Image{} + +#include "BKE_global.h" // struct G #include "BKE_utildefines.h" // ELEM + #include "BIF_writeimage.h" -#include "render.h" + +#include "render.h" // RE_make_existing_file #ifdef HAVE_CONFIG_H #include <config.h> @@ -49,27 +54,27 @@ int BIF_write_ibuf(ImBuf *ibuf, char *name) /* to be used for e.g. envmap, not rendered images */ - if(R.r.imtype== R_IRIS) ibuf->ftype= IMAGIC; - else if ((R.r.imtype==R_PNG)) { + if(G.scene->r.imtype== R_IRIS) ibuf->ftype= IMAGIC; + else if ((G.scene->r.imtype==R_PNG)) { ibuf->ftype= PNG; } - else if ((R.r.imtype==R_BMP)) { + else if ((G.scene->r.imtype==R_BMP)) { ibuf->ftype= BMP; } - else if ((R.r.imtype==R_TARGA) || (R.r.imtype==R_PNG)) { + else if ((G.scene->r.imtype==R_TARGA) || (G.scene->r.imtype==R_PNG)) { // fall back to Targa if PNG writing is not supported ibuf->ftype= TGA; } - else if(R.r.imtype==R_RAWTGA) { + else if(G.scene->r.imtype==R_RAWTGA) { ibuf->ftype= RAWTGA; } - else if(R.r.imtype==R_HAMX) { + else if(G.scene->r.imtype==R_HAMX) { ibuf->ftype= AN_hamx; } - else if ELEM(R.r.imtype, R_JPEG90, R_MOVIE) { - if(R.r.quality < 10) R.r.quality= 90; + else if ELEM(G.scene->r.imtype, R_JPEG90, R_MOVIE) { + if(G.scene->r.quality < 10) G.scene->r.quality= 90; - ibuf->ftype= JPG|R.r.quality; + ibuf->ftype= JPG|G.scene->r.quality; } else ibuf->ftype= TGA; |