Exploring raycasters and possibly make a little "doom like" game based on it.
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.
 
 
 
 
 
 
raycaster/lel.hpp

49 lines
964 B

#pragma once
#include <string>
#include <unordered_map>
#include <functional>
namespace lel {
struct Cell {
int x = 0;
int y = 0;
int w = 0;
int h = 0;
int max_w = 0;
int max_h = 0;
int col = 0;
int row = 0;
bool right = false;
bool bottom = false;
bool expand = false;
bool center = false;
Cell(int col, int row) : col(col), row(row) {}
};
struct Parser {
int grid_x = 0;
int grid_y = 0;
int grid_w = 0;
int grid_h = 0;
int rows = 0;
int columns = 0;
Cell cur;
std::unordered_map<std::string, Cell> cells;
Parser(int x, int y, int width, int height);
void col();
void ltab();
void align(char dir);
void valign(char dir);
void id(std::string name);
void row();
void setwidth(int width);
void setheight(int height);
void expand();
void reset();
void center();
bool parse(std::string input);
void finalize();
};
}