00001 #include "simpleFuncs.h" 00002 00003 //#pragma warning(disable:4700) 00004 00005 dword swapBytes(dword in) 00006 { 00007 dword out = 0; 00008 ((byte*)out)[0] = ((byte*)in)[3]; 00009 ((byte*)out)[1] = ((byte*)in)[2]; 00010 ((byte*)out)[2] = ((byte*)in)[1]; 00011 ((byte*)out)[3] = ((byte*)in)[0]; 00012 return out; 00013 } 00014 00015 float snapToZeroOne(float f) 00016 { 00017 if (f < TOLERANCE) 00018 return 0.0f; 00019 else if (f > 1.0f) 00020 return 1.0f; 00021 else 00022 return f; 00023 }