diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 16:09:47 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 16:09:47 +0200 |
commit | 277157b3e06b2deeacbdbc8bf6190de19f88169d (patch) | |
tree | db9c013b67f93d27fa5bb9cf84c7d6dc53f72734 /ViewController.cpp | |
parent | 64028952ceb17f97ded08f1ab7ec0b06c41e2b87 (diff) |
more refactoring / preparation for pathfinding
Diffstat (limited to 'ViewController.cpp')
-rw-r--r-- | ViewController.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ViewController.cpp b/ViewController.cpp index ec0315d..67fd77c 100644 --- a/ViewController.cpp +++ b/ViewController.cpp @@ -66,24 +66,24 @@ void ViewController::update_artists() { } } -void ViewController::draw_pathfinding_dot(unsigned int x, unsigned int y, const Color & c) { +void ViewController::draw_pathfinding_dot(pair<unsigned int, unsigned int> point, const Color & color) { this->view.fill_rect(center({ - .x = static_cast<float>(x * scale), - .y = static_cast<float>(y * scale), + .x = static_cast<float>(point.first * scale), + .y = static_cast<float>(point.second * scale), .width = static_cast<float>(pathfinding_size), .height = static_cast<float>(pathfinding_size), - }), c); + }), color); } void ViewController::update_pathfinding() { PathfindingContext & ctx = this->museum.pathfinding; - this->draw_pathfinding_dot(ctx.get_end().first, ctx.get_end().second, { + this->draw_pathfinding_dot(ctx.get_end(), { .red = 0x00, .green = 0x00, .blue = 0xdd, }); - this->draw_pathfinding_dot(ctx.get_start().first, ctx.get_start().second, { + this->draw_pathfinding_dot(ctx.get_start(), { .red = 0xff, .green = 0xff, .blue = 0xff, |