Turned on all the warnings I could handle and made them into errors then fixed them all. Worldbuilder needs a refactor in random_path.

This commit is contained in:
Zed A. Shaw 2025-01-10 15:22:37 -05:00
parent f3f875ee80
commit 128fc4f540
19 changed files with 85 additions and 85 deletions

View file

@ -16,16 +16,16 @@ using namespace components;
using ftxui::Color;
using lighting::LightSource;
void System::lighting(DinkyECS::World &world, Map &game_map, LightRender &light, Player &player) {
void System::lighting(DinkyECS::World &world, Map &game_map, LightRender &light) {
light.reset_light();
world.query<Position, LightSource>([&](const auto &ent, auto &position, auto &lightsource) {
world.query<Position>([&](const auto &ent[[maybe_unused]], auto &position) {
light.set_light_target(position.location);
});
light.path_light(game_map.walls());
world.query<Position, LightSource>([&](const auto &ent, auto &position, auto &lightsource) {
world.query<Position, LightSource>([&](const auto &ent[[maybe_unused]], auto &position, auto &lightsource) {
light.render_light(lightsource, position.location);
});
}
@ -62,7 +62,7 @@ void System::init_positions(DinkyECS::World &world) {
}
});
world.query<Position, InventoryItem>([&](const auto &ent, auto &pos, auto &item) {
world.query<Position>([&](const auto &ent, auto &pos) {
collider.insert(pos.location, ent);
});
}
@ -185,7 +185,7 @@ void System::collision(DinkyECS::World &world, Player &player) {
void System::draw_entities(DinkyECS::World &world, Map &game_map, const Matrix &lighting, ftxui::Canvas &canvas, const Point &cam_orig, size_t view_x, size_t view_y) {
auto &tiles = game_map.tiles();
world.query<Position, Tile>([&](const auto &ent, auto &pos, auto &tile) {
world.query<Position, Tile>([&](auto &ent[[maybe_unused]], auto &pos, auto &tile) {
if(pos.location.x >= cam_orig.x && pos.location.x <= cam_orig.x + view_x
&& pos.location.y >= cam_orig.y && pos.location.y <= cam_orig.y + view_y) {
Point loc = game_map.map_to_camera(pos.location, cam_orig);