PocketEmpires/Gfx.h

80 lines
1.9 KiB
C
Raw Normal View History

#ifndef __GFX_HEADER__
#define __GFX_HEADER__
/* *************************************
* Includes
* *************************************/
#include "Global_Inc.h"
#include "GameStructures.h"
#ifdef __cplusplus
extern "C"
{
#endif //__cplusplus
/* *************************************
* Defines
* *************************************/
#define X_SCREEN_RESOLUTION 84
#define Y_SCREEN_RESOLUTION 48
#define GFX_WHITE 0
#define GFX_BLACK 1
#define GFX_INVERT 2
#define GFX_GRAY 3
#define GFX_NOFLIP 0
#define GFX_FLIPH 1
#define GFX_FLIPV 2
#define GFX_FLIPHV 3
#define GFX_ROTCCW 1
#define GFX_ROTCW 3
/* *************************************
* Structs and enums
* *************************************/
typedef struct
{
int8_t x;
int8_t y;
uint8_t w;
uint8_t h;
uint8_t rotation;
uint8_t flip;
uint8_t color;
const uint8_t * Data;
}TYPE_SPRITE;
/* *************************************
* Global prototypes
* *************************************/
void GfxDrawSprite(TYPE_SPRITE * ptrSprite);
void GfxDrawCircle(uint16_t x, uint16_t y, uint8_t radius, int8_t color);
void GfxDrawRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, int8_t color);
void GfxFillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, int8_t color);
bool GfxRefreshNeeded(void);
void GfxShowKeyboard(char * str, uint8_t length);
uint8_t GfxGetWidthFromSpriteData(const uint8_t * sprData);
uint8_t GfxGetHeightFromSpriteData(const uint8_t * sprData);
bool GfxIsSpriteInsideScreenArea(TYPE_SPRITE * spr);
void GfxClearScreen(void);
#ifdef __cplusplus
void GfxPrintText_Flash(const __FlashStringHelper * str);
#endif // __cplusplus
void GfxPrintText(const char * str, uint8_t x, uint8_t y);
void GfxPrintTextFont(const char * str, const uint8_t * font, uint8_t x, uint8_t y);
void GfxShowResources(TYPE_RESOURCES * ptrResources);
void GfxInit(void);
void GfxRenderTiles(TYPE_CAMERA * ptrCamera);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__GFX_HEADER__