/* * "ESCBOXO.H" * * Part of The Escotia Playstation Library * * Functions to make programming a chore not a pleasure * * Author: ScoTT Campbell * Date: 10/9/98 */ #ifndef __ESCBOXOHEADER #define __ESCBOXOHEADER /* EsBOXO */ 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; }EsBOXO; /* 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 line * r1, g1, b1 Drawing colour of the rectangles right hand line * r2, g2, b2 Drawing colour of the rectangles bottom line * r3, g3, b3 Drawing colour of the rectangles left hand line */ /*****************************/ /* Start of EsBOXO functions */ /*****************************/ void InitBoxO(EsBOXO* boxPtr, short int xPosition, short int yPosition, unsigned short int width, unsigned short int height); /* Initialisation of outline 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 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 start colours are set to a default of white */ void SetBoxOPosition(EsBOXO* boxPtr, short int xPosition, short int yPosition); /* Box pointed to by boxPtr has display position changed to (xPosition, yPosition) */ void SetBoxOXPosition(GsBOXF* boxPtr, int xPosition); /* Box pointed to by boxPtr has display X position changed to xPosition */ void SetBoxOYPosition(GsBOXF* boxPtr, int yPosition); /* Box pointed to by boxPtr has display Y position changed to yPosition */ void MoveBoxO(EsBOXO* boxPtr, int xAmount, int yAmount); /* Box pointed to by boxPtr has display position adjusted by (xAmount, yAmount) */ void SetBoxOSize(EsBOXO* boxPtr, unsigned short width, unsigned short height); /* Box pointed to by boxPtr has size set to width and height */ void SetBoxOWidth(EsBOXO* boxPtr, unsigned short int width); /* Box pointed to by boxPtr has its' width set to width */ void SetBoxOHeight(EsBOXO* boxPtr, unsigned short int height); /* Box pointed to by boxPtr has its' height set to height */ int AdjustBoxOHeight(EsBOXO* 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 AdjustBoxOWidth(EsBOXO* 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 SetBoxOAttributes(EsBOXO* boxPtr, unsigned long int attributes); /* Box pointed to by boxPtr has attributes set to value specified by attributes */ void SetBoxOColourVectors(EsBOXO* boxPtr, CVECTOR* topVectorPtr, CVECTOR* rightVectorPtr, CVECTOR* bottomVectorPtr, CVECTOR* leftVectorPtr); /* Sets the box pointed to by boxPtr colour to the values in the colour vector */ /* pointed to by colourVectorPtr */ void SetBoxOTopColourVector(EsBOXO* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr top line colour to the values in colourVectorPtr */ void SetBoxORightColourVector(EsBOXO* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr right hand line colour to the values in */ /* colourVectorPtr */ void SetBoxOBottomColourVector(EsBOXO* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr bottom line colour to the values in */ /* colourVectorPtr */ void SetBoxOLeftColourVector(EsBOXO* boxPtr, CVECTOR* colourVectorPtr); /* Sets the box pointed to by boxPtr left hand line colour to the value (r,g,b) */ void SetBoxOColours(EsBOXO* 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 colours to the specified RGB values which should */ /* be in the order: top line, right hand line, bottom line, left hand line */ void SetBoxOTopColour(EsBOXO* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr top line colour to the value (r,g,b) */ void SetBoxORightColour(EsBOXO* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr right hand line colour to the value (r,g,b) */ void SetBoxOBottomColour(EsBOXO* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr bottom line colour to the value (r,g,b) */ void SetBoxOLeftColour(EsBOXO* boxPtr, unsigned char r, unsigned char g, unsigned char b); /* Sets the box pointed to by boxPtr left hand line colour to the value (r,g,b) */ void EsSortBoxOutline(EsBOXO* boxPtr, GsOT* otPtr, unsigned short int pri); /* Enters a outline rectangle into OT pointed to by otPtr at position pri */ /***************************/ /* End of EsBOXO functions */ /***************************/ #endif