diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-09-08 18:39:22 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-09-08 18:39:22 +0200 |
| commit | 786dccd2bc0946d48b8a2758ef2c607678bc8dd9 (patch) | |
| tree | 47952d77e5646a993671134b50c16f32ebe35b1c /Gfx.h | |
| parent | 72d350a37aa67936361ac8a374472b7e0227da61 (diff) | |
| download | pocketempires-786dccd2bc0946d48b8a2758ef2c607678bc8dd9.tar.gz | |
Removed Building and GameStructures modules. Restructured SW for Unit and Player, still a lot TODO
Diffstat (limited to 'Gfx.h')
| -rw-r--r-- | Gfx.h | 53 |
1 files changed, 30 insertions, 23 deletions
@@ -6,7 +6,9 @@ * *************************************/ #include "Global_Inc.h" -#include "GameStructures.h" +#include "System.h" +#include "Player.h" +#include "Camera.h" #ifdef __cplusplus extern "C" @@ -16,7 +18,7 @@ extern "C" /* ************************************* * Defines * *************************************/ - + #define X_SCREEN_RESOLUTION 84 #define Y_SCREEN_RESOLUTION 48 @@ -28,16 +30,17 @@ extern "C" #define GFX_NOFLIP 0 #define GFX_FLIPH 1 #define GFX_FLIPV 2 -#define GFX_FLIPHV 3 +#define GFX_FLIPHV (GFX_FLIPH | GFX_FLIPV) +#define GFX_NOROT 0 #define GFX_ROTCCW 1 #define GFX_ROTCW 3 /* ************************************* * Structs and enums * *************************************/ - -typedef struct + +typedef struct t_sprite { int8_t x; int8_t y; @@ -46,31 +49,35 @@ typedef struct uint8_t rotation; uint8_t flip; uint8_t color; - const uint8_t * Data; + const uint8_t* Data; }TYPE_SPRITE; +typedef struct t_Resource TYPE_RESOURCES; +typedef struct t_Camera TYPE_CAMERA; + /* ************************************* * 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); + +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); +void GfxDrawLine(uint8_t x0, uint8_t x1, uint8_t y0, uint8_t y1, uint8_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); +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); +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 } |
