summaryrefslogtreecommitdiff
path: root/Gfx.h
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2018-07-09 19:26:13 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2018-07-09 19:26:13 +0200
commitf0b654b9bf3bc2a93c1f89d4cc3edcf77b948555 (patch)
tree91b7404dca0b6eb136cb7f9b144435419144b777 /Gfx.h
parentd85464781580796bbcc744ae732e56d1920e3b0f (diff)
downloadpocketempires-f0b654b9bf3bc2a93c1f89d4cc3edcf77b948555.tar.gz
Game has been restructured in favor of OOP
Diffstat (limited to 'Gfx.h')
-rw-r--r--Gfx.h83
1 files changed, 35 insertions, 48 deletions
diff --git a/Gfx.h b/Gfx.h
index 055b0b8..3bcd790 100644
--- a/Gfx.h
+++ b/Gfx.h
@@ -1,62 +1,49 @@
-#ifndef __GFX_HEADER__
-#define __GFX_HEADER__
+#ifndef GFX_H__
+#define GFX_H__
/* *************************************
- * Includes
+ * Includes
* *************************************/
-#include "Global_Inc.h"
-#include "System.h"
-#include "Player.h"
-#include "Camera.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif //__cplusplus
-
/* *************************************
- * Defines
+ * 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 (GFX_FLIPH | GFX_FLIPV)
-
-#define GFX_NOROT 0
-#define GFX_ROTCCW 1
-#define GFX_ROTCW 3
-
/* *************************************
- * Structs and enums
+ * Structs and enums
* *************************************/
-typedef struct t_sprite
+enum tScreenResolution
+{
+ X_SCREEN_RESOLUTION = 84,
+ Y_SCREEN_RESOLUTION = 48
+};
+
+enum tColour
{
- 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;
+ GFX_WHITE,
+ GFX_BLACK,
+ GFX_INVERT,
+ GFX_GRAY
+};
-typedef struct t_Resource TYPE_RESOURCES;
-typedef struct t_Camera TYPE_CAMERA;
+enum tMirror
+{
+ GFX_NOFLIP,
+ GFX_FLIPH,
+ GFX_FLIPV,
+ GFX_FLIPHV = (GFX_FLIPH | GFX_FLIPV)
+};
+
+enum tRotation
+{
+ GFX_NOROT,
+ GFX_ROTCCW,
+ GFX_ROTCW
+};
/* *************************************
- * Global prototypes
+ * Global prototypes
* *************************************/
void GfxDrawSprite(TYPE_SPRITE* ptrSprite);
@@ -73,13 +60,13 @@ bool GfxIsSpriteInsideScreenArea(TYPE_SPRITE* spr);
void GfxClearScreen(void);
#ifdef __cplusplus
void GfxPrintText_Flash(const __FlashStringHelper * str);
-#endif // __cplusplus
+#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 GfxInit(void);
#ifdef __cplusplus
}
-#endif //__cplusplus
+#endif /* cplusplus. */
-#endif //__GFX_HEADER__
+#endif /* GFX_H__. */