@ -16,16 +16,16 @@ using namespace components;
using ftxui : : Color ;
using ftxui : : Color ;
using lighting : : LightSource ;
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 ( ) ;
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 . set_light_target ( position . location ) ;
} ) ;
} ) ;
light . path_light ( game_map . walls ( ) ) ;
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 ) ;
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 ) ;
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 ) {
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 ( ) ;
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
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 ) {
& & 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 ) ;
Point loc = game_map . map_to_camera ( pos . location , cam_orig ) ;