GUECS: Minimal components from zedcaster that will let me make a GUI for a game.

This commit is contained in:
Zed A. Shaw 2025-04-21 23:45:04 -04:00
parent 10ecf50bc0
commit 1be770d62d
28 changed files with 2528 additions and 30 deletions

31
matrix.cpp Normal file
View file

@ -0,0 +1,31 @@
#include "matrix.hpp"
#include "dbc.hpp"
#include <fmt/core.h>
#include <cmath>
#include <cstdlib>
#include "constants.hpp"
using namespace fmt;
using std::min, std::max;
namespace matrix {
void dump(const std::string &msg, Matrix &map, int show_x, int show_y) {
println("----------------- {}", msg);
for(each_row it{map}; it.next();) {
int cell = map[it.y][it.x];
if(int(it.x) == show_x && int(it.y) == show_y) {
print("{:x}<", cell);
} else if(cell > 15 && cell < 32) {
print("{:x}+", cell - 16);
} else if(cell > 31) {
print("* ");
} else {
print("{:x} ", cell);
}
if(it.row) print("\n");
}
}
}