// Various routines for manipulating 2D graphics // coded by Scott Evans 8/4/97 // Last modified 16/4/97 #ifndef _2DGFX_H #define _2DGFX_H // Width and height of a texture page (in pixels) #define TPWDTH 256 #define TPHGHT 256 // Semi-transparency effects #define noEffects 0 // No transparency effects #define pixelNormal 0x40000000 // Normal transparency effect #define pixelAdd 0x50000000 // Pixel addition #define pixelSub 0x60000000 // Pixel subtraction #define pixelQAdd 0x70000000 // 25% pixel addition #define displayOff 0x80000000 // stop displaying object // Set the colour of a GsBOXF, GsLINE or GsGLINE #define _SetColour(P,R,G,B) \ (P)->r0=(R),(P)->g0=(G),(P)->b0=(B) // Set GsBOXF (Filled box) parameters #define _SetBOXF(P,A,X,Y,W,H,R,G,B) \ (P)->attribute=(A),(P)->x=(X),(P)->y=(Y),(P)->w=(W),\ (P)->h=(H),(P)->r=(R),(P)->g=(G),(P)->b=(B) // Set GsLINE (straight line) parameters #define _SetLINE(P,A,X,Y,X1,Y1,R,G,B) \ (P)->attribute=(A),(P)->x0=(X),(P)->y0=(Y),(P)->x1=(X1),\ (P)->y1=(Y1),(P)->r0=(R),(P)->g0=(G),(P)->b0=(B) // Set GsGLINE (graduated line) parameters #define _SetGLINE(P,A,X,Y,X1,Y1,R,G,B,R1,G1,B1) \ _SetLINE(P,A,X,Y,X1,Y1,R,G,B),(P)->r1=(R1),\ (P)->g1=(G1),(P)->b1=(B1) // set GsCELL (background picture component) #define _SetCELL(P,U,V,C,F,T) \ (P)->u=(U),(P)->v=(V),(P)->cba=(C),(P)->flag=(F),(P)->tpage=(T) // Set GsSPRITE #define _SetSPRITE(P,A,X,Y,W,H,T,U,V,CX,CY,R,G,B,MX,MY,SX,SY,R1) \ (P)->attribute=(A),(P)->x=(X),(P)->y=(Y),(P)->w=(W),(P)->h=(H),(P)->tpage=(T),\ (P)->u=(U),(P)->v=(V),(P)->cx=(CX),(P)->cy=(CY),(P)->r=(R),(P)->g=(G),(P)->b=(B),\ (P)->mx=(MX),(P)->my=(MY),(P)->scalex=(SX),(P)->scaley=(SY),(P)->rotate=(R1) #endif