diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-02-22 02:19:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-02-22 02:19:06 +0300 |
commit | ae464adffd51473fad06bdf19395c31829b34d7a (patch) | |
tree | 098ccc8c2e4c36cf87eb8f5280ef596e702905bb /source/blender | |
parent | 71ca81019de3a6a34fcf7065eea35623b7a96c10 (diff) |
Fix for [#8303] stamp gives wrong file name when using unsaved files
Also made alpha color work with OpenGL render caused by buf_rectfill_area not working on char rect's.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 9 | ||||
-rw-r--r-- | source/blender/imbuf/intern/rectop.c | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index fdd36d72b06..56744224449 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -906,8 +906,13 @@ static void stampdata(StampData *stamp_data, int do_prefix) #endif /* WIN32 */ if (G.scene->r.stamp & R_STAMP_FILENAME) { - if (do_prefix) sprintf(stamp_data->file, "File %s", G.sce); - else sprintf(stamp_data->file, "%s", G.sce); + if (G.relbase_valid) { + if (do_prefix) sprintf(stamp_data->file, "File %s", G.sce); + else sprintf(stamp_data->file, "%s", G.sce); + } else { + if (do_prefix) strcpy(stamp_data->file, "File <untitled>"); + else strcpy(stamp_data->file, "<untitled>"); + } stamp_data->note[0] = '\0'; } else { stamp_data->file[0] = '\0'; diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c index 63de3bd2355..5a907e71258 100644 --- a/source/blender/imbuf/intern/rectop.c +++ b/source/blender/imbuf/intern/rectop.c @@ -525,7 +525,9 @@ void IMB_rectfill(struct ImBuf *drect, float col[4]) void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, float *col, int x1, int y1, int x2, int y2) { int i, j; - float a, ai; + float a; /* alpha */ + float ai; /* alpha inverted */ + float aich; /* alpha, inverted, ai/255.0 - Convert char to float at the same time */ if ((!rect && !rectf) || (!col) || col[3]==0.0) return; @@ -541,7 +543,7 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, a = col[3]; ai = 1-a; - + aich = ai/255.0f; if (rect) { unsigned char *pixel; @@ -566,9 +568,9 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, pixel[1] = chg; pixel[2] = chb; } else { - pixel[0] = (char)(fr + ((float)pixel[0]*ai)); - pixel[1] = (char)(fg + ((float)pixel[1]*ai)); - pixel[2] = (char)(fb + ((float)pixel[2]*ai)); + pixel[0] = (char)((fr + ((float)pixel[0]*aich))*255.0f); + pixel[1] = (char)((fg + ((float)pixel[1]*aich))*255.0f); + pixel[2] = (char)((fb + ((float)pixel[2]*aich))*255.0f); } } } |