[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11194] branches/soc-2007-joeedh/source/ blender/blenkernel/intern/tcs_dsm.c: This commit hopefully fixes compile errors on msvc.

Joseph Eagar joeedh at gmail.com
Sun Jul 8 16:07:23 CEST 2007


Revision: 11194
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11194
Author:   joeedh
Date:     2007-07-08 16:07:20 +0200 (Sun, 08 Jul 2007)

Log Message:
-----------
This commit hopefully fixes compile errors on msvc.  I rewrote
a define I was using according to a suggestion from ton on IRC.

Modified Paths:
--------------
    branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c

Modified: branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c
===================================================================
--- branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c	2007-07-08 07:48:47 UTC (rev 11193)
+++ branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c	2007-07-08 14:07:20 UTC (rev 11194)
@@ -109,6 +109,13 @@
 	}	
 }
 
+#ifdef PACK_SHORTFLOAT
+#undef PACK_SHORTFLOAT
+#endif
+
+/*pack colors into shorts*/
+#define PACK_SHORTFLOAT(s, f) s = (f)>1.0f ? 65535 : (f)<0.0 ? 0 : (unsigned short)((f)*65535.0f)
+
 static unsigned int dsm_savetile(struct TCS_Tile *tself, TCS_File *file, unsigned long curpos)
 {
 	DSMTile *self = (DSMTile*) tself;
@@ -142,12 +149,6 @@
 				TCS_fwrite(&y, sizeof(int), 1, file);
 				TCS_fwrite(&first->depth, sizeof(int), 1, file);
 				
-				/*pack colors into shorts*/
-				#define PACK_SHORTFLOAT(s, f)\
-					if ((f) > 1.0) s = 65535;\
-					else if ((f) < 0.0) s = 0;\
-					else s = (unsigned short)((f)*65535.0f)
-					
 				for (j=0; j < first->depth; j++, sample++) {
 					PACK_SHORTFLOAT(sclr[0], sample->clr[0]);
 					PACK_SHORTFLOAT(sclr[1], sample->clr[1]);
@@ -159,7 +160,6 @@
 				}
 				
 				BASSERT(0 == file->error_occured);
-				#undef PACK_SHORTFLOAT
 			}
 		}
 	}
@@ -197,6 +197,7 @@
 	#endif
 	return fend - curpos;
 }
+#undef PACK_SHORTFLOAT
 
 /*returns 2 pointers, one for depth, one for color pixel samples array.*/
 void *dsm_gettilepixel(TCS_Tile *tself, int x, int y, int z)





More information about the Bf-blender-cvs mailing list