2017-03-07 20:57:09 +01:00
|
|
|
#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
|
|
|
|
|
2017-03-12 21:09:29 +01:00
|
|
|
#define GFX_NOFLIP 0
|
|
|
|
#define GFX_FLIPH 1
|
|
|
|
#define GFX_FLIPV 2
|
|
|
|
#define GFX_FLIPHV 3
|
|
|
|
|
|
|
|
#define GFX_ROTCCW 1
|
|
|
|
#define GFX_ROTCW 3
|
|
|
|
|
2017-03-07 20:57:09 +01:00
|
|
|
/* *************************************
|
|
|
|
* 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);
|
2017-03-09 23:59:53 +01:00
|
|
|
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);
|
2017-03-12 21:09:29 +01:00
|
|
|
void GfxFillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, int8_t color);
|
2017-03-07 20:57:09 +01:00
|
|
|
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__
|