diff --git a/cmake-build-debug/.ninja_deps b/cmake-build-debug/.ninja_deps index 9bb2c74..8106209 100644 Binary files a/cmake-build-debug/.ninja_deps and b/cmake-build-debug/.ninja_deps differ diff --git a/cmake-build-debug/.ninja_log b/cmake-build-debug/.ninja_log index b3e75d0..96cf7b9 100644 --- a/cmake-build-debug/.ninja_log +++ b/cmake-build-debug/.ninja_log @@ -2,17 +2,17 @@ 2123 2512 1677649375551295411 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/pfr/pfr.c.o dc7ddf024affda22 2478 2696 1677649375735300670 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/type42/type42.c.o b7bf5e77154bf28e 2531 2592 1677649375631297699 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/builds/unix/ftsystem.c.o 646b9527782db911 -2 1068 1677858450888884841 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 6515e540120cf543 +3 1071 1677989283951841299 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 6515e540120cf543 2408 2478 1677649375515294382 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/svg/svg.c.o 3c521ba5d5506f6d -2 987 1677858450808882667 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +3 994 1677989283875839215 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 50 999 1673895013560650475 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/string.cpp.o cfdb4277170e1146 1881 1943 1677649374983279166 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftsynth.c.o f15a6ee99e365112 551 747 1677649373783244853 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/monitor.c.o 239e3c995f2fc57c -7 732 1677858115607779393 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o d9d07699ecf3c7f6 +3 443 1677988339293715027 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o d9d07699ecf3c7f6 1810 1881 1677649374919277336 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftinit.c.o 9bf07f1afe4c5120 3 469 1677858115343772228 CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o 9b5b6b6b3f0368f8 1710 1764 1677649374803274019 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftfstype.c.o e63d4e616c6a179c -1348 2988 1677649376023308906 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o f6cc949795fe632a +3 1564 1677988340413746495 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o f6cc949795fe632a 1610 1651 1677649374691270819 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftbdf.c.o bee13becfa6b57c0 4 1087 1677858115959788946 CMakeFiles/FinalProject.dir/src/render/window.cpp.o fe3bf24074ba9c2f 2453 2936 1677649375975307536 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/type1/type1.c.o 41bca485020c6b18 @@ -23,15 +23,15 @@ 1840 1892 1677649374931277679 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftpatent.c.o 6617c5fd2e75a2f9 858 1084 1677649374123254573 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/x11_init.c.o 7a310a4749a2e05 1651 1775 1677649374815274363 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftbitmap.c.o 8ce02b3a42c98959 -0 98 1677987591612948962 build.ninja 190f84590f6ee728 +0 98 1677999427434180349 build.ninja 190f84590f6ee728 2550 2591 1677649375631297699 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftdebug.c.o b73c3b9b7d19e4d5 3 366 1677858170717275276 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/format.cpp.o 342a5daa6ca9681d 1656 1710 1677649374747272417 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftcid.c.o c5d515ae6d477f99 1551 2408 1677649375443292323 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftbase.c.o fbb6e43e2ee99b37 2301 2550 1677649375587296441 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/raster/raster.c.o 4ad85cadbb69f690 403 551 1677649373583239133 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/init.c.o 6051295f860fb367 -366 443 1677858170781277013 libraries/BLT/libBLT.a b8f809e0bb7338ed -1615 1788 1677858451608904405 FinalProject de45775e2c99866f +1564 1661 1677988340489748630 libraries/BLT/libBLT.a b8f809e0bb7338ed +1516 1691 1677989284571858296 FinalProject de45775e2c99866f 1873 1924 1677649374963278597 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftpfr.c.o ba3859c14ff3f825 1923 1959 1677649374999279626 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/bzip2/ftbzip2.c.o c17349c766699177 1 49 1673895012612644820 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/queues.cpp.o 55504c9533707c50 @@ -47,8 +47,8 @@ 2165 2996 1677649376035309249 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/psaux/psaux.c.o 9b8069e5249a1b7d 1503 1580 1677649374615268643 libraries/glfw-3.3.8/src/libglfw3.a fd552f215cfdce3e 1789 1840 1677649374879276194 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftgxval.c.o 3ce33c8355865f1e -2 1615 1677858451436899731 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 4b76c6f5e8fb67cf -2 1021 1677858450844883647 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa +2 1516 1677989284399853582 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 4b76c6f5e8fb67cf +2 933 1677989283815837569 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa 1 1125 1673895013688651239 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/random.cpp.o 2e94f773455f509 478 734 1677649373771244508 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/input.c.o cb7dfd07cdb7c2ab 1465 1789 1677649374827274708 libraries/BLT/CMakeFiles/BLT.dir/src/blt/nbt/nbt_block.cpp.o 18383112b14888b9 @@ -66,10 +66,10 @@ 1943 2187 1677649375223286031 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/cid/type1cid.c.o be0bd83f7173b535 2310 2626 1677649375663298611 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/sdf/sdf.c.o 38ad17921be0aede 1821 1923 1677649374963278597 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftmm.c.o cf1be7fdfe3293b -2 829 1677858450652878428 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 86aa0a8ddf11de85 +2 894 1677989283775836473 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 86aa0a8ddf11de85 1168 1300 1677649374339260750 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/osmesa_context.c.o c49ca4e889b3908b 2 95 1677649373135226320 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftwinfnt.c.o f3fe63e530ab7f66 -3 1021 1677790631988058212 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o c4b57a0cc73f7657 +2 956 1677988339805729413 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o c4b57a0cc73f7657 3521 3621 1677649376643326637 libraries/freetype-2.13.0/libfreetyped.a 3cbc64a6495debe0 2116 2355 1677649375391290833 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/pcf/pcf.c.o 310cd7429a066580 2248 2429 1677649375467293009 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/psnames/psnames.c.o 9dd17fefb41a7747 @@ -85,31 +85,45 @@ 1924 2248 1677649375287287862 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/cache/ftcache.c.o 656d9fc7811ee06 1943 2531 1677649375567295868 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/cff/cff.c.o 4c729d49aae7bc8 1169 1298 1677649374335260638 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/linux_joystick.c.o afc8940b6e7eeae1 -3 443 1677988339293715027 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o d9d07699ecf3c7f6 -2 956 1677988339805729413 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o c4b57a0cc73f7657 -2 1025 1677988339877731436 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa -2 1127 1677988339977734246 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 -2 1173 1677988340025735595 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 86aa0a8ddf11de85 -3 1335 1677988340185740090 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 6515e540120cf543 -3 1564 1677988340413746495 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o f6cc949795fe632a -1564 1661 1677988340489748630 libraries/BLT/libBLT.a b8f809e0bb7338ed -2 1794 1677988340645753013 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 4b76c6f5e8fb67cf -1794 1982 1677988340833758296 FinalProject de45775e2c99866f -3 935 1677989107651003616 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 86aa0a8ddf11de85 -2 1032 1677989107747006256 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa -3 1064 1677989107779007135 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 -3 1227 1677989107943011640 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 6515e540120cf543 -3 1604 1677989108319021968 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 4b76c6f5e8fb67cf -1604 1770 1677989108483026472 FinalProject de45775e2c99866f -2 798 1677989145404040364 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 86aa0a8ddf11de85 -2 909 1677989145516043438 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa -2 955 1677989145564044757 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 -2 1050 1677989145656047282 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 6515e540120cf543 -2 1537 1677989146144060680 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 4b76c6f5e8fb67cf -1537 1708 1677989146316065402 FinalProject de45775e2c99866f -2 894 1677989283775836473 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 86aa0a8ddf11de85 -2 933 1677989283815837569 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa -3 994 1677989283875839215 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 -3 1071 1677989283951841299 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 6515e540120cf543 -2 1516 1677989284399853582 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 4b76c6f5e8fb67cf -1516 1691 1677989284571858296 FinalProject de45775e2c99866f +3 511 1678036074955399988 CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o 9b5b6b6b3f0368f8 +3 580 1678036075023401837 CMakeFiles/FinalProject.dir/src/util/math.cpp.o 128779ce52f85025 +2 1266 1678036075707420434 CMakeFiles/FinalProject.dir/src/render/camera.cpp.o 74696c090eadc64c +512 1372 1678036075815423369 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o d9d07699ecf3c7f6 +3 1413 1678036075855424456 CMakeFiles/FinalProject.dir/src/render/window.cpp.o fe3bf24074ba9c2f +4 1438 1678036075879425109 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o c4b57a0cc73f7657 +4 1639 1678036076083430655 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o 86aa0a8ddf11de85 +3 1729 1678036076171433050 CMakeFiles/FinalProject.dir/src/render/gl.cpp.o ccad926a95c7d624 +2 1740 1678036076183433374 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa +3 1808 1678036076251435223 CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o 3f3d3a73c649dbc9 +4 1908 1678036076351437945 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o 6515e540120cf543 +4 2017 1678036076459440881 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +581 2465 1678036076907453062 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o f6cc949795fe632a +3 2481 1678036076923453496 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 4b76c6f5e8fb67cf +2465 2526 1678036076967454693 libraries/BLT/libBLT.a b8f809e0bb7338ed +2526 2720 1678036077159459912 FinalProject bac4233a8fbfb7f5 +2 615 1678036133032978649 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o c4b57a0cc73f7657 +615 798 1678036133216983650 FinalProject bac4233a8fbfb7f5 +3 350 1678037285372515234 CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o 9b5b6b6b3f0368f8 +3 692 1678037285712525039 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o c4b57a0cc73f7657 +3 1033 1678037286056534960 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa +4 1087 1678037286108536459 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +1087 1264 1678037286284541534 FinalProject bac4233a8fbfb7f5 +3 974 1678037950227242574 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa +3 982 1678037950235242795 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +982 1147 1678037950399247344 FinalProject bac4233a8fbfb7f5 +3 911 1678038081798884518 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +911 1081 1678038081966889163 FinalProject bac4233a8fbfb7f5 +3 1099 1678038250171529518 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +1099 1275 1678038250387535468 FinalProject bac4233a8fbfb7f5 +3 300 1678039231354430100 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/filesystem.cpp.o ac1bd7bf33d73c31 +3 544 1678039231598436773 libraries/BLT/CMakeFiles/BLT.dir/src/blt/nbt/nbt.cpp.o a93fa48842fb10a4 +3 1202 1678039232254454714 CMakeFiles/FinalProject.dir/src/render/gl.cpp.o ccad926a95c7d624 +3 1277 1678039232330456791 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/logging.cpp.o 13e8110c601a4029 +2 63 1678039317252778977 libraries/BLT/libBLT.a b8f809e0bb7338ed +2 928 1678039318120802711 CMakeFiles/FinalProject.dir/src/main.cpp.o aca4a00492403aa +2 994 1678039318184804462 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +994 1166 1678039318356809165 FinalProject bac4233a8fbfb7f5 +2 930 1678039419743581034 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +930 1093 1678039419903585406 FinalProject bac4233a8fbfb7f5 +3 976 1678039511814097789 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 2444998966663b23 +976 1141 1678039511974102162 FinalProject bac4233a8fbfb7f5 diff --git a/cmake-build-debug/FinalProject b/cmake-build-debug/FinalProject index 51fa0d6..e59bf41 100755 Binary files a/cmake-build-debug/FinalProject and b/cmake-build-debug/FinalProject differ diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log index f0486ac..7ef31b7 100644 --- a/cmake-build-debug/Testing/Temporary/LastTest.log +++ b/cmake-build-debug/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Mar 04 23:08 EST +Start testing: Mar 05 13:05 EST ---------------------------------------------------------- -End testing: Mar 04 23:08 EST +End testing: Mar 05 13:05 EST diff --git a/cmake-build-debug/build.ninja b/cmake-build-debug/build.ninja index c323d83..0e57dc4 100644 --- a/cmake-build-debug/build.ninja +++ b/cmake-build-debug/build.ninja @@ -98,6 +98,13 @@ build CMakeFiles/FinalProject.dir/src/render/window.cpp.o: CXX_COMPILER__FinalPr OBJECT_DIR = CMakeFiles/FinalProject.dir OBJECT_FILE_DIR = CMakeFiles/FinalProject.dir/src/render +build CMakeFiles/FinalProject.dir/src/util/math.cpp.o: CXX_COMPILER__FinalProject_Debug /home/brett/Documents/Brock/CS$ 3P98/Final$ Project/src/util/math.cpp || cmake_object_order_depends_target_FinalProject + DEP_FILE = CMakeFiles/FinalProject.dir/src/util/math.cpp.o.d + FLAGS = -fsanitize=address -g -g -fdiagnostics-color=always -fsanitize=address -std=gnu++17 + INCLUDES = -I"/home/brett/Documents/Brock/CS 3P98/Final Project/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/BLT/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/cmake-build-debug/libraries/BLT/config" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/cmake-build-debug/libraries/freetype-2.13.0/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/freetype-2.13.0/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/glfw-3.3.8/include" + OBJECT_DIR = CMakeFiles/FinalProject.dir + OBJECT_FILE_DIR = CMakeFiles/FinalProject.dir/src/util + build CMakeFiles/FinalProject.dir/src/util/settings.cpp.o: CXX_COMPILER__FinalProject_Debug /home/brett/Documents/Brock/CS$ 3P98/Final$ Project/src/util/settings.cpp || cmake_object_order_depends_target_FinalProject DEP_FILE = CMakeFiles/FinalProject.dir/src/util/settings.cpp.o.d FLAGS = -fsanitize=address -g -g -fdiagnostics-color=always -fsanitize=address -std=gnu++17 @@ -134,7 +141,7 @@ build CMakeFiles/FinalProject.dir/src/world/registry.cpp.o: CXX_COMPILER__FinalP ############################################# # Link the executable FinalProject -build FinalProject: CXX_EXECUTABLE_LINKER__FinalProject_Debug CMakeFiles/FinalProject.dir/src/main.cpp.o CMakeFiles/FinalProject.dir/src/render/camera.cpp.o CMakeFiles/FinalProject.dir/src/render/gl.cpp.o CMakeFiles/FinalProject.dir/src/render/textures.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o CMakeFiles/FinalProject.dir/src/render/window.cpp.o CMakeFiles/FinalProject.dir/src/util/settings.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o CMakeFiles/FinalProject.dir/src/world/registry.cpp.o | libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetyped.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so /usr/lib/x86_64-linux-gnu/libbrotlidec.so /usr/lib/x86_64-linux-gnu/librt.a /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libX11.so || libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetyped.a libraries/glfw-3.3.8/src/libglfw3.a +build FinalProject: CXX_EXECUTABLE_LINKER__FinalProject_Debug CMakeFiles/FinalProject.dir/src/main.cpp.o CMakeFiles/FinalProject.dir/src/render/camera.cpp.o CMakeFiles/FinalProject.dir/src/render/gl.cpp.o CMakeFiles/FinalProject.dir/src/render/textures.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o CMakeFiles/FinalProject.dir/src/render/window.cpp.o CMakeFiles/FinalProject.dir/src/util/math.cpp.o CMakeFiles/FinalProject.dir/src/util/settings.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o CMakeFiles/FinalProject.dir/src/world/registry.cpp.o | libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetyped.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so /usr/lib/x86_64-linux-gnu/libbrotlidec.so /usr/lib/x86_64-linux-gnu/librt.a /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libX11.so || libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetyped.a libraries/glfw-3.3.8/src/libglfw3.a FLAGS = -fsanitize=address -g -g LINK_FLAGS = -rdynamic -fsanitize=address LINK_LIBRARIES = libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetyped.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so -lz -lpng -lz -lpng -lharfbuzz -lbrotlidec -Wl,-Bstatic -lrt -Wl,-Bdynamic -lm -ldl -lX11 diff --git a/cmake-build-debug/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o b/cmake-build-debug/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o index 5a7573c..fdd5fd4 100644 Binary files a/cmake-build-debug/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o and b/cmake-build-debug/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o differ diff --git a/cmake-build-debug/libraries/BLT/libBLT.a b/cmake-build-debug/libraries/BLT/libBLT.a index 5873f69..3af7776 100644 Binary files a/cmake-build-debug/libraries/BLT/libBLT.a and b/cmake-build-debug/libraries/BLT/libBLT.a differ diff --git a/cmake-build-release/build.ninja b/cmake-build-release/build.ninja index c860eb8..b2d13d7 100644 --- a/cmake-build-release/build.ninja +++ b/cmake-build-release/build.ninja @@ -98,6 +98,13 @@ build CMakeFiles/FinalProject.dir/src/render/window.cpp.o: CXX_COMPILER__FinalPr OBJECT_DIR = CMakeFiles/FinalProject.dir OBJECT_FILE_DIR = CMakeFiles/FinalProject.dir/src/render +build CMakeFiles/FinalProject.dir/src/util/math.cpp.o: CXX_COMPILER__FinalProject_Release /home/brett/Documents/Brock/CS$ 3P98/Final$ Project/src/util/math.cpp || cmake_object_order_depends_target_FinalProject + DEP_FILE = CMakeFiles/FinalProject.dir/src/util/math.cpp.o.d + FLAGS = -O3 -DNDEBUG -fdiagnostics-color=always -std=gnu++17 + INCLUDES = -I"/home/brett/Documents/Brock/CS 3P98/Final Project/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/BLT/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/cmake-build-release/libraries/BLT/config" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/cmake-build-release/libraries/freetype-2.13.0/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/freetype-2.13.0/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/glfw-3.3.8/include" + OBJECT_DIR = CMakeFiles/FinalProject.dir + OBJECT_FILE_DIR = CMakeFiles/FinalProject.dir/src/util + build CMakeFiles/FinalProject.dir/src/util/settings.cpp.o: CXX_COMPILER__FinalProject_Release /home/brett/Documents/Brock/CS$ 3P98/Final$ Project/src/util/settings.cpp || cmake_object_order_depends_target_FinalProject DEP_FILE = CMakeFiles/FinalProject.dir/src/util/settings.cpp.o.d FLAGS = -O3 -DNDEBUG -fdiagnostics-color=always -std=gnu++17 @@ -134,7 +141,7 @@ build CMakeFiles/FinalProject.dir/src/world/registry.cpp.o: CXX_COMPILER__FinalP ############################################# # Link the executable FinalProject -build FinalProject: CXX_EXECUTABLE_LINKER__FinalProject_Release CMakeFiles/FinalProject.dir/src/main.cpp.o CMakeFiles/FinalProject.dir/src/render/camera.cpp.o CMakeFiles/FinalProject.dir/src/render/gl.cpp.o CMakeFiles/FinalProject.dir/src/render/textures.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o CMakeFiles/FinalProject.dir/src/render/window.cpp.o CMakeFiles/FinalProject.dir/src/util/settings.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o CMakeFiles/FinalProject.dir/src/world/registry.cpp.o | libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so /usr/lib/x86_64-linux-gnu/libbrotlidec.so /usr/lib/x86_64-linux-gnu/librt.a /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libX11.so || libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a +build FinalProject: CXX_EXECUTABLE_LINKER__FinalProject_Release CMakeFiles/FinalProject.dir/src/main.cpp.o CMakeFiles/FinalProject.dir/src/render/camera.cpp.o CMakeFiles/FinalProject.dir/src/render/gl.cpp.o CMakeFiles/FinalProject.dir/src/render/textures.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o CMakeFiles/FinalProject.dir/src/render/window.cpp.o CMakeFiles/FinalProject.dir/src/util/math.cpp.o CMakeFiles/FinalProject.dir/src/util/settings.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o CMakeFiles/FinalProject.dir/src/world/registry.cpp.o | libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so /usr/lib/x86_64-linux-gnu/libbrotlidec.so /usr/lib/x86_64-linux-gnu/librt.a /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libX11.so || libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a FLAGS = -O3 -DNDEBUG LINK_FLAGS = -rdynamic LINK_LIBRARIES = libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so -lz -lpng -lz -lpng -lharfbuzz -lbrotlidec -Wl,-Bstatic -lrt -Wl,-Bdynamic -lm -ldl -lX11 diff --git a/cmake-build-relwithdebinfo/.ninja_deps b/cmake-build-relwithdebinfo/.ninja_deps index c23be2e..edbcdcd 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 75d6555..a51b75e 100644 --- a/cmake-build-relwithdebinfo/.ninja_log +++ b/cmake-build-relwithdebinfo/.ninja_log @@ -2,16 +2,16 @@ 2323 3085 1677855183432425834 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/pfr/pfr.c.o 36ee13ce7f760ef5 3268 3715 1677855184064443416 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/type42/type42.c.o af1b1264db82aeae 3412 3495 1677855183844437295 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/builds/unix/ftsystem.c.o 827aa9e59ce2e7a7 -3 1169 1677883858339218516 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff +3 1191 1677999180799372405 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff 3085 3174 1677855183520428281 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/svg/svg.c.o dc9fa4644e4bfeff -3 1140 1677883858311217768 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +3 1207 1677999180815372847 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c 2047 2124 1677855182472399126 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftsynth.c.o c94e1df207dca05f 467 677 1677855181024358840 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/monitor.c.o 3306a3caed247cee 1945 2020 1677855182368396233 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftinit.c.o c79de44174f27a42 -7 691 1677858183417620060 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o 9999b1f01228dc1e +3 462 1677989294608133429 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o 9999b1f01228dc1e 3 697 1677858183421620170 CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o 67c82fe66fca827 1889 1929 1677855182276393672 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftfstype.c.o c1571efbcaa8f933 -3 2002 1676473110932638542 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o 3879c77c4691aa0a +3 2049 1677989296192176850 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o 3879c77c4691aa0a 1756 1820 1677855182168390667 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftbdf.c.o d55aaa7d5cd3d5c 4 1104 1677858183829631248 CMakeFiles/FinalProject.dir/src/render/window.cpp.o d3ff816bc92bb4a6 3268 4060 1677855184408452986 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/type1/type1.c.o e9ac3fb73828fd6d @@ -30,22 +30,22 @@ 203 379 1677855180728350604 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/init.c.o 7363bcb2dba2054a 2113 2153 1677855182500399904 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/bzip2/ftbzip2.c.o 7d125f3d19646cd0 2020 2085 1677855182432398012 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftpfr.c.o 565b64bbd1fc7af5 -3894 4046 1677883861215295505 FinalProject 743e0d59f44b5ac0 -959 1024 1677858183745628967 libraries/BLT/libBLT.a b8f809e0bb7338ed +989 1123 1677999316411116349 FinalProject 743e0d59f44b5ac0 +2049 2123 1677989296260178714 libraries/BLT/libBLT.a b8f809e0bb7338ed 1359 3173 1677855183520428281 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/logging.cpp.o a4d3cad66687d105 1141 1230 1677855181576374196 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/posix_thread.c.o ed8a69d447bea26a 2546 3420 1677855183768435180 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/pshinter/pshinter.c.o d1c695600d3a7dfd 1157 1382 1677855181728378425 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/glx_context.c.o 3a83b8e61a7e27f1 1052 1131 1677855181480371526 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/xkb_unicode.c.o b26e96d6509cc15d 2153 2323 1677855182672404689 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/lzw/ftlzw.c.o d04e126e5d735f8b -2 946 1677858183673627013 CMakeFiles/FinalProject.dir/src/render/camera.cpp.o 5776e342ea508518 +3 680 1677999180287358265 CMakeFiles/FinalProject.dir/src/render/camera.cpp.o 5776e342ea508518 996 1698 1677855182044387219 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/x11_window.c.o 3c77d54154e66152 2539 4386 1677855184732461998 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/psaux/psaux.c.o 2a71d88eed8a5228 1357 2539 1677855182884410587 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/loader.cpp.o dba8b361d1594e59 -2 3894 1677883861059291329 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 245d855e300d9590 +3 3841 1677991208008852927 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 245d855e300d9590 1929 1988 1677855182336395340 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftgxval.c.o d760f2ca9797735d 1698 1756 1677855182100388775 libraries/glfw-3.3.8/src/libglfw3.a fd552f215cfdce3e -2 1110 1677883858279216912 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 989 1677999316279112705 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb 379 735 1677855181084360508 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/input.c.o b9b0555d1bde647a 5617 5711 1677855186044498497 libraries/freetype-2.13.0/libfreetype.a 2cada0509b693271 1528 1889 1677855182236392559 libraries/BLT/CMakeFiles/BLT.dir/src/blt/nbt/nbt_block.cpp.o 2100792179af25a6 @@ -62,9 +62,9 @@ 2139 2545 1677855182892410810 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/cid/type1cid.c.o 23bf561e9b90dd0 2775 3535 1677855183884438408 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/sdf/sdf.c.o 807c8e056b31c5d0 1953 2106 1677855182452398568 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftmm.c.o 7b1dd129e6fb4981 -2 831 1677883858003209523 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e +3 902 1677999180511364452 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e 1199 1358 1677855181708377870 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/osmesa_context.c.o a913dd02c9ac6f97 -3 996 1677855181344367742 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o 67d0982a1f44b9dd +3 971 1677989295116147354 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o 67d0982a1f44b9dd 2088 2139 1677855182488399570 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/base/ftwinfnt.c.o 9fabacfc2ff8811a 2556 2834 1677855183180418823 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/psnames/psnames.c.o 9d8ecfaa201fc592 2319 2775 1677855183124417264 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/pcf/pcf.c.o 14518ecf856d21d0 @@ -80,31 +80,138 @@ 2119 2672 1677855183020414370 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/cache/ftcache.c.o 6a50d2c3764a714 2124 3412 1677855183760434957 libraries/freetype-2.13.0/CMakeFiles/freetype.dir/src/cff/cff.c.o 47495ad83245b5e7 1204 1349 1677855181696377535 libraries/glfw-3.3.8/src/CMakeFiles/glfw.dir/linux_joystick.c.o 3df40cb71360060f -3 462 1677989294608133429 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o 9999b1f01228dc1e -3 872 1677989295016144613 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e -3 971 1677989295116147354 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o 67d0982a1f44b9dd -3 1201 1677989295344153603 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff -3 1203 1677989295348153713 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c -2 1430 1677989295576159964 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb -3 2049 1677989296192176850 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o 3879c77c4691aa0a -2049 2123 1677989296260178714 libraries/BLT/libBLT.a b8f809e0bb7338ed -2 3804 1677989302996363361 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 245d855e300d9590 -3804 3953 1677989303148367528 FinalProject 743e0d59f44b5ac0 -3 818 1677991204992770044 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e -2 1042 1677991205212776091 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb -3 1256 1677991205428782026 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff -3 1256 1677991205428782026 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c -3 3841 1677991208008852927 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 245d855e300d9590 -3841 3990 1677991208160857104 FinalProject 743e0d59f44b5ac0 -2 1188 1677992111365563290 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e -2 1308 1677992111485566327 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb -2 1369 1677992111549567947 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff -2 1477 1677992111653570579 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c -1477 1614 1677992111793574121 FinalProject 743e0d59f44b5ac0 -2 813 1677992416661428935 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e -2 1062 1677992416909435417 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb -2 1087 1677992416937436149 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c -2 1137 1677992416985437403 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff -1137 1282 1677992417129441168 FinalProject 743e0d59f44b5ac0 -2 1062 1677992483647184263 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb -1062 1210 1677992483791188045 FinalProject 743e0d59f44b5ac0 +2 326 1677999463351171408 CMakeFiles/FinalProject.dir/src/util/math.cpp.o 74bf519fdbe61408 +2 586 1677999463611178583 CMakeFiles/FinalProject.dir/src/render/camera.cpp.o 5776e342ea508518 +2 992 1677999464015189731 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +992 1125 1677999464147193373 FinalProject 9e02455301d10951 +2 346 1677999654468443745 CMakeFiles/FinalProject.dir/src/util/math.cpp.o 74bf519fdbe61408 +2 590 1677999654712450475 CMakeFiles/FinalProject.dir/src/render/camera.cpp.o 5776e342ea508518 +2 984 1677999655104461288 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +984 1124 1677999655244465150 FinalProject 9e02455301d10951 +2 999 1677999666568777499 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +999 1134 1677999666700781139 FinalProject 9e02455301d10951 +2 992 1677999674805004668 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +992 1128 1677999674941008420 FinalProject 9e02455301d10951 +2 986 1677999751559121567 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +986 1121 1677999751691125211 FinalProject 9e02455301d10951 +2 1056 1677999803156544525 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1056 1200 1677999803300548498 FinalProject 9e02455301d10951 +2 1052 1677999847397764549 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1059 1677999847405764769 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1059 1200 1677999847545768630 FinalProject 9e02455301d10951 +2 798 1678000243116675165 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e +2 1007 1678000243324680899 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 1048 1678000243364682000 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1048 1185 1678000243500685751 FinalProject 9e02455301d10951 +2 1080 1678000383432558547 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1080 1215 1678000383564562202 FinalProject 9e02455301d10951 +3 1030 1678000427941790584 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1030 1167 1678000428077794349 FinalProject 9e02455301d10951 +3 1035 1678000453702503475 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1035 1171 1678000453834507128 FinalProject 9e02455301d10951 +3 497 1678001869021580268 CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o 67c82fe66fca827 +2 704 1678001869225585896 CMakeFiles/FinalProject.dir/src/render/camera.cpp.o 5776e342ea508518 +3 891 1678001869413591083 CMakeFiles/FinalProject.dir/src/render/window.cpp.o d3ff816bc92bb4a6 +3 1041 1678001869565595275 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e +3 1185 1678001869705599136 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o 67d0982a1f44b9dd +2 1185 1678001869705599136 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1293 1678001869813602117 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +3 1461 1678001869985606861 CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o 4bc61f357ca60822 +2 1473 1678001869993607082 CMakeFiles/FinalProject.dir/src/render/gl.cpp.o 2660a3bd1778e5e3 +3 1498 1678001870021607853 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff +3 4245 1678001872765683546 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 245d855e300d9590 +4245 4382 1678001872901687298 FinalProject 9e02455301d10951 +2 1084 1678001913922818829 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 1143 1678001913982820481 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1143 1284 1678001914122824346 FinalProject 9e02455301d10951 +5 1163 1678001963448184910 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1163 1302 1678001963584188662 FinalProject 9e02455301d10951 +3 1150 1678001986184812060 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1150 1295 1678001986328816031 FinalProject 9e02455301d10951 +2 979 1678002360003078427 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 1213 1678002360235084605 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1213 1354 1678002360379088443 FinalProject 9e02455301d10951 +3 963 1678002421972732125 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1168 1678002422176737579 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1168 1309 1678002422316741322 FinalProject 9e02455301d10951 +2 1194 1678002513891194994 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1194 1330 1678002514027198645 FinalProject 9e02455301d10951 +2 1185 1678002540423907880 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1186 1329 1678002540563911643 FinalProject 9e02455301d10951 +4 1193 1678002887201285746 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1193 1334 1678002887341289549 FinalProject 9e02455301d10951 +2 1292 1678002930794470705 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1292 1437 1678002930942474730 FinalProject 9e02455301d10951 +2 903 1678002982091866374 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 1172 1678002982359873670 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1172 1302 1678002982487877153 FinalProject 9e02455301d10951 +2 1232 1678003046149610977 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1232 1380 1678003046297615010 FinalProject 9e02455301d10951 +3 1165 1678003141536211977 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1165 1308 1678003141676215797 FinalProject 9e02455301d10951 +5 528 1678035671972415653 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o 9999b1f01228dc1e +3 1155 1678035672600432827 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1544 1678035672988443438 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +8 2111 1678035673552458861 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o 3879c77c4691aa0a +2111 2300 1678035673712463238 libraries/BLT/libBLT.a b8f809e0bb7338ed +2300 2439 1678035673880467831 FinalProject 9e02455301d10951 +2 781 1678036144893300937 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o 67d0982a1f44b9dd +781 926 1678036145037304851 FinalProject 9e02455301d10951 +2 347 1678036211511110623 CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o 67c82fe66fca827 +2 776 1678036211939122245 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o 67d0982a1f44b9dd +776 913 1678036212075125941 FinalProject 9e02455301d10951 +3 1233 1678036426324940656 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1233 1374 1678036426464944454 FinalProject 9e02455301d10951 +3 1213 1678036492830744284 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1213 1342 1678036492958747755 FinalProject 9e02455301d10951 +4 1163 1678036648706969756 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1163 1300 1678036648842973441 FinalProject 9e02455301d10951 +3 1162 1678036705604511582 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1162 1299 1678036705740515269 FinalProject 9e02455301d10951 +2 1142 1678036779122503443 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1142 1273 1678036779250506911 FinalProject 9e02455301d10951 +2 1100 1678037058578072044 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1100 1233 1678037058710075621 FinalProject 9e02455301d10951 +2 1145 1678037237731137782 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 1296 1678037237863141607 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1296 1436 1678037238019146130 FinalProject 9e02455301d10951 +2 1068 1678037259119757069 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1135 1678037259187759034 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1135 1289 1678037259339763431 FinalProject 9e02455301d10951 +2 397 1678044142498558458 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/filesystem.cpp.o 49e1226ae352c85c +3 477 1678044142578560611 libraries/BLT/CMakeFiles/BLT.dir/src/blt/nbt/nbt.cpp.o 3e0e238c32ed62ec +2 1207 1678044143310580313 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 1236 1678044143338581067 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +3 1244 1678044143346581283 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/logging.cpp.o a4d3cad66687d105 +1244 1300 1678044143402582790 libraries/BLT/libBLT.a b8f809e0bb7338ed +2 1346 1678044143446583974 CMakeFiles/FinalProject.dir/src/render/gl.cpp.o 2660a3bd1778e5e3 +1347 1498 1678044143598588065 FinalProject 9e02455301d10951 +3 884 1678044751642967363 CMakeFiles/FinalProject.dir/src/render/camera.cpp.o 5776e342ea508518 +3 1083 1678044751838972646 CMakeFiles/FinalProject.dir/src/render/window.cpp.o d3ff816bc92bb4a6 +3 1248 1678044752006977174 CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o aba7285d6d94217e +4 1567 1678044752322985689 CMakeFiles/FinalProject.dir/src/world/registry.cpp.o d042df377c55f1ff +3 1604 1678044752362986770 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +2 1614 1678044752370986986 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1727 1678044752482990004 CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o 4bc61f357ca60822 +3 1833 1678044752590992916 CMakeFiles/FinalProject.dir/src/render/gl.cpp.o 2660a3bd1778e5e3 +3 3708 1678044759579181272 CMakeFiles/FinalProject.dir/src/render/textures.cpp.o 245d855e300d9590 +3708 3850 1678044759719185045 FinalProject 9e02455301d10951 +2 1236 1678044870954183425 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +2 1283 1678044871002184718 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1283 1427 1678044871142188492 FinalProject 9e02455301d10951 +2 1252 1678044879546415046 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1252 1399 1678044879690418928 FinalProject 9e02455301d10951 +2 1091 1678044921607548918 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1209 1678044921723552045 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1209 1351 1678044921863555819 FinalProject 9e02455301d10951 +2 1111 1678045208599286533 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1341 1678045208827292682 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1341 1474 1678045208959296241 FinalProject 9e02455301d10951 +3 1228 1678045386908222629 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1228 1364 1678045387044226578 FinalProject 9e02455301d10951 +2 1312 1678045466430520596 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1312 1463 1678045466582524970 FinalProject 9e02455301d10951 +2 779 1678046595861972061 CMakeFiles/FinalProject.dir/src/util/settings.cpp.o 67d0982a1f44b9dd +4 1021 1678047258692079886 CMakeFiles/FinalProject.dir/src/main.cpp.o 1ae001c7e5feebcb +3 1204 1678047407560157339 CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o 7a550f9a4e0bfc9c +1205 1345 1678047407700161239 FinalProject 9e02455301d10951 diff --git a/cmake-build-relwithdebinfo/FinalProject b/cmake-build-relwithdebinfo/FinalProject index 28c74e1..740641c 100755 Binary files a/cmake-build-relwithdebinfo/FinalProject and b/cmake-build-relwithdebinfo/FinalProject differ diff --git a/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log b/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log index 179db0a..053c0bb 100644 --- a/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log +++ b/cmake-build-relwithdebinfo/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Mar 05 00:01 EST +Start testing: Mar 05 15:16 EST ---------------------------------------------------------- -End testing: Mar 05 00:01 EST +End testing: Mar 05 15:16 EST diff --git a/cmake-build-relwithdebinfo/build.ninja b/cmake-build-relwithdebinfo/build.ninja index 3464a0c..ab7dd42 100644 --- a/cmake-build-relwithdebinfo/build.ninja +++ b/cmake-build-relwithdebinfo/build.ninja @@ -98,6 +98,13 @@ build CMakeFiles/FinalProject.dir/src/render/window.cpp.o: CXX_COMPILER__FinalPr OBJECT_DIR = CMakeFiles/FinalProject.dir OBJECT_FILE_DIR = CMakeFiles/FinalProject.dir/src/render +build CMakeFiles/FinalProject.dir/src/util/math.cpp.o: CXX_COMPILER__FinalProject_RelWithDebInfo /home/brett/Documents/Brock/CS$ 3P98/Final$ Project/src/util/math.cpp || cmake_object_order_depends_target_FinalProject + DEP_FILE = CMakeFiles/FinalProject.dir/src/util/math.cpp.o.d + FLAGS = -O2 -g -DNDEBUG -fdiagnostics-color=always -std=gnu++17 + INCLUDES = -I"/home/brett/Documents/Brock/CS 3P98/Final Project/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/BLT/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/cmake-build-relwithdebinfo/libraries/BLT/config" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/cmake-build-relwithdebinfo/libraries/freetype-2.13.0/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/freetype-2.13.0/include" -I"/home/brett/Documents/Brock/CS 3P98/Final Project/libraries/glfw-3.3.8/include" + OBJECT_DIR = CMakeFiles/FinalProject.dir + OBJECT_FILE_DIR = CMakeFiles/FinalProject.dir/src/util + build CMakeFiles/FinalProject.dir/src/util/settings.cpp.o: CXX_COMPILER__FinalProject_RelWithDebInfo /home/brett/Documents/Brock/CS$ 3P98/Final$ Project/src/util/settings.cpp || cmake_object_order_depends_target_FinalProject DEP_FILE = CMakeFiles/FinalProject.dir/src/util/settings.cpp.o.d FLAGS = -O2 -g -DNDEBUG -fdiagnostics-color=always -std=gnu++17 @@ -134,7 +141,7 @@ build CMakeFiles/FinalProject.dir/src/world/registry.cpp.o: CXX_COMPILER__FinalP ############################################# # Link the executable FinalProject -build FinalProject: CXX_EXECUTABLE_LINKER__FinalProject_RelWithDebInfo CMakeFiles/FinalProject.dir/src/main.cpp.o CMakeFiles/FinalProject.dir/src/render/camera.cpp.o CMakeFiles/FinalProject.dir/src/render/gl.cpp.o CMakeFiles/FinalProject.dir/src/render/textures.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o CMakeFiles/FinalProject.dir/src/render/window.cpp.o CMakeFiles/FinalProject.dir/src/util/settings.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o CMakeFiles/FinalProject.dir/src/world/registry.cpp.o | libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so /usr/lib/x86_64-linux-gnu/libbrotlidec.so /usr/lib/x86_64-linux-gnu/librt.a /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libX11.so || libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a +build FinalProject: CXX_EXECUTABLE_LINKER__FinalProject_RelWithDebInfo CMakeFiles/FinalProject.dir/src/main.cpp.o CMakeFiles/FinalProject.dir/src/render/camera.cpp.o CMakeFiles/FinalProject.dir/src/render/gl.cpp.o CMakeFiles/FinalProject.dir/src/render/textures.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/debug.cpp.o CMakeFiles/FinalProject.dir/src/render/ui/text.cpp.o CMakeFiles/FinalProject.dir/src/render/window.cpp.o CMakeFiles/FinalProject.dir/src/util/math.cpp.o CMakeFiles/FinalProject.dir/src/util/settings.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/storage.cpp.o CMakeFiles/FinalProject.dir/src/world/chunk/world.cpp.o CMakeFiles/FinalProject.dir/src/world/registry.cpp.o | libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so /usr/lib/x86_64-linux-gnu/libbrotlidec.so /usr/lib/x86_64-linux-gnu/librt.a /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libX11.so || libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a FLAGS = -O2 -g -DNDEBUG LINK_FLAGS = -rdynamic LINK_LIBRARIES = libraries/BLT/libBLT.a libraries/freetype-2.13.0/libfreetype.a libraries/glfw-3.3.8/src/libglfw3.a /usr/lib/x86_64-linux-gnu/libz.so -lz -lpng -lz -lpng -lharfbuzz -lbrotlidec -Wl,-Bstatic -lrt -Wl,-Bdynamic -lm -ldl -lX11 diff --git a/cmake-build-relwithdebinfo/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o b/cmake-build-relwithdebinfo/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o index ea66b8b..0a0c07c 100644 Binary files a/cmake-build-relwithdebinfo/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o and b/cmake-build-relwithdebinfo/libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o differ diff --git a/cmake-build-relwithdebinfo/libraries/BLT/libBLT.a b/cmake-build-relwithdebinfo/libraries/BLT/libBLT.a index dcd2884..2611b03 100644 Binary files a/cmake-build-relwithdebinfo/libraries/BLT/libBLT.a and b/cmake-build-relwithdebinfo/libraries/BLT/libBLT.a differ diff --git a/include/render/camera.h b/include/render/camera.h index bec9a92..77ee523 100644 --- a/include/render/camera.h +++ b/include/render/camera.h @@ -11,6 +11,8 @@ namespace fp::camera { void update(); + const blt::vec3& getPosition(); + const blt::vec3& getRotation(); } #endif //FINALPROJECT_CAMERA_H diff --git a/include/render/gl.h b/include/render/gl.h index 666c828..0e9d9ba 100644 --- a/include/render/gl.h +++ b/include/render/gl.h @@ -32,12 +32,11 @@ namespace fp { struct VBO { GLuint vboID = 0; - void* data = nullptr; int size = 0; vbo_type type = ARRAY_BUFFER; vbo_mem_type mem_type = STATIC; - VBO(vbo_type type, void* data, int size, vbo_mem_type mem_type = STATIC): type(type), data(data), size(size), mem_type(mem_type) { + VBO(vbo_type type, void* data, int size, vbo_mem_type mem_type = STATIC): type(type), size(size), mem_type(mem_type) { glGenBuffers(1, &vboID); bind(); glBufferData(type, size, data, mem_type); @@ -55,13 +54,12 @@ namespace fp { inline void update(void* new_data, int data_size) { bind(); // optimization technique is to not reallocate the memory on the GPU if the new buffer size is not larger than our current buffer - if (data_size <= size){ + //if (data_size <= size){ // we can do this as long as we overwrite from the beginning. Since the new draw call will only use of to size of the allocated buffer // to do all its drawing, the extra space unused can be ignored and saved for future use. - glBufferSubData(type, 0, data_size, new_data); - } else + // glBufferSubData(type, 0, data_size, new_data); + //} else glBufferData(type, data_size, new_data, mem_type); - data = new_data; size = data_size; glBindBuffer(type, 0); } diff --git a/include/render/window.h b/include/render/window.h index d1334e4..d0f3aa5 100644 --- a/include/render/window.h +++ b/include/render/window.h @@ -56,6 +56,8 @@ namespace fp::window { double getFrameDelta(); // nanoseconds long getFrameDeltaRaw(); + // nanoseconds, from current time not last frame + long getCurrentDelta(); const blt::mat4x4& getPerspectiveMatrix(); diff --git a/include/shaders/chunk.vert b/include/shaders/chunk.vert index 794183b..1c5d903 100644 --- a/include/shaders/chunk.vert +++ b/include/shaders/chunk.vert @@ -5,8 +5,7 @@ precision mediump float; layout (location = 0) in vec3 vertex; -layout (location = 1) in vec2 texture_coord; -layout (location = 2) in float texture_index; +layout (location = 1) in vec3 texture_coord; out vec2 uv; out float index; @@ -24,9 +23,9 @@ layout (std140) uniform StandardMatrices }; void main() { - index = texture_index; + index = texture_coord.z; gl_Position = projection * view * translation * vec4(vertex.x, vertex.y, vertex.z, 1.0); - uv = texture_coord; + uv = texture_coord.xy; } ")"; diff --git a/include/util/math.h b/include/util/math.h index b00445d..bef6f7a 100644 --- a/include/util/math.h +++ b/include/util/math.h @@ -8,6 +8,9 @@ #define FINALPROJECT_MATH_H #include +#include +#include +#include static inline float degreesToRadian(float deg) { return deg * (float)M_PI / 180.0f; diff --git a/include/world/chunk/storage.h b/include/world/chunk/storage.h index 818a0ff..c025f51 100644 --- a/include/world/chunk/storage.h +++ b/include/world/chunk/storage.h @@ -36,13 +36,11 @@ namespace fp { return blocks[pos.z * CHUNK_SIZE * CHUNK_SIZE + pos.y * CHUNK_SIZE + pos.x]; } - [[nodiscard]] inline block_type getBounded(bool& outside, const block_pos& pos) const { + [[nodiscard]] inline bool checkBlockVisibility(const block_pos& pos) const { if (pos.x < 0 || pos.x >= CHUNK_SIZE || pos.y < 0 || pos.y >= CHUNK_SIZE || pos.z < 0 || pos.z >= CHUNK_SIZE) { - outside = true; - return fp::registry::AIR; + return false; } - outside = false; - return get(pos); + return fp::registry::get(get(pos)).visibility <= fp::registry::TRANSPARENT_TEXTURE; } inline void set(const block_pos& pos, block_type blockID) { diff --git a/include/world/chunk/world.h b/include/world/chunk/world.h index 35302aa..a76f3f8 100644 --- a/include/world/chunk/world.h +++ b/include/world/chunk/world.h @@ -10,6 +10,7 @@ #include #include #include +#include "blt/profiling/profiler.h" namespace fp { @@ -64,7 +65,7 @@ namespace fp { } struct chunk { - public: + private: block_storage* storage; mesh_storage* mesh = nullptr; VAO* chunk_vao; @@ -77,22 +78,109 @@ namespace fp { explicit chunk(chunk_pos pos): pos(pos) { storage = new block_storage(); chunk_vao = new VAO(); - // using indices uses: - // 12 faces * 4 vertex * 3 float * 4 bytes + 12 faces * 6 indices * 4 bytes = 864 bytes for vertex + index - - // using only vertices: - // 12 faces * 6 vertex * 3 floats * 4 bytes = 864 bytes. - - // since they both use the same amount of memory we will only store the vertices and draw with drawArrays, since it is less complex. - // set up the VBOs which will be later updated when the mesh is generated. auto vbo = new VBO(ARRAY_BUFFER, nullptr, 0); - auto data_size = 3 * sizeof(float) + 2 * sizeof(float) + 1 * sizeof(float); + auto data_size = 3 * sizeof(float) + 3 * sizeof(float); chunk_vao->bindVBO(vbo, 0, 3, GL_FLOAT, (int)data_size, 0); - chunk_vao->bindVBO(vbo, 1, 2, GL_FLOAT, (int)data_size, 3 * sizeof(float), true); - chunk_vao->bindVBO(vbo, 2, 1, GL_FLOAT, (int)data_size, 3 * sizeof(float) + 2 * sizeof(float), true); + chunk_vao->bindVBO(vbo, 1, 3, GL_FLOAT, (int)data_size, 3 * sizeof(float), true); chunk_vao->bindElementVBO(new VBO(ELEMENT_BUFFER, nullptr, 0)); } + inline void render(shader& shader){ + if (render_size > 0) { + blt::mat4x4 translation{}; + translation.translate((float) pos.x * CHUNK_SIZE, + (float) pos.y * CHUNK_SIZE, + (float) pos.z * CHUNK_SIZE + ); + shader.setMatrix("translation", translation); + // bind the chunk's VAO + chunk_vao->bind(); + // despite binding the element buffer at creation time, this is required. + chunk_vao->getVBO(-1)->bind(); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + glEnableVertexAttribArray(2); + glDrawElements(GL_TRIANGLES, (int) render_size, GL_UNSIGNED_INT, nullptr); + glDisableVertexAttribArray(2); + glDisableVertexAttribArray(1); + glDisableVertexAttribArray(0); + } + } + + inline void updateChunkMesh(){ + auto& vertices = mesh->getVertices(); + auto& indices = mesh->getIndices(); + + BLT_DEBUG( + "Chunk [%d, %d, %d] mesh updated with %d vertices and %d indices taking (%d, %d) bytes!", + pos.x, pos.y, pos.z, + vertices.size(), indices.size(), vertices.size() * sizeof(vertex), + indices.size() * sizeof(unsigned int)); + + // upload the new vertices to the GPU + chunk_vao->getVBO(0)->update(vertices); + chunk_vao->getVBO(-1)->update(indices); + render_size = indices.size(); + + // delete the local chunk mesh memory, since we no longer need to store it. + delete (mesh); + mesh = nullptr; + markDone(); + } + + /** + * Mark the chunk as completely dirty and in need of a full check refresh + */ + inline void markDirty(){ + dirtiness = FULL_MESH; + } + + /** + * Partial mesh update has been completed, we are now waiting on the edge chunks to be + * generated before continuing to generate the chunk edge mesh + */ + inline void markPartialComplete() { + dirtiness = PARTIAL_MESH; + } + + /** + * Full chunk mesh is now completely generated and waiting on uploading to the GPU + */ + inline void markComplete(){ + dirtiness = REFRESH; + } + + /** + * Mesh uploading complete, chunk meshing is now done and inactive + */ + inline void markDone(){ + dirtiness = OKAY; + } + + [[nodiscard]] inline block_storage*& getBlockStorage() { + return storage; + } + + [[nodiscard]] inline mesh_storage*& getMeshStorage(){ + return mesh; + } + + [[nodiscard]] inline VAO*& getVAO(){ + return chunk_vao; + } + + [[nodiscard]] inline chunk_pos getPos() const { + return pos; + } + + [[nodiscard]] inline chunk_mesh_status getDirtiness() const { + return dirtiness; + } + + [[nodiscard]] inline chunk_update_status& getStatus() { + return status; + } + ~chunk() { delete storage; delete chunk_vao; @@ -118,6 +206,8 @@ namespace fp { void generateChunkMesh(chunk* chunk); + static chunk* generateChunk(const chunk_pos& pos); + inline void getNeighbours(const chunk_pos& pos, chunk_neighbours& neighbours) { neighbours[X_POS] = getChunk(chunk_pos{pos.x + 1, pos.y, pos.z}); neighbours[X_NEG] = getChunk(chunk_pos{pos.x - 1, pos.y, pos.z}); @@ -128,14 +218,14 @@ namespace fp { } inline void insertChunk(chunk* chunk) { - chunk_storage.insert({chunk->pos, chunk}); + chunk_storage.insert({chunk->getPos(), chunk}); chunk_neighbours chunkNeighbours{}; - getNeighbours(chunk->pos, chunkNeighbours); + getNeighbours(chunk->getPos(), chunkNeighbours); for (auto* p : chunkNeighbours.neighbours){ if (p) - p->status = NEIGHBOUR_CREATE; + p->getStatus() = NEIGHBOUR_CREATE; } } @@ -147,20 +237,11 @@ namespace fp { } inline chunk* getChunk(const block_pos& pos) { - return chunk_storage.at(_static::world_to_chunk(pos)); + return chunk_storage[_static::world_to_chunk(pos)]; } public: - world() { - insertChunk(new chunk({0, 0, 0})); - insertChunk(new chunk({0, 1, 0})); - insertChunk(new chunk({0, -1, 0})); - insertChunk(new chunk({1, 0, 0})); - insertChunk(new chunk({0, 0, 1})); - insertChunk(new chunk({-1, 0, 0})); - insertChunk(new chunk({0, 0, -1})); - insertChunk(new chunk({-1, 0, -1})); - } + world() = default; void update(); @@ -171,8 +252,8 @@ namespace fp { if (!c) return false; // mark the chunk for a mesh update - c->dirtiness = FULL_MESH; - c->storage->set(_static::world_to_internal(pos), blockID); + c->markDirty(); + c->getBlockStorage()->set(_static::world_to_internal(pos), blockID); return true; } @@ -180,10 +261,12 @@ namespace fp { auto c = getChunk(pos); if (!c) return fp::registry::AIR; - return c->storage->get(_static::world_to_internal(pos)); + return c->getBlockStorage()->get(_static::world_to_internal(pos)); } ~world() { + BLT_PRINT_PROFILE("Chunk Mesh", blt::logging::TRACE, true); + BLT_PRINT_PROFILE("Chunk Generate", blt::logging::TRACE, true); for (auto& chunk : chunk_storage) delete (chunk.second); } diff --git a/include/world/registry.h b/include/world/registry.h index 89c8bef..864af43 100644 --- a/include/world/registry.h +++ b/include/world/registry.h @@ -47,22 +47,28 @@ namespace fp::registry { constexpr block_type GRASS = 4; void registerBlock(block_type id, block_properties properties); + void registerTexture(texture::file_texture* texture); void textureInit(); + void setupTextureLoaderThreads(int count = 8); + void generateTexturePalette(); + void cleanup(); block_properties& get(block_type id); + unsigned int getTextureID(); + texture::texture_index getTextureIndex(const std::string& name); /** * Registers all the default blocks used by the engine */ - inline void registerDefaultBlocks(){ + inline void registerDefaultBlocks() { registerBlock(AIR, {TRANSPARENT}); registerBlock(STONE, {OPAQUE, "Stone"}); registerBlock(DIRT, {OPAQUE, "Dolph"}); @@ -79,7 +85,7 @@ namespace fp::registry { registerTexture(new texture::file_texture{"assets/textures/1603422678312.jpg", "Loser"}); registerTexture(new texture::file_texture{"assets/textures/1592244663459.png", "Frog"}); registerTexture(new texture::file_texture{"assets/textures/1592234267606.png", "Explode"}); - + setupTextureLoaderThreads(); generateTexturePalette(); } diff --git a/libraries/BLT b/libraries/BLT index bd89abb..063a679 160000 --- a/libraries/BLT +++ b/libraries/BLT @@ -1 +1 @@ -Subproject commit bd89abb2f3da1e04d8fae667db2866675ae2280c +Subproject commit 063a67927811339f70f4664c1a32dfeed0b6e9a2 diff --git a/src/main.cpp b/src/main.cpp index 9789a00..b0fb8a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,6 +11,7 @@ #include "render/camera.h" #include "world/chunk/world.h" #include "util/settings.h" +#include #ifdef __EMSCRIPTEN__ @@ -56,25 +57,19 @@ int main() { chunk_shader = new fp::shader(shader_chunk_vert, shader_chunk_frag); world = new fp::world(); - //world->setBlock({0,0,0}, 1); + world->setBlock({0,0,0}, fp::registry::STONE); - for (int i = 1; i < CHUNK_SIZE; i++) - for (int j = 0; j < 2; j++) - for (int k = 5; k < CHUNK_SIZE; k++) - world->setBlock({i,j,k}, fp::registry::STONE); - - for (int i = 1; i < CHUNK_SIZE; i++) - for (int j = 10; j < 15; j++) - for (int k = 5; k < CHUNK_SIZE; k++) - world->setBlock({i,j,k}, fp::registry::DIRT); - - for (int i = 1; i < CHUNK_SIZE; i++) - for (int j = 24; j < 26; j++) - for (int k = 5; k < CHUNK_SIZE; k++) - world->setBlock({i,j,k}, fp::registry::COBBLE); - world->setBlock({-2, 2, 2}, 1); - world->setBlock({-2, 2, -2}, 1); - world->setBlock({2, 2, -2}, 1); + for (int i = 0; i < CHUNK_SIZE; i++) { + for (int j = 0; j < CHUNK_SIZE; j++) { + for (int k = 0; k < CHUNK_SIZE; k++) { + world->setBlock({i, j, k}, (int)(stb_perlin_fbm_noise3(i / 8.0, j / 8.0, k / 8.0, 2.0, 0.5, 6) > 0.5 ? fp::registry::STONE : fp::registry::AIR)); + } + } + } + world->setBlock({-2, 2, 2}, fp::registry::STONE); + world->setBlock({-2, 2, -2}, fp::registry::STONE); + world->setBlock({-5, 6, -5}, fp::registry::COBBLE); + world->setBlock({2, 2, -2}, fp::registry::STONE); glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); @@ -92,8 +87,6 @@ int main() { while(!fp::window::isCloseRequested()) loop(); #endif - - BLT_PRINT_PROFILE("Chunk Generator", blt::logging::TRACE, true); delete(chunk_shader); delete(world); diff --git a/src/render/camera.cpp b/src/render/camera.cpp index e4a7b8f..af11e0b 100644 --- a/src/render/camera.cpp +++ b/src/render/camera.cpp @@ -128,3 +128,11 @@ void fp::camera::update() { updateViewMatrix(); } + +const blt::vec3& fp::camera::getPosition() { + return position; +} + +const blt::vec3& fp::camera::getRotation() { + return rotation; +} diff --git a/src/render/ui/debug.cpp b/src/render/ui/debug.cpp index d83954a..3c18a21 100644 --- a/src/render/ui/debug.cpp +++ b/src/render/ui/debug.cpp @@ -14,7 +14,7 @@ namespace fp::debug { bool enabled = false; // Yes. I made this only for this. - blt::averagizer_o_matic fps_average{60.0}; + blt::averagizer_o_matic fps_average{60.0}; void drawAndIncrement(const std::string& text, float x, float& pos, text::font_size size = fp::text::FONT_14) { auto text_size = fp::text::getTextSize(text, size); diff --git a/src/render/window.cpp b/src/render/window.cpp index b9743b6..2f0caf6 100644 --- a/src/render/window.cpp +++ b/src/render/window.cpp @@ -234,3 +234,8 @@ float fp::window::mouseDX() { float fp::window::mouseDY() { return (float)mouse_dy; } + +long fp::window::getCurrentDelta() { + long currentFrame = blt::system::getCurrentTimeNanoseconds(); + return currentFrame - lastFrame; +} diff --git a/src/util/math.cpp b/src/util/math.cpp new file mode 100644 index 0000000..3d3639f --- /dev/null +++ b/src/util/math.cpp @@ -0,0 +1,8 @@ +/* + * Created by Brett on 05/03/23. + * Licensed under GNU General Public License V3.0 + * See LICENSE file for license detail + */ +// purely for the implementation +#define STB_PERLIN_IMPLEMENTATION +#include diff --git a/src/util/settings.cpp b/src/util/settings.cpp index 8d64eef..4ffce91 100644 --- a/src/util/settings.cpp +++ b/src/util/settings.cpp @@ -14,6 +14,8 @@ std::unordered_map properties; // will be overwritten if the file has something different. void write_default_values(){ properties["TEXTURE_SIZE"] = std::to_string(128); + properties["FPS"] = std::to_string(60); + properties["VIEW_DISTANCE"] = std::to_string(12); } void fp::settings::load(const std::string& file) { @@ -24,10 +26,13 @@ void fp::settings::load(const std::string& file) { try { auto lines = blt::fs::getLinesFromFile(file); for (const auto& line : lines) { + // don't try to load empty lines + if (line.empty()) + continue; auto split_line = blt::string::split(line, "="); if (split_line.size() < 2) { - BLT_WARN("Unable to load line '%s' due to incomplete property (property = value)"); + BLT_WARN("Unable to load line '%s' due to incomplete property (property = value)", line.c_str()); continue; } diff --git a/src/world/chunk/world.cpp b/src/world/chunk/world.cpp index 4c543ec..9a3c87c 100644 --- a/src/world/chunk/world.cpp +++ b/src/world/chunk/world.cpp @@ -5,60 +5,70 @@ */ #include #include +#include +#include +#include +#include "stb/stb_perlin.h" void fp::world::generateFullMesh(mesh_storage* mesh, fp::chunk* chunk) { - BLT_START_INTERVAL("Chunk Generator", "Full Mesh"); + BLT_START_INTERVAL("Chunk Mesh", "Full Mesh"); // checks to outside the bounds of the chunk should not have faces added. this will be handled by the partial mesh! bool outside = false; for (int i = 0; i < CHUNK_SIZE; i++) { for (int j = 0; j < CHUNK_SIZE; j++) { for (int k = 0; k < CHUNK_SIZE; k++) { - auto& block = fp::registry::get(chunk->storage->get({i, j, k})); + auto*& storage = chunk->getBlockStorage(); + + auto& block = fp::registry::get(storage->get({i, j, k})); + auto texture_index = fp::registry::getTextureIndex(block.textureName); + // The main chunk mesh can handle opaque and transparent textures. (Transparency will be discarded) if (block.visibility <= registry::TRANSPARENT_TEXTURE) { - if (fp::registry::get(chunk->storage->getBounded(outside, {i - 1, j, k})).visibility && !outside) + if (!storage->checkBlockVisibility({i - 1, j, k})) mesh->addFace(X_NEG, {i, j, k}, texture_index); - if (fp::registry::get(chunk->storage->getBounded(outside, {i + 1, j, k})).visibility && !outside) + if (!storage->checkBlockVisibility({i + 1, j, k})) mesh->addFace(X_POS, {i, j, k}, texture_index); - if (fp::registry::get(chunk->storage->getBounded(outside, {i, j - 1, k})).visibility && !outside) + if (!storage->checkBlockVisibility({i, j - 1, k})) mesh->addFace(Y_NEG, {i, j, k}, texture_index); - if (fp::registry::get(chunk->storage->getBounded(outside, {i, j + 1, k})).visibility && !outside) + if (!storage->checkBlockVisibility({i, j + 1, k})) mesh->addFace(Y_POS, {i, j, k}, texture_index); - if (fp::registry::get(chunk->storage->getBounded(outside, {i, j, k - 1})).visibility && !outside) + if (!storage->checkBlockVisibility({i, j, k - 1})) mesh->addFace(Z_NEG, {i, j, k}, texture_index); - if (fp::registry::get(chunk->storage->getBounded(outside, {i, j, k + 1})).visibility && !outside) + if (!storage->checkBlockVisibility({i, j, k + 1})) mesh->addFace(Z_POS, {i, j, k}, texture_index); } } } } - chunk->dirtiness = PARTIAL_MESH; - BLT_END_INTERVAL("Chunk Generator", "Full Mesh"); + chunk->markPartialComplete(); + BLT_END_INTERVAL("Chunk Mesh", "Full Mesh"); } inline void checkEdgeFaces( - fp::mesh_storage* mesh, fp::chunk* chunk, fp::chunk* neighbour, fp::face face, const fp::block_pos& pos, const fp::block_pos& neighbour_pos + fp::mesh_storage* mesh, fp::chunk* chunk, fp::chunk* neighbour, fp::face face, + const fp::block_pos& pos, const fp::block_pos& neighbour_pos ) { - auto& block = fp::registry::get(chunk->storage->get(pos)); + auto*& storage = chunk->getBlockStorage(); + auto& block = fp::registry::get(storage->get(pos)); auto texture_index = fp::registry::getTextureIndex(block.textureName); if (block.visibility <= fp::registry::TRANSPARENT_TEXTURE) { - if (fp::registry::get(neighbour->storage->get(neighbour_pos)).visibility) + if (fp::registry::get(storage->get(neighbour_pos)).visibility) mesh->addFace(face, pos, texture_index); } } void fp::world::generateEdgeMesh(mesh_storage* mesh, fp::chunk* chunk) { - BLT_START_INTERVAL("Chunk Generator", "Edge Mesh"); + BLT_START_INTERVAL("Chunk Mesh", "Edge Mesh"); // don't try to regen the chunk mesh unless there is a chance all neighbours are not null - if (chunk->status != chunk_update_status::NEIGHBOUR_CREATE) + if (chunk->getStatus() != chunk_update_status::NEIGHBOUR_CREATE) return; chunk_neighbours neighbours{}; - getNeighbours(chunk->pos, neighbours); + getNeighbours(chunk->getPos(), neighbours); // if none of the neighbours exist we cannot continue! @@ -69,36 +79,61 @@ void fp::world::generateEdgeMesh(mesh_storage* mesh, fp::chunk* chunk) { for (int i = 0; i < CHUNK_SIZE; i++) { for (int j = 0; j < CHUNK_SIZE; j++) { - checkEdgeFaces(mesh, chunk, neighbours[X_NEG], X_NEG, {0, i, j}, {CHUNK_SIZE - 1, i, j}); - checkEdgeFaces(mesh, chunk, neighbours[X_POS], X_POS, {CHUNK_SIZE-1, i, j}, {0, i, j}); - - checkEdgeFaces(mesh, chunk, neighbours[Y_NEG], Y_NEG, {i, 0, j}, {i, CHUNK_SIZE - 1, j}); - checkEdgeFaces(mesh, chunk, neighbours[Y_POS], Y_POS, {i, CHUNK_SIZE-1, j}, {i, 0, j}); - - checkEdgeFaces(mesh, chunk, neighbours[Z_NEG], Z_NEG, {i, j, 0}, {i, j, CHUNK_SIZE - 1}); - checkEdgeFaces(mesh, chunk, neighbours[Z_POS], Z_POS, {i, j, CHUNK_SIZE-1}, {i, j, 0}); + checkEdgeFaces( + mesh, chunk, neighbours[X_NEG], X_NEG, {0, i, j}, {CHUNK_SIZE - 1, i, j} + ); + checkEdgeFaces( + mesh, chunk, neighbours[X_POS], X_POS, {CHUNK_SIZE - 1, i, j}, {0, i, j} + ); + + checkEdgeFaces( + mesh, chunk, neighbours[Y_NEG], Y_NEG, {i, 0, j}, {i, CHUNK_SIZE - 1, j} + ); + checkEdgeFaces( + mesh, chunk, neighbours[Y_POS], Y_POS, {i, CHUNK_SIZE - 1, j}, {i, 0, j} + ); + + checkEdgeFaces( + mesh, chunk, neighbours[Z_NEG], Z_NEG, {i, j, 0}, {i, j, CHUNK_SIZE - 1} + ); + checkEdgeFaces( + mesh, chunk, neighbours[Z_POS], Z_POS, {i, j, CHUNK_SIZE - 1}, {i, j, 0} + ); } } - chunk->status = NONE; - chunk->dirtiness = REFRESH; - BLT_END_INTERVAL("Chunk Generator", "Edge Mesh"); + chunk->getStatus() = NONE; + chunk->markComplete(); + BLT_END_INTERVAL("Chunk Mesh", "Edge Mesh"); } void fp::world::generateChunkMesh(fp::chunk* chunk) { - if (chunk->mesh == nullptr) - chunk->mesh = new mesh_storage; + if (chunk->getMeshStorage() == nullptr) + chunk->getMeshStorage() = new mesh_storage; - if (chunk->dirtiness == FULL_MESH) { // full chunk mesh - generateFullMesh(chunk->mesh, chunk); + if (chunk->getDirtiness() == FULL_MESH) { // full chunk mesh + generateFullMesh(chunk->getMeshStorage(), chunk); } - if (chunk->dirtiness == PARTIAL_MESH) { // partial chunk mesh (had null neighbours) - generateEdgeMesh(chunk->mesh, chunk); + if (chunk->getDirtiness() == PARTIAL_MESH) { // partial chunk mesh (had null neighbours) + generateEdgeMesh(chunk->getMeshStorage(), chunk); } } -void fp::world::update() { +std::queue chunks_to_generate{}; +void fp::world::update() { + auto target_delta = 1000000000 / std::stoi(fp::settings::get("FPS")); + + while (fp::window::getCurrentDelta() < target_delta) { + if (chunks_to_generate.empty()) + break; + const auto& front = chunks_to_generate.front(); + + insertChunk(generateChunk(front)); + + chunks_to_generate.pop(); + } + } void fp::world::render(fp::shader& shader) { @@ -107,48 +142,67 @@ void fp::world::render(fp::shader& shader) { glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D_ARRAY, fp::registry::getTextureID()); - for (const auto& chunk_pair : chunk_storage) { - auto chunk = chunk_pair.second; - - if (chunk == nullptr) - continue; - - if (chunk->dirtiness > REFRESH) { - BLT_START_INTERVAL("Chunk Generator", "Mesh"); - generateChunkMesh(chunk); - BLT_END_INTERVAL("Chunk Generator", "Mesh"); - } - - if (chunk->dirtiness == REFRESH) { - auto& vertices = chunk->mesh->getVertices(); - auto& indices = chunk->mesh->getIndices(); - - // 11436 vert, 137,232 bytes - // 1908 vert, 11436 indices, 22896 + 45744 = 68,640 bytes - - BLT_DEBUG("Chunk [%d, %d, %d] mesh updated with %d vertices and %d indices taking (%d, %d) bytes!", - chunk->pos.x, chunk->pos.y, chunk->pos.z, - vertices.size(), indices.size(), vertices.size() * sizeof(vertex), indices.size() * sizeof(unsigned int)); - - // upload the new vertices to the GPU - chunk->chunk_vao->getVBO(0)->update(vertices); - chunk->chunk_vao->getVBO(-1)->update(indices); - chunk->render_size = indices.size(); - - // delete the memory from the CPU. - delete (chunk->mesh); - chunk->mesh = nullptr; - chunk->dirtiness = OKAY; - } - - if (chunk->render_size > 0) { - blt::mat4x4 translation{}; - translation.translate((float) chunk->pos.x * CHUNK_SIZE, (float) chunk->pos.y * CHUNK_SIZE, (float) chunk->pos.z * CHUNK_SIZE); - shader.setMatrix("translation", translation); - chunk->chunk_vao->bind(); - glEnableVertexAttribArray(0); - glDrawElements(GL_TRIANGLES, (int)chunk->render_size, GL_UNSIGNED_INT, nullptr); - glDisableVertexAttribArray(0); + auto view_distance = std::stoi(fp::settings::get("VIEW_DISTANCE")) / 2; + + for (int i = -view_distance; i <= view_distance; i++) { + for (int j = -view_distance; j <= view_distance; j++) { + for (int k = -view_distance; k <= view_distance; k++) { + // get the chunks around the player's camera + const auto& pos = fp::camera::getPosition(); + int x = (int) pos.x(); + int y = (int) pos.y(); + int z = (int) pos.z(); + auto camera_chunk_pos = fp::_static::world_to_chunk({x, y, z}); + auto adjusted_chunk_pos = chunk_pos{camera_chunk_pos.x + i, // chunk x + camera_chunk_pos.y + j, // chunk y + camera_chunk_pos.z + k}; // chunk z + // generate chunk if it doesn't exist + auto* chunk = this->getChunk(adjusted_chunk_pos); + if (!chunk) { + chunks_to_generate.push(adjusted_chunk_pos); + continue; + } + + // check for mesh updates + if (chunk->getDirtiness() > REFRESH) { + BLT_START_INTERVAL("Chunk Mesh", "Mesh"); + generateChunkMesh(chunk); + BLT_END_INTERVAL("Chunk Mesh", "Mesh"); + } else if (chunk->getDirtiness() == REFRESH) { + // 11436 vert, 137,232 bytes + // 1908 vert, 11436 indices, 22896 + 45744 = 68,640 bytes + chunk->updateChunkMesh(); + } + + chunk->render(shader); + } } } } + +fp::chunk* fp::world::generateChunk(const fp::chunk_pos& pos) { + BLT_START_INTERVAL("Chunk Generate", "Instantiate"); + auto* c = new chunk(pos); + block_storage*& storage = c->getBlockStorage(); + + for (int i = 0; i < CHUNK_SIZE; i++) { + for (int j = 0; j < CHUNK_SIZE; j++) { + for (int k = 0; k < CHUNK_SIZE; k++) { + auto block_x = pos.x + i; + auto block_y = pos.y + j; + auto block_z = pos.z + k; + storage->set( + {i, j, k}, + (int) (stb_perlin_fbm_noise3(block_x / 8.0, block_y / 8.0, + block_z / 8.0, 2.0, 0.5, 6 + ) > 0.5 ? fp::registry::STONE : fp::registry::AIR)); + } + } + } + + c->markDirty(); + + BLT_END_INTERVAL("Chunk Generate", "Instantiate"); + + return c; +}