Public Access
Add four Steins;Gate pages; shuffle the page rotation hourly
Divergence meter (Nixie tubes, world lines and clock), a D-mail sent through the Phone Microwave using the panel's Message text, the Future Gadget Lab inventory with live sensors, and a world line chart of today's solar power. Original pixel art in tools/steins_sprites.py; the sprite tool is shared between themes and Sprite, sprite(), polar() and arc() move to el512_pages.h. HomeData gains the message and a 24 h solar history in 15-minute slots. The rotation now walks all pages in a random order that is reshuffled every hour (Still Alive stays out, Now playing is skipped when idle). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e9b91c5628
commit
1e8a9a5958
11 files changed
+1057
-76
No files matched your search
@@ -21,45 +21,10 @@ namespace {
|
||||
using namespace fx;
|
||||
|
||||
constexpr int W = 512, H = 256;
|
||||
constexpr float DEG = 3.14159265f / 180.0f;
|
||||
const uint8_t BAYER[4][4] = {{0, 8, 2, 10}, {12, 4, 14, 6}, {3, 11, 1, 9}, {15, 7, 13, 5}};
|
||||
|
||||
// --- Drawing helpers -----------------------------------------------------------
|
||||
|
||||
// Draw a sprite (optionally only its first `rows` rows), scaled up in blocks.
|
||||
void sprite(Display &it, const Sprite &s, int x, int y, int scale = 1, int rows = -1, Color color = COLOR_ON) {
|
||||
const int h = rows < 0 ? s.h : std::min<int>(rows, s.h);
|
||||
for (int r = 0; r < h; r++) {
|
||||
for (int c = 0; c < s.w; c++) {
|
||||
if (s.rows[r][c] != '#')
|
||||
continue;
|
||||
if (scale == 1)
|
||||
it.draw_pixel_at(x + c, y + r, color);
|
||||
else
|
||||
it.filled_rectangle(x + c * scale, y + r * scale, scale, scale, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Point on a circle; angle in degrees, 0 = up, clockwise.
|
||||
void polar(int cx, int cy, float r, float a, int *x, int *y) {
|
||||
*x = cx + (int) std::lround(r * std::sin(a * DEG));
|
||||
*y = cy - (int) std::lround(r * std::cos(a * DEG));
|
||||
}
|
||||
|
||||
void arc(Display &it, int cx, int cy, float r, float a0, float a1) {
|
||||
const int steps = std::max(2, (int) (std::fabs(a1 - a0) / 5));
|
||||
int px, py;
|
||||
polar(cx, cy, r, a0, &px, &py);
|
||||
for (int i = 1; i <= steps; i++) {
|
||||
int nx, ny;
|
||||
polar(cx, cy, r, a0 + (a1 - a0) * i / steps, &nx, &ny);
|
||||
it.line(px, py, nx, ny);
|
||||
px = nx;
|
||||
py = ny;
|
||||
}
|
||||
}
|
||||
|
||||
// Four-point twinkle.
|
||||
void sparkle(Display &it, int x, int y, int r) {
|
||||
it.horizontal_line(x - r, y, 2 * r + 1);
|
||||
|
||||
Reference in new issue
Block a user