Lots of dumb little edits to sort out what I'm aiming at. I'll next clean out most of this in a refactor.

This commit is contained in:
Zed A. Shaw 2025-04-06 15:32:19 -04:00
parent 1f90367f51
commit c7c48658bd
13 changed files with 60 additions and 29 deletions

View file

@ -337,7 +337,7 @@ void System::plan_motion(DinkyECS::World& world, Point move_to) {
* This one is called inside the MapViewUI very often so
* just avoid GameMap unlike the others.
*/
std::wstring System::draw_map(GameLevel level, size_t view_x, size_t view_y) {
std::wstring System::draw_map(GameLevel level, size_t view_x, size_t view_y, Point aim) {
DinkyECS::World &world = *level.world;
Map &map = *level.map;
@ -360,6 +360,14 @@ std::wstring System::draw_map(GameLevel level, size_t view_x, size_t view_y) {
}
}
if(aim.x >= cam_orig.x && aim.x <= cam_orig.x + view_x
&& aim.y >= cam_orig.y && aim.y <= cam_orig.y + view_y)
{
Point aim_at = map.map_to_camera(aim, cam_orig);
grid[aim_at.y][aim_at.x] = '*';
}
// then get the enemy/item/device tiles and fill those in
world.query<Position, Tile>([&](auto, auto &pos, auto &entity_glyph) {
if(pos.location.x >= cam_orig.x && pos.location.x <= cam_orig.x + view_x