The next little game in the series where I make a fancy rogue game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
roguish/matrix.cpp

32 lines
680 B

#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 == WALL_PATH_LIMIT) {
print("# ");
} else if(cell > 15) {
print("* ");
} else {
print("{:x} ", cell);
}
if(it.row) print("\n");
}
}
}