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

45 lines
848 B

#pragma once
#include <string>
#include <unordered_map>
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 left = true;
bool top = true;
bool expand = false;
Cell(int col, int row) : col(col), row(row) {}
};
struct LELParser {
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;
LELParser(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();
bool parse(std::string input);
void finalize();
};