Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

General/vuTFunc/simpleFuncs.h

Go to the documentation of this file.
00001 #ifndef _SIMPLEFUNCS_H_
00002 #define _SIMPLEFUNCS_H_
00003 
00004 #include "vuSimpleTypes.h"
00005 
00006 #define TOLERANCE  0.00001f
00007 
00008 //#pragma warning(disable:4700)
00009 
00010 inline dword swapBytes(dword in)
00011 {
00012     dword out = 0;
00013     ((byte*)out)[0] = ((byte*)in)[3];
00014     ((byte*)out)[1] = ((byte*)in)[2];
00015     ((byte*)out)[2] = ((byte*)in)[1];
00016     ((byte*)out)[3] = ((byte*)in)[0];
00017     return out;
00018 }
00019 
00020 inline float snapToZeroOne(float f)
00021 {
00022     if (f < TOLERANCE)
00023         return 0.0f;
00024     else if (f > 1.0f)
00025         return 1.0f;
00026     else
00027         return f;
00028 }
00029 
00030 #endif

Generated on Wed Dec 15 21:20:31 2004 for vuVolume by  doxygen 1.3.9.1