termaze

maze generation and pathfinding visualizer
git clone git://git.yotsev.xyz/termaze.git
Log | Files | Refs | README | LICENSE

commit 6bcb04243852275e4268204e1494ebdd96a80626
parent 1bdb157b020fc9f6d1a62f5e214156a59589288b
Author: Petar Yotsev <petar@yotsev.xyz>
Date:   Wed, 23 Jun 2021 22:53:56 +0100

Minor cleanup

Diffstat:
Mmain.cpp | 2+-
Mmaze_gen.cpp | 2+-
Mtimer.cpp | 7++++---
3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/main.cpp b/main.cpp @@ -151,7 +151,7 @@ int main(int argc, char** argv) init_pair(green, COLOR_BLACK, COLOR_GREEN); init_pair(yellow, COLOR_BLACK, COLOR_YELLOW); init_pair(blue, COLOR_BLACK, COLOR_BLUE); - init_pair(purple, COLOR_BLACK, COLOR_MAGENTA); // not magenta, fix it | to do + init_pair(purple, COLOR_BLACK, COLOR_MAGENTA); // not magenta, fix it | TODO init_pair(cyan, COLOR_BLACK, COLOR_CYAN); init_pair(white, COLOR_BLACK, COLOR_WHITE); diff --git a/maze_gen.cpp b/maze_gen.cpp @@ -816,7 +816,7 @@ void maze_gen::RecursiveDividerSet(bool* field, const int& width, const int& hei b.push_back(c); } for (cell* n : c->GetNeighbors(grid, width, height)) { - // to do: see if you can avoid executing this twice + // TODO see if you can avoid executing this twice // i.e. c -> n wall and n -> c wall when n becomes c if (c->setName != n->setName && c->setName != 's' && n->setName != 's') { midpoint = &(c + (n - c) / 2)->pos; diff --git a/timer.cpp b/timer.cpp @@ -15,19 +15,20 @@ timer::~timer() void timer::WaitInterval(const float& time_ms) { using namespace std::chrono; + using namespace std::this_thread; if (s::ui_is_open) { s::ui_render_is_safe = true; while (s::ui_is_open) { - std::this_thread::sleep_for(milliseconds(3)); + sleep_for(milliseconds(3)); } s::ui_render_is_safe = false; - initTime = std::chrono::steady_clock::now(); + initTime = steady_clock::now(); elapsedTime = milliseconds(0); } else { elapsedTime += duration<float>(time_ms / 1000); steady_clock::time_point now = steady_clock::now(); if (initTime + elapsedTime - now > milliseconds(0)) { - std::this_thread::sleep_for(initTime + elapsedTime - now); + sleep_for(initTime + elapsedTime - now); } } }