/* * "ESCBOXF.C" * * Part of The Escotia Playstation Library * * Author: ScoTT Campbell * Date: 10/9/98 * */ #include "..\headers\escboxf.h" /*****************************/ /* Start of GsBOXF functions */ /*****************************/ void InitBoxF(GsBOXF* boxPtr, int xPosition, int yPosition, int width, int height) { boxPtr->x = xPosition; boxPtr->y = yPosition; boxPtr->w = width; boxPtr->h = height; boxPtr->r = 255; boxPtr->g = 255; boxPtr->b = 255; boxPtr->attribute = 0; }/* InitBoxF */ void SetBoxFPosition(GsBOXF* boxPtr, int xPosition, int yPosition) { boxPtr->x = xPosition; boxPtr->y = yPosition; }/* SetBoxFPosition */ void SetBoxFXPosition(GsBOXF* boxPtr, int xPosition) { boxPtr->x = xPosition; }/* SetBoxFXPosition */ void SetBoxFYPosition(GsBOXF* boxPtr, int yPosition) { boxPtr->y = yPosition; }/* SetBoxFYPosition */ void MoveBoxF(GsBOXF* boxPtr, int xAmount, int yAmount) { boxPtr->x += xAmount; boxPtr->y += yAmount; }/* MoveBoxF */ void SetBoxFSize(GsBOXF* boxPtr, unsigned short width, unsigned short height) { boxPtr->w = width; boxPtr->h = height; }/* SetBoxFSize */ void SetBoxFWidth(GsBOXF* boxPtr, unsigned short int width) { boxPtr->w = width; }/* SetBoxFWidth */ void SetBoxFHeight(GsBOXF* boxPtr, unsigned short int height) { boxPtr->h = height; }/* SetBoxFHeight */ int AdjustBoxFHeight(GsBOXF* boxPtr, int amount) { if((amount < 0) && (abs(amount) > boxPtr->h)) { boxPtr->h = 0; return 1; } else { boxPtr->h += amount; return 0; } } int AdjustBoxFWidth(GsBOXF* boxPtr, int amount) { if((amount < 0) && (abs(amount) > boxPtr->w)) { boxPtr->w = 0; return 1; } else { boxPtr->w += amount; return 0; } } void SetBoxFAttributes(GsBOXF* boxPtr, unsigned long int attributes) { /* Clear top 4 bits ready to set*/ boxPtr->attribute &= 0x0FFFFFFF; /* Set the bits we want */ boxPtr->attribute |= attributes; } void SetBoxFColour(GsBOXF* boxPtr, int red, int blue, int green) { boxPtr->r = red; boxPtr->g = blue; boxPtr->b = green; } void SetBoxFColourVector(GsBOXF* boxPtr, CVECTOR* colourVectorPtr) { boxPtr->r = colourVectorPtr->r; boxPtr->g = colourVectorPtr->g; boxPtr->b = colourVectorPtr->b; } /***************************/ /* End of GsBOXF functions */ /***************************/