diff options
author | Ton Roosendaal <ton@blender.org> | 2003-12-01 16:13:43 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-12-01 16:13:43 +0300 |
commit | e35ed554378396867b562fb47416e49b8c1eea28 (patch) | |
tree | 6bad024b22f7f2f32145da127dd8bd888fd4f3c0 /source/blender/src/screendump.c | |
parent | 3489a56a32d1dc3eec5c793cc67165f1cfb3a138 (diff) |
- added fix done for manual designer: when you want to make screenshot with
a pulldown or popup menu in it, press (alt+)ctrl+f3 while the menu is
visible, ESC, press (alt+)ctrl+f3 again.
Note the (alt+) is for OSX users only.
Diffstat (limited to 'source/blender/src/screendump.c')
-rw-r--r-- | source/blender/src/screendump.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/source/blender/src/screendump.c b/source/blender/src/screendump.c index 967bbe1f075..011d50d9600 100644 --- a/source/blender/src/screendump.c +++ b/source/blender/src/screendump.c @@ -61,6 +61,7 @@ #include "BIF_mywindow.h" #include "BIF_screen.h" #include "BIF_toets.h" +#include "BIF_interface.h" #include "BSE_filesel.h" @@ -97,7 +98,10 @@ void write_screendump(char *name) ibuf->ftype= JPG|G.scene->r.quality; } else ibuf->ftype= TGA; - + + IMB_gamwarp(ibuf, 1.0+G.rt/100.0); + if(G.scene->r.planes == 8) IMB_cspace(ibuf, rgb_to_bw); + IMB_saveiff(ibuf, name, IB_rect); IMB_freeImBuf(ibuf); @@ -108,20 +112,28 @@ void write_screendump(char *name) } } - +/* get dump from frontbuffer */ void BIF_screendump(void) { - /* get dump from frontbuffer */ + extern uiBut *UIbuttip; // interface.c + static int wasmenu= 0; int x=0, y=0; - char imstr[32]; + char imstr[64]; + + if(wasmenu && UIbuttip==NULL) { + save_image_filesel_str(imstr); + activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump); + wasmenu= 0; + return; + } dumpsx= 0; dumpsy= 0; if(dumprect) MEM_freeN(dumprect); - dumprect= 0; + dumprect= NULL; - if (G.qual & LR_SHIFTKEY) { + if(UIbuttip || (G.qual & LR_SHIFTKEY)) { /* full screen */ x= 0; y= 0; @@ -130,9 +142,7 @@ void BIF_screendump(void) } else { - if(mywin_inmenu()) { - mywin_getmenu_rect(&x, &y, &dumpsx, &dumpsy); - } else { + { /* a window */ int win= mywinget(); bwin_getsuborigin(win, &x, &y); @@ -141,14 +151,17 @@ void BIF_screendump(void) } if (dumpsx && dumpsy) { - save_image_filesel_str(imstr); dumprect= MEM_mallocN(sizeof(int)*dumpsx*dumpsy, "dumprect"); glReadBuffer(GL_FRONT); glReadPixels(x, y, dumpsx, dumpsy, GL_RGBA, GL_UNSIGNED_BYTE, dumprect); - - /* open filesel */ - activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump); - } + if(UIbuttip==NULL) { + wasmenu= 0; + save_image_filesel_str(imstr); + activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump); + } + else wasmenu= 1; + } + } |