/* * "ESCGBOXF.H" * * Part of The Escotia Playstation Library * * Functions to make programming a chore not a pleasure * * Author: ScoTT Campbell * Date: 10/9/98 */ #ifndef __ESCGBOXFHEADER #define __ESCGBOXFHEADER /* EsGBOXF */ /* Rectangle handler with gradation */ typedef struct{ unsigned long int attribute; short int x,y; unsigned short int w,h; unsigned char r0, g0, b0; unsigned char r1, g1, b1; unsigned char r2, g2, b2; unsigned char r3, g3, b3; }EsGBOXF; /* Members * attribute Attribute bits as shown below. (Bits not * defined below are reserved by the system) * * 28-29: Semi-transparency rate * 0: 0.5 x Back + 0.5 x Forward * 1: 1.0 x Back + 1.0 x Forward * 2: 1.0 x Back - 1.0 x Forward * 3: 1.0 x Back + 0.25 x Forward * * 30: Semi-transparency mode * 0: Semi-transparency OFF * 1: Semi-transparency ON * * 31: Display Mode * 0: Enable display * 1: Disable display * * x, y Display position (upper left-hand point) * w, h Size of rectangle (width, height) * r0, g0, b0 Drawing colour of the rectangles top left corner * r1, g1, b1 Drawing colour of the rectangles bottom left corner * r2, g2, b2 Drawing colour of the rectangles top right corner * r3, g3, b3 Drawing colour of the rectangles bottom right corner */ /******************************/ /* Start of EsGBOXF functions */ /******************************/ void InitGBoxF(EsGBOXF* boxPtr, int xPosition, int yPosition, int width, int height); /* Initialisation of gradation boxes in one easy function */ /* xPosition and yPosition are the display position for the top left corner of the box */ /* and can be changed after initialisation using MoveBox() */ /* width and height specify the size of the box in pixels, and can be changed after */ /* initialisation using SetBoxSize() */ /* The box's attributes are set to a default of no transparency and display enabled */ /* and can be changed with the function SetBoxAttributes() */ /* The box's left corners' colours are set to a default of black, and its' right */ /* corners are set to white */ void SetGBoxFPosition(EsGBOXF* boxPtr, int xPosition, int yPosition); /* Box pointed to by boxPtr has display position changed to (xPosition, yPosition) */ void SetGBoxFXPosition(EsGBOXF* boxPtr, int xPosition); /* Box pointed to by boxPtr has display X position changed to xPosition */ void SetGBoxFYPosition(EsGBOXF* boxPtr, int yPosition); /* Box pointed to by boxPtr has display Y position changed to xPosition */ void MoveGBoxF(EsGBOXF* boxPtr, int xAmount, int yAmount); /* Box pointed to by boxPtr has display position adjusted by (xAmount, yAmount) */ void SetGBoxFSize(EsGBOXF* boxPtr, unsigned short int width, unsigned short int height); /* Box pointed to by boxPtr has size set to width and height */ void SetGBoxFWidth(EsGBOXF* boxPtr, unsigned short int width); /* Box pointed to by boxPtr has its' width set to width */ void SetGBoxFHeight(EsGBOXF* boxPtr, unsigned short int height); /* Box pointed to by boxPtr has its' height set to height */ int AdjustGBoxFHeight(EsGBOXF* boxPtr, int amount); /* Box pointed to by boxPtr has height changed by amount */ /* If amount is negative and greater than it's height then height is set to 0 and the */ /* function will return 1; otherwise the function returns 0 */ int AdjustGBoxFWidth(EsGBOXF* boxPtr, int amount); /* Box pointed to by boxPtr has width changed by amount */ /* If amount is negative and greater than it's width then width is set to 0 and the */ /* function will return 1; otherwise the function returns 0 */ void SetGBoxFAttributes(EsGBOXF* boxPtr, unsigned long int attributes); /* Box pointed to by boxPtr has attributes set to value specified by attributes */ void SetGBoxFColourVectors(EsGBOXF* boxPtr, CVECTOR* topLeftVectorPtr, CVECTOR* bottomLeftVectorPtr, CVECTOR* topRightVectorPtr, CVECTOR* bottomRightVectorPtr); /* Sets the box pointed to by boxPtr corners to the colour values in the colour */ /* vectors pointed to by topLeftVectorPtr, botomLeftVectorPtr, topRightVectorPtr and */ /* bottomRightVectorPtr */ void SetGBoxFTopLeftColourVector(EsGBOXF* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr top left corner colour to the value in the colour */ /* vector pointed to by startVectorPtr */ void SetGBoxFTopRightColourVector(EsGBOXF* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr top right corner colour to the value in the colour */ /* vector pointed to by startVectorPtr */ void SetGBoxFBottomLeftColourVector(EsGBOXF* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr bottom left corner colour to the value in the */ /* colour vector pointed to by startVectorPtr */ void SetGBoxFBottomRightColourVector(EsGBOXF* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr bottom right corner colour to the value in the */ /* colour vector pointed to by startVectorPtr */ void SetGBoxFColours(EsGBOXF* boxPtr, unsigned char r0, unsigned char g0, unsigned char b0, unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2, unsigned char r3, unsigned char g3, unsigned char b3); /* Sets the box pointed to by boxPtr corners RGB colour values, which should be in the */ /* order top left, bottom left, top right and bottom right */ void SetGBoxFTopLeftColour(EsGBOXF* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr top left corner colour to the value (r,g,b) */ void SetGBoxFTopRightColour(EsGBOXF* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr top right corner colour to the value (r,g,b) */ void SetGBoxFBottomLeftColour(EsGBOXF* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr bottom left corner colour to the value (r,g,b) */ void SetGBoxFBottomRightColour(EsGBOXF* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr bottom right corner colour to the value (r,g,b) */ int EsSortGBoxFill(EsGBOXF* boxPtr, GsOT* otPtr, unsigned short int pri); /* Enters a gradation rectangle into position pri of an OT pointed to by otPtr */ /* Returns 1 if there the box cannot be drawn; 0 otherwise */ /****************************/ /* End of EsGBOXF functions */ /****************************/ #endif