@ -36,9 +36,14 @@ void System::lighting(GameLevel &level) {
light . path_light ( map . walls ( ) ) ;
light . path_light ( map . walls ( ) ) ;
world . query < Position , LightSource > ( [ & ] ( auto , auto & position , auto & lightsource ) {
world . query < Position , LightSource > ( [ & ] ( auto ent , auto & position , auto & lightsource ) {
light . render_light ( lightsource , position . location ) ;
light . render_light ( lightsource , position . location ) ;
if ( ent = = level . player ) {
light . update_fow ( position . location , lightsource ) ;
}
} ) ;
} ) ;
}
}
void System : : generate_paths ( GameLevel & level ) {
void System : : generate_paths ( GameLevel & level ) {
@ -572,15 +577,12 @@ void System::draw_map(GameLevel& level, Matrix& grid, EntityGrid& entity_map) {
} ) ;
} ) ;
}
}
void System : : render_map ( GameLevel & level , Matrix & tiles , EntityGrid & entity_map , sf : : RenderTexture & render , int compass_dir , wchar_t player_display ) {
void System : : render_map ( Matrix & tiles , EntityGrid & entity_map , sf : : RenderTexture & render , int compass_dir , wchar_t player_display ) {
sf : : Vector2i tile_sprite_dim { MAP_TILE_DIM , MAP_TILE_DIM } ;
sf : : Vector2i tile_sprite_dim { MAP_TILE_DIM , MAP_TILE_DIM } ;
unsigned int width = matrix : : width ( tiles ) ;
unsigned int width = matrix : : width ( tiles ) ;
unsigned int height = matrix : : height ( tiles ) ;
unsigned int height = matrix : : height ( tiles ) ;
sf : : Vector2u dim { width * tile_sprite_dim . x , height * tile_sprite_dim . y } ;
sf : : Vector2u dim { width * tile_sprite_dim . x , height * tile_sprite_dim . y } ;
auto render_size = render . getSize ( ) ;
auto render_size = render . getSize ( ) ;
Matrix & fow = level . lights - > $ fow ;
( void ) level ;
( void ) fow ;
if ( render_size . x ! = width | | render_size . y ! = height ) {
if ( render_size . x ! = width | | render_size . y ! = height ) {
bool worked = render . resize ( dim ) ;
bool worked = render . resize ( dim ) ;