diff --git a/cmake-build-relwithdebinfo/.ninja_deps b/cmake-build-relwithdebinfo/.ninja_deps index 242dc0d..7a1fbd8 100644 Binary files a/cmake-build-relwithdebinfo/.ninja_deps and b/cmake-build-relwithdebinfo/.ninja_deps differ diff --git a/cmake-build-relwithdebinfo/.ninja_log b/cmake-build-relwithdebinfo/.ninja_log index 44e7544..cf4c1ee 100644 --- a/cmake-build-relwithdebinfo/.ninja_log +++ b/cmake-build-relwithdebinfo/.ninja_log @@ -426,3 +426,27 @@ 3276 3428 1689559335266750704 parksnrec 73f5327ec08a5e2d 4 3241 1689559654724420197 CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o 875432a17ebda434 3242 3406 1689559654891086224 parksnrec 73f5327ec08a5e2d +4 3226 1689560762539336139 CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o 875432a17ebda434 +3227 3384 1689560762699336787 parksnrec 73f5327ec08a5e2d +4 3270 1689560982176933513 CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o 875432a17ebda434 +3271 3430 1689560982336934217 parksnrec 73f5327ec08a5e2d +3 3331 1689561089374079142 CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o 875432a17ebda434 +3331 3486 1689561089530746518 parksnrec 73f5327ec08a5e2d +7 972 1689627773776677057 CMakeFiles/parksnrec.dir/src/parks/main.cpp.o 6390d2c60c8af1e3 +7 1502 1689627774306664209 CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o f83315eef0077471 +5 3650 1689627790842956241 CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o 875432a17ebda434 +3655 3841 1689627791036285474 parksnrec 73f5327ec08a5e2d +4 1394 1689628079340653016 CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o f83315eef0077471 +1394 1545 1689628079493986103 parksnrec 73f5327ec08a5e2d +5 1498 1689628119669284220 CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o f83315eef0077471 +1498 1655 1689628119825943047 parksnrec 73f5327ec08a5e2d +4 1500 1689628181339839650 CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o f83315eef0077471 +1501 1656 1689628181493166783 parksnrec 73f5327ec08a5e2d +7 1414 1689628275463236381 CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o f83315eef0077471 +1415 1570 1689628275619898399 parksnrec 73f5327ec08a5e2d +5 3261 1689628301879150929 CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o 875432a17ebda434 +3262 3416 1689628302032480074 parksnrec 73f5327ec08a5e2d +5 1483 1689628425826328479 CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o f83315eef0077471 +1483 1636 1689628425979658910 parksnrec 73f5327ec08a5e2d +4 1451 1689628531811248878 CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o f83315eef0077471 +1451 1628 1689628531987913007 parksnrec 73f5327ec08a5e2d diff --git a/cmake-build-relwithdebinfo/2023-7-16_22-26-2.log b/cmake-build-relwithdebinfo/2023-7-16_22-26-2.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-16_22-29-42.log b/cmake-build-relwithdebinfo/2023-7-16_22-29-42.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-16_22-31-29.log b/cmake-build-relwithdebinfo/2023-7-16_22-31-29.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-16_22-34-13.log b/cmake-build-relwithdebinfo/2023-7-16_22-34-13.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_16-49-19.log b/cmake-build-relwithdebinfo/2023-7-17_16-49-19.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-11-15.log b/cmake-build-relwithdebinfo/2023-7-17_17-11-15.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-11-42.log b/cmake-build-relwithdebinfo/2023-7-17_17-11-42.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-11-54.log b/cmake-build-relwithdebinfo/2023-7-17_17-11-54.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-11-59.log b/cmake-build-relwithdebinfo/2023-7-17_17-11-59.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-13-46.log b/cmake-build-relwithdebinfo/2023-7-17_17-13-46.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-13-52.log b/cmake-build-relwithdebinfo/2023-7-17_17-13-52.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-15-32.log b/cmake-build-relwithdebinfo/2023-7-17_17-15-32.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-3-11.log b/cmake-build-relwithdebinfo/2023-7-17_17-3-11.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-7-59.log b/cmake-build-relwithdebinfo/2023-7-17_17-7-59.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-8-39.log b/cmake-build-relwithdebinfo/2023-7-17_17-8-39.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/2023-7-17_17-9-41.log b/cmake-build-relwithdebinfo/2023-7-17_17-9-41.log new file mode 100644 index 0000000..e69de29 diff --git a/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/main.cpp.o b/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/main.cpp.o index df0c642..d9dae66 100644 Binary files a/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/main.cpp.o and b/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/main.cpp.o differ diff --git a/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o b/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o index ad4f6d5..a2718af 100644 Binary files a/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o and b/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/engine.cpp.o differ diff --git a/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o b/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o index 98b8c28..004ff7d 100644 Binary files a/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o and b/cmake-build-relwithdebinfo/CMakeFiles/parksnrec.dir/src/parks/renderer/resources.cpp.o differ diff --git a/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log b/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log index acde7ad..b76adb7 100644 --- a/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log +++ b/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Jul 16 22:07 EDT +Start testing: Jul 17 17:15 EDT ---------------------------------------------------------- -End testing: Jul 16 22:07 EDT +End testing: Jul 17 17:15 EDT diff --git a/cmake-build-relwithdebinfo/imgui.ini b/cmake-build-relwithdebinfo/imgui.ini index 631e067..dd77d11 100644 --- a/cmake-build-relwithdebinfo/imgui.ini +++ b/cmake-build-relwithdebinfo/imgui.ini @@ -9,7 +9,7 @@ Size=430,174 Collapsed=1 [Window][Dear ImGui Demo] -Pos=1333,405 +Pos=929,405 Size=550,680 Collapsed=1 diff --git a/cmake-build-relwithdebinfo/parksnrec b/cmake-build-relwithdebinfo/parksnrec index 20a6680..4503207 100755 Binary files a/cmake-build-relwithdebinfo/parksnrec and b/cmake-build-relwithdebinfo/parksnrec differ diff --git a/include/genetic/genetic.h b/include/genetic/old/genetic.h similarity index 99% rename from include/genetic/genetic.h rename to include/genetic/old/genetic.h index 625a4e6..d3ef838 100644 --- a/include/genetic/genetic.h +++ b/include/genetic/old/genetic.h @@ -5,7 +5,7 @@ #ifndef PARKSNREC_GENETIC_H #define PARKSNREC_GENETIC_H -#include +#include #include #include #include "ImNodesEz.h" @@ -310,6 +310,10 @@ namespace parks::genetic { // nullptr))); } + void mutate(){ + set.mutate(); + } + Program* crossover(Program* program){ return new Program(this, program); } diff --git a/include/genetic/operators.h b/include/genetic/old/operators.h similarity index 100% rename from include/genetic/operators.h rename to include/genetic/old/operators.h diff --git a/src/parks/main.cpp b/src/parks/main.cpp index 3b94dfd..56ec115 100644 --- a/src/parks/main.cpp +++ b/src/parks/main.cpp @@ -15,13 +15,13 @@ int main(){ settings.setProperty(Properties::WINDOW_TITLE, new Properties::Value("So You Think You Can Park?")); // TODO: poll hardware - //resources::init(16); + resources::init(16); // TODO local - //resources::loadTexture("/home/brett/git/parksandrec/resources/textures/test.png", "test.png"); + resources::loadTexture("/home/brett/git/parksandrec/resources/textures/test.png", "test.png"); Window::create(settings); - //resources::beginLoading(); + resources::beginLoading(); parks::Engine gameEngine(settings); //Window::setMouseVisible(false); diff --git a/src/parks/renderer/engine.cpp b/src/parks/renderer/engine.cpp index 370d0d1..0032026 100644 --- a/src/parks/renderer/engine.cpp +++ b/src/parks/renderer/engine.cpp @@ -3,7 +3,7 @@ // #include "parks/renderer/engine.h" #include -#include +#include #include #include #include @@ -17,6 +17,7 @@ namespace parks { constexpr unsigned int gtChannels = 4; std::unique_ptr p; + std::unique_ptr c; std::unique_ptr old; std::unique_ptr save; double values[gtWidth * gtHeight * gtChannels]; @@ -199,7 +200,7 @@ namespace parks { testShader.bind(); glActiveTexture(GL_TEXTURE0); - //resources::getTexture("test.png")->bind(); + resources::getTexture("test.png")->bind(); vao.bind(); vao.bindEBO(); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0); @@ -231,6 +232,9 @@ namespace parks { p = std::unique_ptr(np); BLT_TRACE("cross| np: %d, old: %d, p: %d, save: %d", np, old.get(), p.get(), save.get()); } + if (ImGui::Button("Mutate")){ + p->mutate(); + } if (ImGui::Button("Save")){ save = std::move(p); p = std::make_unique(); @@ -320,6 +324,8 @@ namespace parks { Engine::~Engine() { running = false; for (auto*& t : runningThread) { + if (t == nullptr) + continue; t->join(); delete t; } diff --git a/src/parks/renderer/resources.cpp b/src/parks/renderer/resources.cpp index 2ec2d1a..a551390 100644 --- a/src/parks/renderer/resources.cpp +++ b/src/parks/renderer/resources.cpp @@ -55,7 +55,7 @@ namespace parks { stbi_set_flip_vertically_on_load(true); for (int i = 0; i < TextureLoader.numThreads; i++) { TextureLoader.threads[i] = new std::thread( - []() -> void { + [i]() -> void { try { stbi_set_flip_vertically_on_load_thread(true); while (!TextureLoader.texturesToLoad.empty()) { @@ -63,6 +63,8 @@ namespace parks { try { std::scoped_lock textureQueueLock{ TextureLoader.textureQueueMutex}; + if (TextureLoader.texturesToLoad.empty()) + break; texture = TextureLoader.texturesToLoad.front(); TextureLoader.texturesToLoad.pop(); } catch (std::exception& e){ @@ -71,6 +73,7 @@ namespace parks { } if (texture.path.empty()) continue; + BLT_TRACE("Processing Texture %s", texture.path.c_str()); LoadedTexture loadedTexture; loadedTexture.data = stbi_load( texture.path.c_str(), &loadedTexture.width, @@ -92,7 +95,7 @@ namespace parks { std::scoped_lock threadSyncLock( TextureLoader.threadSyncMutex ); - TextureLoader.finishedThreads++; + TextureLoader.finishedThreads += 1; } } catch (const std::exception& e) { BLT_ERROR("An error has been detected in the loader thread loop!"); @@ -108,7 +111,7 @@ namespace parks { LoadedTexture texture; { if (TextureLoader.loadedTextures.empty()) { - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(50)); continue; } std::scoped_lock loadQueueLock{TextureLoader.glLoadQueueMutex};