/* * "ESCGBOXO.H" * * Part of The Escotia Playstation Library * * Functions to make programming a chore not a pleasure * * Author: ScoTT Campbell * Date: 18/9/98 */ #ifndef __ESCGBOXOHEADER #define __ESCGBOXOHEADER /* EsGBOXO */ /* 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; }EsGBOXO; /* 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 InitGBoxO(EsGBOXO* boxPtr, int xPosition, int yPosition, int width, int height); /* Initialisation of outline gradation rectangles 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 MoveGBoxO() */ /* width and height specify the size of the box in pixels, and can be changed after */ /* initialisation using SetGBoxOSize() */ /* The box's attributes are set to a default of no transparency and display enabled */ /* and can be changed with the function SetGBoxOAttributes() */ /* The box's left corners' colours are set to a default of black, and its' right */ /* corners are set to white */ void SetGBoxOPosition(EsGBOXO* boxPtr, int xPosition, int yPosition); /* Box pointed to by boxPtr has display position changed to (xPosition, yPosition) */ void SetGBoxOXPosition(EsGBOXO* boxPtr, int xPosition); /* Box pointed to by boxPtr has its' display X position set to xPosition */ void SetGBoxOYPosition(EsGBOXO* boxPtr, int yPosition); /* Box pointed to by boxPtr has its' display Y position set to yPosition */ void MoveGBoxO(EsGBOXO* boxPtr, int xAmount, int yAmount); /* Box pointed to by boxPtr has display position adjusted by (xAmount, yAmount) */ void SetGBoxOSize(EsGBOXO* boxPtr, unsigned short int width, unsigned short int height); /* Box pointed to by boxPtr has size set to width and height */ void SetGBoxOWidth(EsGBOXO* boxPtr, unsigned short int width); /* Box pointed to by boxPtr has its' width set to width */ void SetGBoxOHeight(EsGBOXO* boxPtr, unsigned short int height); /* Box pointed to by boxPtr has its' height set to height */ int AdjustGBoxOHeight(EsGBOXO* 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 AdjustGBoxOWidth(EsGBOXO* 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 SetGBoxOAttributes(EsGBOXO* boxPtr, unsigned long int attributes); /* Box pointed to by boxPtr has attributes set to value specified by attributes */ void SetGBoxOColourVectors(EsGBOXO* 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 SetGBoxOTopLeftColourVector(EsGBOXO* 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 SetGBoxOTopRightColourVector(EsGBOXO* 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 SetGBoxOBottomLeftColourVector(EsGBOXO* 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 SetGBoxOBottomRightColourVector(EsGBOXO* 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 SetGBoxOColours(EsGBOXO* 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 SetGBoxOTopLeftColour(EsGBOXO* 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 SetGBoxOTopRightColour(EsGBOXO* 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 SetGBoxOBottomLeftColour(EsGBOXO* 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 SetGBoxOBottomRightColour(EsGBOXO* 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) */ void EsSortGBoxOutline(EsGBOXO* boxPtr, GsOT* otPtr, unsigned short int pri); /* Enters a outline gradation rectangle into position pri of an OT pointed to by otPtr */ /****************************/ /* End of EsGBOXF functions */ /****************************/ #endif