Compare commits

..

No commits in common. "dd7a1e935a77c2fc12a8930c4ba549efcb56d5b5" and "4f9fe2a24dd66c11422535d66bce104a32efe7a6" have entirely different histories.

3 changed files with 14 additions and 189 deletions

View File

@ -161,6 +161,8 @@ public:
for (uint8_t x = 0; x < DISPLAY_CHAR_WIDTH; ++x) {
if (*(symbolBit++)) {
set(xPos + x, yPos + y, color);
} else {
set(xPos + x, yPos + y, BLACK);
}
}
}
@ -180,6 +182,8 @@ public:
for (int x = 0; x < countof(sym[0]); ++x) {
if (sym[y][x]) {
set(xPos + x, yPos + y, color);
} else {
set(xPos + x, yPos + y, BLACK);
}
}
}
@ -231,184 +235,6 @@ public:
return countof(sym[0]);
}
// TODO REMOVE QUICK & DIRTY
uint8_t printHeart(uint8_t xPos, uint8_t yPos) {
bool a[1][1] = {
{X},
};
bool b[3][3] = {
{X, _, X},
{X, X, X},
{_, X, _},
};
bool c[5][5] = {
{_, X, _, X, _},
{X, _, X, _, X},
{X, _, _, _, X},
{_, X, _, X, _},
{_, _, X, _, _},
};
bool d[7][7] = {
{_, X, X, _, X, X, _},
{X, _, _, X, _, _, X},
{X, _, _, _, _, _, X},
{X, _, _, _, _, _, X},
{_, X, _, _, _, X, _},
{_, _, X, _, X, _, _},
{_, _, _, X, _, _, _},
};
bool e[9][9] = {
{_, _, X, _, _, _, X, _, _},
{_, X, _, X, _, X, _, X, _},
{X, _, _, _, X, _, _, _, X},
{X, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, X},
{_, X, _, _, _, _, _, X, _},
{_, _, X, _, _, _, X, _, _},
{_, _, _, X, _, X, _, _, _},
{_, _, _, _, X, _, _, _, _},
};
bool f[11][11] = {
{_, _, X, X, _, _, _, X, X, _, _},
{_, X, _, _, X, _, X, _, _, X, _},
{X, _, _, _, _, X, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, X},
{_, X, _, _, _, _, _, _, _, X, _},
{_, _, X, _, _, _, _, _, X, _, _},
{_, _, _, X, _, _, _, X, _, _, _},
{_, _, _, _, X, _, X, _, _, _, _},
{_, _, _, _, _, X, _, _, _, _, _},
};
bool g[13][13] = {
{_, _, _, X, _, _, _, _, _, X, _, _, _},
{_, _, X, _, X, _, _, _, X, _, X, _, _},
{_, X, _, _, _, X, _, X, _, _, _, X, _},
{X, _, _, _, _, _, X, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, X},
{_, X, _, _, _, _, _, _, _, _, _, X, _},
{_, _, X, _, _, _, _, _, _, _, X, _, _},
{_, _, _, X, _, _, _, _, _, X, _, _, _},
{_, _, _, _, X, _, _, _, X, _, _, _, _},
{_, _, _, _, _, X, _, X, _, _, _, _, _},
{_, _, _, _, _, _, X, _, _, _, _, _, _},
};
bool h[15][15] = {
{_, _, _, X, X, _, _, _, _, _, X, X, _, _, _},
{_, _, X, _, _, X, _, _, _, X, _, _, X, _, _},
{_, X, _, _, _, _, X, _, X, _, _, _, _, X, _},
{X, _, _, _, _, _, _, X, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{_, X, _, _, _, _, _, _, _, _, _, _, _, X, _},
{_, _, X, _, _, _, _, _, _, _, _, _, X, _, _},
{_, _, _, X, _, _, _, _, _, _, _, X, _, _, _},
{_, _, _, _, X, _, _, _, _, _, X, _, _, _, _},
{_, _, _, _, _, X, _, _, _, X, _, _, _, _, _},
{_, _, _, _, _, _, X, _, X, _, _, _, _, _, _},
{_, _, _, _, _, _, _, X, _, _, _, _, _, _, _},
};
bool i[17][17] = {
{_, _, _, _, X, _, _, _, _, _, _, _, X, _, _, _, _},
{_, _, _, X, _, X, _, _, _, _, _, X, _, X, _, _, _},
{_, _, X, _, _, _, X, _, _, _, X, _, _, _, X, _, _},
{_, X, _, _, _, _, _, X, _, X, _, _, _, _, _, X, _},
{X, _, _, _, _, _, _, _, X, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{_, X, _, _, _, _, _, _, _, _, _, _, _, _, _, X, _},
{_, _, X, _, _, _, _, _, _, _, _, _, _, _, X, _, _},
{_, _, _, X, _, _, _, _, _, _, _, _, _, X, _, _, _},
{_, _, _, _, X, _, _, _, _, _, _, _, X, _, _, _, _},
{_, _, _, _, _, X, _, _, _, _, _, X, _, _, _, _, _},
{_, _, _, _, _, _, X, _, _, _, X, _, _, _, _, _, _},
{_, _, _, _, _, _, _, X, _, X, _, _, _, _, _, _, _},
{_, _, _, _, _, _, _, _, X, _, _, _, _, _, _, _, _},
};
bool j[19][19] = {
{_, _, _, _, X, X, _, _, _, _, _, _, _, X, X, _, _, _, _},
{_, _, _, X, _, _, X, _, _, _, _, _, X, _, _, X, _, _, _},
{_, _, X, _, _, _, _, X, _, _, _, X, _, _, _, _, X, _, _},
{_, X, _, _, _, _, _, _, X, _, X, _, _, _, _, _, _, X, _},
{X, _, _, _, _, _, _, _, _, X, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X},
{_, X, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, X, _},
{_, _, X, _, _, _, _, _, _, _, _, _, _, _, _, _, X, _, _},
{_, _, _, X, _, _, _, _, _, _, _, _, _, _, _, X, _, _, _},
{_, _, _, _, X, _, _, _, _, _, _, _, _, _, X, _, _, _, _},
{_, _, _, _, _, X, _, _, _, _, _, _, _, X, _, _, _, _, _},
{_, _, _, _, _, _, X, _, _, _, _, _, X, _, _, _, _, _, _},
{_, _, _, _, _, _, _, X, _, _, _, X, _, _, _, _, _, _, _},
{_, _, _, _, _, _, _, _, X, _, X, _, _, _, _, _, _, _, _},
{_, _, _, _, _, _, _, _, _, X, _, _, _, _, _, _, _, _, _},
};
const auto now = millis();
static auto step = 0;
static auto last = now;
if (now - last >= 100) {
last = now;
step = (step + 1) % 30;
}
bool *s;
switch (step) {
case 0:
s = (bool *) a;
break;
case 1:
s = (bool *) b;
break;
case 2:
s = (bool *) c;
break;
case 3:
s = (bool *) d;
break;
case 4:
s = (bool *) e;
break;
case 5:
s = (bool *) f;
break;
case 6:
s = (bool *) g;
break;
case 7:
s = (bool *) h;
break;
case 8:
s = (bool *) i;
break;
case 9:
s = (bool *) j;
break;
default:
return 0;
}
auto size = step * 2 + 1;
for (int y = 0; y < size; ++y) {
for (int x = 0; x < size; ++x) {
if (s[y * size + x]) {
set(xPos + x - step, yPos + y - step, RED);
}
}
}
return size;
}
// TODO REMOVE QUICK & DIRTY
uint8_t printI(uint8_t xPos, uint8_t yPos, Color color) {
for (int y = 0; y < 5; ++y) {
@ -422,7 +248,7 @@ public:
}
void set(uint8_t x, uint8_t y, Color color) {
if (x < 0 || y < 0 || x >= width || y >= height) {
if (x >= width || y >= height) {
return;
}
if ((y % 2) != 0) {

View File

@ -269,19 +269,18 @@ private:
void drawYear(Display& display, int year) const {
if (plus1DayForSleepingCount) {
uint8_t x = 1;
x += display.printM(x, 1, WHITE);
x += 1;
x += display.print(x, 1,SYMBOL_A, WHITE, true);
uint8_t x = 0;
x += display.print(x, 1,SYMBOL_E, WHITE, true);
x += 1;
x += display.printM(x, 1, WHITE);
x += 1;
x += display.print(x, 1,SYMBOL_A, WHITE, true);
x += 4;
x += display.print(x, 1, 3, WHITE, true);
x += display.printI(x, 1, WHITE);
x += 1;
x += display.print(x, 1, 2, WHITE, true);
display.printHeart(15, 4);
x += display.print(x, 1,SYMBOL_L, WHITE, true);
x += 3;
x += display.print(x, 1, 5, WHITE, true);
x += 3;
display.printCreeper(x, 0);
} else {
uint8_t x = 8;
x += display.print(x, 1, year / 1000 % 10, WHITE, true) + 1;

View File

@ -5,7 +5,7 @@
#include "display/Display.h"
#define FAKE_DAYS 0
#define FAKE_HOURS 2
#define FAKE_HOURS 0
#define FAKE_MINUTES 0
#define FAKE_SECONDS 0