/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/r3113/plugins/zerogs/dx/GS.h
ViewVC logotype

Diff of /branch/debug/0.X/0.9.X/0.9.7/r3113/plugins/zerogs/dx/GS.h

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

revision 170 by william, Tue Sep 7 06:17:51 2010 UTC revision 171 by william, Mon Sep 13 16:38:21 2010 UTC
# Line 722  __forceinline u16 Float16ToALPHA(u16 f) Line 722  __forceinline u16 Float16ToALPHA(u16 f)
722    
723  // assumes that positive in [1,2] (then extracts fraction by just looking at the specified bits)  // assumes that positive in [1,2] (then extracts fraction by just looking at the specified bits)
724  #define Float16ToBYTE_2(f) ((u8)(*(u16*)&f>>2))  #define Float16ToBYTE_2(f) ((u8)(*(u16*)&f>>2))
725  #define Float16To5BIT(f) (Float16ToBYTE(f)>>3)  #define Float16To5BIT(f) (Float16ToBYTE((u16)f)>>3)
726    
727  #define Float16Alpha(f) (((*(u16*)&f&0x7c00)>=0x3900)?0x8000:0) // alpha is >= 1  #define Float16Alpha(f) (((*(u16*)&f&0x7c00)>=0x3900)?0x8000:0) // alpha is >= 1
728    
729  // converts an array of 4 u16s to a u32 color  // converts an array of 4 u16s to a u32 color
730  // f is a pointer to a u16  // f is a pointer to a u16
731  #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));
732    
733  #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))
734    
735  // used for Z values  // used for Z values
736  #define Float16ToARGB_Z(f) COLOR_ARGB((u32)Float16ToBYTE_2(f.w), Float16ToBYTE_2(f.x), Float16ToBYTE_2(f.y), 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))
737  #define Float16ToARGB16_Z(f) ((Float16ToBYTE_2(f.y)<<8)|Float16ToBYTE_2(f.z))  #define Float16ToARGB16_Z(f) ((Float16ToBYTE_2((u16)f.y)<<8)|Float16ToBYTE_2((u16)f.z))
738    
739    
740  inline float Clamp(float fx, float fmin, float fmax)  inline float Clamp(float fx, float fmin, float fmax)

Legend:
Removed from v.170  
changed lines
  Added in v.171

  ViewVC Help
Powered by ViewVC 1.1.22