split config now
This commit is contained in:
35
semestralka1/src/render/background.cpp
Normal file
35
semestralka1/src/render/background.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// src/render/background.cpp
|
||||
|
||||
#include "../background_dark_inverted.h"
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
void draw_mask(const char *unused_filename, int shift, const char *text) {
|
||||
const int view_width = 50;
|
||||
const int view_height = 19;
|
||||
|
||||
// Terminal clear + home
|
||||
printf("\033[2J\033[H");
|
||||
|
||||
for (int i = 0; i < view_height && i < BACKGROUND_DARK_INVERTED_LINES; i++) {
|
||||
const char *row = BACKGROUND_DARK_INVERTED[i];
|
||||
int width = strlen(row);
|
||||
if (width == 0) {
|
||||
printf("\r\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
int start = shift % width;
|
||||
|
||||
for (int j = 0; j < view_width; j++) {
|
||||
printf("%c", row[(start + j) % width]);
|
||||
}
|
||||
printf("\r\n");
|
||||
}
|
||||
|
||||
if (text && text[0] != '\0') {
|
||||
printf("\r\n[RX] %s\r\n", text);
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
Reference in New Issue
Block a user