[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13146] trunk/blender/source/blender/ blenkernel/intern/image.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Jan 6 17:04:49 CET 2008


Revision: 13146
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13146
Author:   blendix
Date:     2008-01-06 17:04:48 +0100 (Sun, 06 Jan 2008)

Log Message:
-----------

Bugfix: in the new image function, uv test grid option
didn't draw colored crosses correct.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/image.c

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c	2008-01-06 09:27:30 UTC (rev 13145)
+++ trunk/blender/source/blender/blenkernel/intern/image.c	2008-01-06 16:04:48 UTC (rev 13146)
@@ -400,8 +400,8 @@
 {
 	ImBuf *ibuf;
 	float h=0.0, hoffs=0.0, hue=0.0, s=0.9, v=0.9, r, g, b;
-	unsigned char *rect;
-	float *rect_float;
+	unsigned char *rect= NULL;
+	float *rect_float= NULL;
 	int x, y;
 	int checkerwidth=21, dark=1;
 	
@@ -475,18 +475,20 @@
 							rect_float[1]= g;
 							rect_float[2]= b;
 							rect_float[3]= 1.0;
-							rect_float+=4;
 						}
 						else {
 							rect[0]= (char)(r * 255.0);
 							rect[1]= (char)(g * 255.0);
 							rect[2]= (char)(b * 255.0);
 							rect[3]= 255;
-							rect+=4;
 						}
 					}
 				}
-				
+
+				if (floatbuf)
+					rect_float+=4;
+				else
+					rect+=4;
 			}
 		}
 	} else {	/* blank image */
@@ -1737,7 +1739,6 @@
 {
 	ImBuf *ibuf= NULL;
 	float color[] = {0, 0, 0, 1};
-	int floatbuf;
 
 	/* quick reject tests */
 	if(ima==NULL) 
@@ -1815,7 +1816,7 @@
 				/* UV testgrid or black or solid etc */
 				if(ima->gen_x==0) ima->gen_x= 256;
 				if(ima->gen_y==0) ima->gen_y= 256;
-				ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, floatbuf, ima->gen_type, color);
+				ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 0, ima->gen_type, color);
 				image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
 				ima->ok= IMA_OK_LOADED;
 			}





More information about the Bf-blender-cvs mailing list