/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta_reference/plugins/zerogs/dx/GS.h
ViewVC logotype

Diff of /branch/r3113_0.9.7_beta_reference/plugins/zerogs/dx/GS.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- branch/r3113_0.9.7_beta_reference/plugins/zerogs/dx/GS.h	2010/09/13 17:18:05	173
+++ branch/r3113_0.9.7_beta_reference/plugins/zerogs/dx/GS.h	2010/09/13 17:24:24	174
@@ -722,19 +722,19 @@
 
 // assumes that positive in [1,2] (then extracts fraction by just looking at the specified bits)
 #define Float16ToBYTE_2(f) ((u8)(*(u16*)&f>>2))
-#define Float16To5BIT(f) (Float16ToBYTE(f)>>3)
+#define Float16To5BIT(f) (Float16ToBYTE((u16)f)>>3)
 
 #define Float16Alpha(f) (((*(u16*)&f&0x7c00)>=0x3900)?0x8000:0) // alpha is >= 1
 
 // converts an array of 4 u16s to a u32 color
 // f is a pointer to a u16
-#define Float16ToARGB(f) COLOR_ARGB(Float16ToALPHA(f.w), Float16ToBYTE(f.x), Float16ToBYTE(f.y), Float16ToBYTE(f.z));
+#define Float16ToARGB(f) COLOR_ARGB(Float16ToALPHA((u16)f.w), Float16ToBYTE((u16)f.x), Float16ToBYTE((u16)f.y), Float16ToBYTE((u16)f.z));
 
-#define Float16ToARGB16(f) (Float16Alpha(f.w)|(Float16To5BIT(f.x)<<10)|(Float16To5BIT(f.y)<<5)|Float16To5BIT(f.z))
+#define Float16ToARGB16(f) (Float16Alpha((u16)f.w)|(Float16To5BIT((u16)f.x)<<10)|(Float16To5BIT((u16)f.y)<<5)|Float16To5BIT((u16)f.z))
 
 // used for Z values
-#define Float16ToARGB_Z(f) COLOR_ARGB((u32)Float16ToBYTE_2(f.w), Float16ToBYTE_2(f.x), Float16ToBYTE_2(f.y), Float16ToBYTE_2(f.z))
-#define Float16ToARGB16_Z(f) ((Float16ToBYTE_2(f.y)<<8)|Float16ToBYTE_2(f.z))
+#define Float16ToARGB_Z(f) COLOR_ARGB(Float16ToBYTE_2((u16)f.w), Float16ToBYTE_2((u16)f.x), Float16ToBYTE_2((u16)f.y), Float16ToBYTE_2((u16)f.z))
+#define Float16ToARGB16_Z(f) ((Float16ToBYTE_2((u16)f.y)<<8)|Float16ToBYTE_2((u16)f.z))
 
 
 inline float Clamp(float fx, float fmin, float fmax)

 

  ViewVC Help
Powered by ViewVC 1.1.22