fixed several memory leaks caused by not including virtual destructors, added a config for the visualizer, next up is lua
This commit is contained in:
@@ -6,18 +6,20 @@
|
||||
#include "../engine/utility/camera.hpp"
|
||||
#include "../engine/utility/grid2d.hpp"
|
||||
#include "../engine/scripting/luacontextmanager.hpp"
|
||||
#include "dungeonalgorithm.hpp"
|
||||
#include "algorithmmanager.hpp"
|
||||
#include "tilemap.hpp"
|
||||
#include <vector>
|
||||
#include <range/v3/range.hpp>
|
||||
#include <range/v3/view.hpp>
|
||||
#ifndef RLA_IIPP_VISUALIZER_HPP
|
||||
#define RLA_IIPP_VISUALIZER_HPP
|
||||
#define MAP_SIZE_W 20
|
||||
#define MAP_SIZE_H 20
|
||||
#define TILE_WIDTH 48
|
||||
#define TILE_HEIGHT 48
|
||||
#define WALL_CHAR '#'
|
||||
#define FLOOR_CHAR '.'
|
||||
#define DEFAULT_MAP_SIZE_W 20
|
||||
#define DEFAULT_MAP_SIZE_H 20
|
||||
#define DEFAULT_TILE_WIDTH 48
|
||||
#define DEFAULT_TILE_HEIGHT 48
|
||||
#define DEFAULT_WALL_CHAR "#"
|
||||
#define DEFAULT_FLOOR_CHAR "."
|
||||
#define CONFIG_FILE "visualizer.toml"
|
||||
|
||||
class Visualizer : public Game {
|
||||
public:
|
||||
@@ -34,17 +36,24 @@ public:
|
||||
private:
|
||||
int window_width = 0;
|
||||
int window_height = 0;
|
||||
Grid2D<char> tile_map = Grid2D<char>(0, 0);
|
||||
TileMap tile_map = TileMap(0, 0, DEFAULT_WALL_CHAR[0], DEFAULT_FLOOR_CHAR[0]);
|
||||
Camera camera = Camera();
|
||||
LuaContextManager lua_context_manager = LuaContextManager();
|
||||
std::optional<DungeonAlgorithm> current_algorithm;
|
||||
AlgorithmManager algorithm_manager;
|
||||
|
||||
int x = 0;
|
||||
int y=0;
|
||||
int sprite_index = 1;
|
||||
|
||||
char floor_char;
|
||||
char wall_char;
|
||||
int map_size_w;
|
||||
int map_size_h;
|
||||
int tile_width;
|
||||
int tile_height;
|
||||
|
||||
void initialize_map(int width, int height);
|
||||
void update_algorithm(DungeonAlgorithm algorithm);
|
||||
void initialize_context();
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user