flTypes.h

Go to the documentation of this file.
00001 #ifndef FLTYPES_H
00002 #define FLTYPES_H
00003 
00004 #include <psptypes.h>
00005 
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009 
00010 #ifndef uint8
00011 typedef u8 uint8;
00012 #endif
00013 
00014 #ifndef uint16
00015 typedef u16 uint16;
00016 #endif
00017 
00018 #ifndef uint32
00019 typedef u32 uint32;
00020 #endif
00021 
00022 #ifndef uint64
00023 typedef u64 uint64;
00024 #endif
00025 
00026 #ifndef int8
00027 typedef s8 int8;
00028 #endif
00029 
00030 #ifndef byte
00031 typedef unsigned char byte;
00032 #endif
00033 
00034 #ifndef word
00035 typedef unsigned short word;
00036 #endif
00037 
00038 #ifndef dword
00039 typedef unsigned long dword;
00040 #endif
00041 
00042 #ifndef bool
00043 typedef char bool; 
00044 #endif
00045 
00046 #ifndef boolean
00047 typedef bool boolean;
00048 #endif
00049 
00050 #ifndef false
00051 #define false 0
00052 #endif
00053 
00054 #ifndef true
00055 #define true !false
00056 #endif
00057 
00058 #ifndef FALSE
00059 #define FALSE 0
00060 #endif
00061 
00062 #ifndef TRUE
00063 #define TRUE !FALSE
00064 #endif
00065 
00066 #ifndef False
00067 #define False 0
00068 #endif
00069 
00070 #ifndef True
00071 #define True !False
00072 #endif
00073 
00074 #ifndef null
00075 #define null ((void *)0)
00076 #endif
00077 
00078 #ifndef NULL
00079 #define NULL ((void *)0)
00080 #endif
00081 
00082 #ifndef INVALID
00083 #define INVALID ((dword)-1)
00084 #endif
00085 
00086 // Naming convention for vertex structures
00087 //
00088 // <Textured><Color><VertexType>
00089 // Tf = Textured, U/V floats.
00090 // Ts = Textured, U/V short16.
00091 // C = 32-bit color.
00092 // c = 16-bit color.
00093 // Vs = Short16 verteces.
00094 // Vf = Float32 verteces.
00095 
00096 typedef struct {
00097         short vertX, vertY, vertZ;
00098 } vertVs;
00099 
00100 typedef struct {
00101      float vertX, vertY, vertZ;
00102 } vertVf;
00103 
00104 typedef struct {
00105         u32 vertColor;
00106         short vertX, vertY, vertZ;
00107 } vertCVs;
00108 
00109 typedef struct {
00110      u32 vertColor;
00111      float vertX, vertY, vertZ;
00112 } vertCVf;
00113 
00114 typedef struct {
00115      u16 vertColor;
00116      float vertX, vertY, vertZ;
00117 } vertcVf;
00118 
00119 typedef struct {
00120      float vertU, vertV;
00121      u32   vertColor;
00122      short vertX, vertY, vertZ;
00123 } vertTfCVs;
00124 
00125 typedef struct {
00126      float vertU, vertV;
00127      u32   vertColor;
00128      float vertX, vertY, vertZ;
00129 } vertTfCVf;
00130 
00131 typedef struct {
00132      float vertU, vertV;
00133      float vertX, vertY, vertZ;
00134 } vertTfVf;
00135 
00136 typedef struct {
00137      float vertU, vertV;
00138      short vertX, vertY, vertZ;
00139 } vertTfVs;
00140 
00141 typedef struct {
00142      short vertU, vertV;
00143      float vertX, vertY, vertZ;
00144 } vertTsVf;
00145 
00146 typedef struct {
00147      short vertU, vertV;
00148      short vertX, vertY, vertZ;
00149 } vertTsVs;
00150 
00151 typedef ScePspFVector2 vect2f;
00152 typedef ScePspFVector3 vect3f;
00153 typedef ScePspFVector4 vect4f;
00154 
00155 typedef vect4f quat4f;
00156 
00157 typedef struct {
00158      vect2f linePoints[2];
00159 } Line2d;
00160 
00161 typedef struct {
00162      vect2f triPoints[3];
00163 } Triangle2d;
00164 
00165 typedef struct {
00166      vect2f circCenter;
00167      float  circRadius;
00168 } Circle2d;
00169 
00170 typedef struct {
00171      vect2f ellipseCenter;
00172      vect2f ellipseSize;
00173 } Ellipse2d;
00174 
00175 typedef struct {
00176      vect2f quadPoints[4];
00177 } Quad2d;
00178 
00179 typedef struct {
00180      vect2f rectPoints;
00181      vect2f rectSize;
00182 } Rect2d;
00183 
00184 #define vect2f_Cmp(inVect0, inVect1) (((inVect0).x == (inVect1).x) && ((inVect0).y == (inVect1).y))
00185 #define vect2f_Add(inVect0, inVect1) ((vect2f){ ((inVect0).x + (inVect1).x), ((inVect0).y + (inVect1).y) })
00186 #define vect2f_Sub(inVect0, inVect1) ((vect2f){ ((inVect0).x - (inVect1).x), ((inVect0).y - (inVect1).y) })
00187 
00188 #define vect3f_Cmp(inVect0, inVect1) (((inVect0).x == (inVect1).x) && ((inVect0).y == (inVect1).y) && ((inVect0).z == (inVect1).z))
00189 #define vect3f_Add(inVect0, inVect1) ((vect3f){ ((inVect0).x + (inVect1).x), ((inVect0).y + (inVect1).y), ((inVect0).z + (inVect1).z) })
00190 #define vect3f_Sub(inVect0, inVect1) ((vect3f){ ((inVect0).x - (inVect1).x), ((inVect0).y - (inVect1).y), ((inVect0).z - (inVect1).z) })
00191 #define vect3f_Mulf(inVect, inFloat) ((vect3f){ ((inVect).x * (inFloat)), ((inVect).y * (inFloat)), ((inVect).y * (inFloat)) })
00192 
00193 #ifdef __cplusplus
00194 }
00195 #endif
00196 
00197 #endif

Generated on Wed Sep 5 19:04:01 2007 for funcLib by  doxygen 1.5.1