From 7551ca0143d717124a6a1d3811aeb53f80e5098b Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Thu, 4 Aug 2022 13:35:22 +0200 Subject: [PATCH] Inital commit --- .gitignore | 12 + include/UCTGui.h | 10 + include/UCTSave.h | 36 + include/UCTUtils.h | 33 + libs/imgui/backends/imgui_impl_glfw.cpp | 662 + libs/imgui/backends/imgui_impl_glfw.h | 46 + libs/imgui/backends/imgui_impl_opengl3.cpp | 866 + libs/imgui/backends/imgui_impl_opengl3.h | 55 + libs/imgui/imconfig.h | 125 + libs/imgui/imgui.cpp | 13444 ++++++++++++++++ libs/imgui/imgui.h | 3065 ++++ libs/imgui/imgui_demo.cpp | 7969 +++++++++ libs/imgui/imgui_draw.cpp | 4164 +++++ libs/imgui/imgui_internal.h | 2975 ++++ libs/imgui/imgui_tables.cpp | 4068 +++++ libs/imgui/imgui_widgets.cpp | 8394 ++++++++++ libs/imgui/imstb_rectpack.h | 627 + libs/imgui/imstb_textedit.h | 1447 ++ libs/imgui/imstb_truetype.h | 5085 ++++++ libs/nlohmann/adl_serializer.hpp | 55 + libs/nlohmann/byte_container_with_subtype.hpp | 103 + libs/nlohmann/detail/abi_macros.hpp | 79 + .../nlohmann/detail/conversions/from_json.hpp | 497 + libs/nlohmann/detail/conversions/to_chars.hpp | 1118 ++ libs/nlohmann/detail/conversions/to_json.hpp | 440 + libs/nlohmann/detail/exceptions.hpp | 255 + libs/nlohmann/detail/hash.hpp | 129 + libs/nlohmann/detail/input/binary_reader.hpp | 2973 ++++ libs/nlohmann/detail/input/input_adapters.hpp | 494 + libs/nlohmann/detail/input/json_sax.hpp | 728 + libs/nlohmann/detail/input/lexer.hpp | 1632 ++ libs/nlohmann/detail/input/parser.hpp | 507 + libs/nlohmann/detail/input/position_t.hpp | 37 + .../detail/iterators/internal_iterator.hpp | 35 + libs/nlohmann/detail/iterators/iter_impl.hpp | 751 + .../detail/iterators/iteration_proxy.hpp | 242 + .../detail/iterators/iterator_traits.hpp | 61 + .../iterators/json_reverse_iterator.hpp | 130 + .../detail/iterators/primitive_iterator.hpp | 132 + libs/nlohmann/detail/json_pointer.hpp | 900 ++ libs/nlohmann/detail/json_ref.hpp | 78 + libs/nlohmann/detail/macro_scope.hpp | 468 + libs/nlohmann/detail/macro_unscope.hpp | 44 + libs/nlohmann/detail/meta/call_std/begin.hpp | 17 + libs/nlohmann/detail/meta/call_std/end.hpp | 17 + libs/nlohmann/detail/meta/cpp_future.hpp | 166 + libs/nlohmann/detail/meta/detected.hpp | 70 + libs/nlohmann/detail/meta/identity_tag.hpp | 21 + libs/nlohmann/detail/meta/is_sax.hpp | 159 + libs/nlohmann/detail/meta/std_fs.hpp | 29 + libs/nlohmann/detail/meta/type_traits.hpp | 688 + libs/nlohmann/detail/meta/void_t.hpp | 24 + libs/nlohmann/detail/output/binary_writer.hpp | 1838 +++ .../detail/output/output_adapters.hpp | 147 + libs/nlohmann/detail/output/serializer.hpp | 988 ++ libs/nlohmann/detail/string_concat.hpp | 146 + libs/nlohmann/detail/string_escape.hpp | 72 + libs/nlohmann/detail/value_t.hpp | 118 + libs/nlohmann/json.hpp | 5163 ++++++ libs/nlohmann/json_fwd.hpp | 74 + libs/nlohmann/ordered_map.hpp | 359 + libs/nlohmann/thirdparty/hedley/hedley.hpp | 2045 +++ .../thirdparty/hedley/hedley_undef.hpp | 158 + src/UCTGui.cpp | 174 + src/UCTSave.cpp | 89 + src/UCTUtils.cpp | 31 + src/main.cpp | 141 + xmake.lua | 21 + 68 files changed, 77726 insertions(+) create mode 100644 .gitignore create mode 100644 include/UCTGui.h create mode 100644 include/UCTSave.h create mode 100644 include/UCTUtils.h create mode 100644 libs/imgui/backends/imgui_impl_glfw.cpp create mode 100644 libs/imgui/backends/imgui_impl_glfw.h create mode 100644 libs/imgui/backends/imgui_impl_opengl3.cpp create mode 100644 libs/imgui/backends/imgui_impl_opengl3.h create mode 100644 libs/imgui/imconfig.h create mode 100644 libs/imgui/imgui.cpp create mode 100644 libs/imgui/imgui.h create mode 100644 libs/imgui/imgui_demo.cpp create mode 100644 libs/imgui/imgui_draw.cpp create mode 100644 libs/imgui/imgui_internal.h create mode 100644 libs/imgui/imgui_tables.cpp create mode 100644 libs/imgui/imgui_widgets.cpp create mode 100644 libs/imgui/imstb_rectpack.h create mode 100644 libs/imgui/imstb_textedit.h create mode 100644 libs/imgui/imstb_truetype.h create mode 100644 libs/nlohmann/adl_serializer.hpp create mode 100644 libs/nlohmann/byte_container_with_subtype.hpp create mode 100644 libs/nlohmann/detail/abi_macros.hpp create mode 100644 libs/nlohmann/detail/conversions/from_json.hpp create mode 100644 libs/nlohmann/detail/conversions/to_chars.hpp create mode 100644 libs/nlohmann/detail/conversions/to_json.hpp create mode 100644 libs/nlohmann/detail/exceptions.hpp create mode 100644 libs/nlohmann/detail/hash.hpp create mode 100644 libs/nlohmann/detail/input/binary_reader.hpp create mode 100644 libs/nlohmann/detail/input/input_adapters.hpp create mode 100644 libs/nlohmann/detail/input/json_sax.hpp create mode 100644 libs/nlohmann/detail/input/lexer.hpp create mode 100644 libs/nlohmann/detail/input/parser.hpp create mode 100644 libs/nlohmann/detail/input/position_t.hpp create mode 100644 libs/nlohmann/detail/iterators/internal_iterator.hpp create mode 100644 libs/nlohmann/detail/iterators/iter_impl.hpp create mode 100644 libs/nlohmann/detail/iterators/iteration_proxy.hpp create mode 100644 libs/nlohmann/detail/iterators/iterator_traits.hpp create mode 100644 libs/nlohmann/detail/iterators/json_reverse_iterator.hpp create mode 100644 libs/nlohmann/detail/iterators/primitive_iterator.hpp create mode 100644 libs/nlohmann/detail/json_pointer.hpp create mode 100644 libs/nlohmann/detail/json_ref.hpp create mode 100644 libs/nlohmann/detail/macro_scope.hpp create mode 100644 libs/nlohmann/detail/macro_unscope.hpp create mode 100644 libs/nlohmann/detail/meta/call_std/begin.hpp create mode 100644 libs/nlohmann/detail/meta/call_std/end.hpp create mode 100644 libs/nlohmann/detail/meta/cpp_future.hpp create mode 100644 libs/nlohmann/detail/meta/detected.hpp create mode 100644 libs/nlohmann/detail/meta/identity_tag.hpp create mode 100644 libs/nlohmann/detail/meta/is_sax.hpp create mode 100644 libs/nlohmann/detail/meta/std_fs.hpp create mode 100644 libs/nlohmann/detail/meta/type_traits.hpp create mode 100644 libs/nlohmann/detail/meta/void_t.hpp create mode 100644 libs/nlohmann/detail/output/binary_writer.hpp create mode 100644 libs/nlohmann/detail/output/output_adapters.hpp create mode 100644 libs/nlohmann/detail/output/serializer.hpp create mode 100644 libs/nlohmann/detail/string_concat.hpp create mode 100644 libs/nlohmann/detail/string_escape.hpp create mode 100644 libs/nlohmann/detail/value_t.hpp create mode 100644 libs/nlohmann/json.hpp create mode 100644 libs/nlohmann/json_fwd.hpp create mode 100644 libs/nlohmann/ordered_map.hpp create mode 100644 libs/nlohmann/thirdparty/hedley/hedley.hpp create mode 100644 libs/nlohmann/thirdparty/hedley/hedley_undef.hpp create mode 100644 src/UCTGui.cpp create mode 100644 src/UCTSave.cpp create mode 100644 src/UCTUtils.cpp create mode 100644 src/main.cpp create mode 100644 xmake.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e6aa592 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + +# Vscode configs +.vscode + +# Test +test \ No newline at end of file diff --git a/include/UCTGui.h b/include/UCTGui.h new file mode 100644 index 0000000..cfcfd73 --- /dev/null +++ b/include/UCTGui.h @@ -0,0 +1,10 @@ +#pragma once + +namespace uct { +namespace gui { + +void Init(); +void Render(); + +} // namespace gui +} // namespace uct diff --git a/include/UCTSave.h b/include/UCTSave.h new file mode 100644 index 0000000..128aabd --- /dev/null +++ b/include/UCTSave.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include + +namespace uct { +namespace save { + +constexpr static std::size_t TEMPLATE_BUFFER_SIZE = 65536; +constexpr static std::size_t SLOT_BUFFER_SIZE = 1024; + +struct TemplateSlot { + std::string name; + std::string defaultValue; + char valueBuffer[SLOT_BUFFER_SIZE]; +}; + +struct Template { + std::string name; + char templateRaw[TEMPLATE_BUFFER_SIZE]; + std::vector templateSlots; +}; + +struct UCTSave { + std::vector