aboutsummaryrefslogtreecommitdiffstats
path: root/demos/games/minesweeper
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-11-03 10:51:23 +1000
committerinmarket <andrewh@inmarket.com.au>2018-11-03 10:51:23 +1000
commit7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d (patch)
tree95cf152ef65ff19c7b2515b427bbe86b92b611d0 /demos/games/minesweeper
parent8bd70d953bcd3e32ceb4e45a4e561c973726280a (diff)
downloaduGFX-7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d.tar.gz
uGFX-7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d.tar.bz2
uGFX-7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d.zip
For all source files update integer types to the new gI8 etc type names
Diffstat (limited to 'demos/games/minesweeper')
-rw-r--r--demos/games/minesweeper/mines.c28
-rw-r--r--demos/games/minesweeper/resources/romfs/userfonts.h8
2 files changed, 18 insertions, 18 deletions
diff --git a/demos/games/minesweeper/mines.c b/demos/games/minesweeper/mines.c
index 5a0b4c41..4ae8f361 100644
--- a/demos/games/minesweeper/mines.c
+++ b/demos/games/minesweeper/mines.c
@@ -3,25 +3,25 @@
#include "mines.h"
typedef struct { // Node properties
- uint8_t num; // Node number, how many mines around
+ gU8 num; // Node number, how many mines around
gBool open; // Node shown or hidden
gBool check; // Node needs to be checked or not, used for opening up empty nodes
gBool flag; // Node is marked with flag by player
- uint16_t fieldNum; // Node number, used to randomize gamestart "animation"
+ gU16 fieldNum; // Node number, used to randomize gamestart "animation"
} nodeProps;
static GEventMouse ev;
static nodeProps minesField[MINES_FIELD_WIDTH][MINES_FIELD_HEIGHT]; // Mines field array
static gBool minesGameOver = gFalse;
static gBool minesGameWinner = gFalse;
-static int16_t minesEmptyNodes; // Empty node counter
-static int16_t minesFlags; // Flag counter
-static int16_t minesTime; // Time counter
+static gI16 minesEmptyNodes; // Empty node counter
+static gI16 minesFlags; // Flag counter
+static gI16 minesTime; // Time counter
static GTimer minesTimeCounterTimer;
static const char* minesGraph[] = {"1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "closed.bmp", "empty.bmp", "explode.bmp", "flag.bmp", "mine.bmp", "wrong.bmp"}; // 14 elements (0-13)
static gdispImage minesImage;
-static uint8_t minesStatusIconWidth = 0;
-static uint8_t minesStatusIconHeight = 0;
+static gU8 minesStatusIconWidth = 0;
+static gU8 minesStatusIconHeight = 0;
static gBool minesFirstGame = gTrue; // Just don't clear field for the first time, as we have black screen already... :/
static gBool minesSplashTxtVisible = gFalse;
#if MINES_SHOW_SPLASH
@@ -84,7 +84,7 @@ static void initRng(void)
srand(gfxSystemTicks());
}
-static uint32_t randomInt(uint32_t max)
+static gU32 randomInt(gU32 max)
{
return rand() % max;
}
@@ -125,7 +125,7 @@ static void minesTimeCounter(void* arg)
minesUpdateTime();
}
-static gBool inRange(int16_t x, int16_t y)
+static gBool inRange(gI16 x, gI16 y)
{
if ((x >= 0) && (x < MINES_FIELD_WIDTH) && (y >= 0) && (y < MINES_FIELD_HEIGHT))
return gTrue;
@@ -133,7 +133,7 @@ static gBool inRange(int16_t x, int16_t y)
return gFalse;
}
-static void showOne(int16_t x, int16_t y)
+static void showOne(gI16 x, gI16 y)
{
minesField[x][y].open = gTrue;
if (minesField[x][y].flag) {
@@ -167,7 +167,7 @@ static void showOne(int16_t x, int16_t y)
static void openEmptyNodes(void)
{
- int16_t x, y, i, j;
+ gI16 x, y, i, j;
gBool needToCheck = gTrue;
while (needToCheck) {
@@ -195,7 +195,7 @@ static void openEmptyNodes(void)
static DECLARE_THREAD_FUNCTION(thdMines, msg)
{
(void)msg;
- uint16_t x,y, delay;
+ gU16 x,y, delay;
gBool delayed = gFalse;
while (!minesGameOver) {
if (minesEmptyNodes == 0) {
@@ -265,7 +265,7 @@ static void printGameOver(void)
static void initField(void)
{
- int16_t x, y, mines, i, j;
+ gI16 x, y, mines, i, j;
minesFlags = 0;
minesGameOver = gFalse;
@@ -374,7 +374,7 @@ static void initField(void)
void minesStart(void)
{
- int16_t x, y;
+ gI16 x, y;
#if MINES_SHOW_SPLASH
gtimerStop(&minesSplashBlink);
diff --git a/demos/games/minesweeper/resources/romfs/userfonts.h b/demos/games/minesweeper/resources/romfs/userfonts.h
index e775aec0..232c8452 100644
--- a/demos/games/minesweeper/resources/romfs/userfonts.h
+++ b/demos/games/minesweeper/resources/romfs/userfonts.h
@@ -11,25 +11,25 @@
#error The font file is not compatible with this version of mcufont.
#endif
-static const uint8_t mf_rlefont_digital_7__mono_20_dictionary_data[39] = {
+static const gU8 mf_rlefont_digital_7__mono_20_dictionary_data[39] = {
0x81, 0x05, 0x81, 0x05, 0x81, 0x05, 0x81, 0x05, 0x81, 0x06, 0x80, 0x01, 0x07, 0x80, 0x05, 0x85,
0x05, 0x80, 0x81, 0x03, 0x03, 0x85, 0x0f, 0x44, 0x84, 0x85, 0x86, 0x88, 0x44, 0x44, 0x44, 0x44,
0x24, 0x84, 0x44, 0x44, 0x18, 0xc4, 0x83,
};
-static const uint16_t mf_rlefont_digital_7__mono_20_dictionary_offsets[13] = {
+static const gU16 mf_rlefont_digital_7__mono_20_dictionary_offsets[13] = {
0x0000, 0x0009, 0x000c, 0x000f, 0x0010, 0x0012, 0x0013, 0x0014,
0x0016, 0x001c, 0x0020, 0x0024, 0x0027,
};
-static const uint8_t mf_rlefont_digital_7__mono_20_glyph_data_0[63] = {
+static const gU8 mf_rlefont_digital_7__mono_20_glyph_data_0[63] = {
0x09, 0x1b, 0x18, 0x1c, 0x1a, 0x18, 0x1b, 0x09, 0x21, 0x19, 0x22, 0x21, 0x09, 0x83, 0x44, 0x21,
0x83, 0x20, 0x1f, 0x10, 0x09, 0x83, 0x44, 0x21, 0x82, 0x44, 0x21, 0x83, 0x09, 0x84, 0x23, 0x20,
0xec, 0x44, 0x09, 0x43, 0x20, 0x1f, 0x20, 0xec, 0x83, 0x09, 0x43, 0x20, 0x1f, 0x23, 0x0f, 0x09,
0x1b, 0x18, 0x22, 0x21, 0x09, 0x1b, 0x23, 0x23, 0x0f, 0x09, 0x1b, 0x23, 0x20, 0xec, 0x83,
};
-static const uint16_t mf_rlefont_digital_7__mono_20_glyph_offsets_0[10] = {
+static const gU16 mf_rlefont_digital_7__mono_20_glyph_offsets_0[10] = {
0x0000, 0x0007, 0x000c, 0x0014, 0x001c, 0x0022, 0x0029, 0x002f,
0x0034, 0x0039,
};