diff --git a/CMake/CreateResources.cmake b/CMake/CreateResources.cmake index 4602298..96f27f6 100644 --- a/CMake/CreateResources.cmake +++ b/CMake/CreateResources.cmake @@ -1,5 +1,5 @@ function(create_resources directory output) - file(WRITE ${output} "") + file(WRITE ${output} "#include \n\n") file(GLOB bins ${directory}/*) foreach(bin ${bins}) @@ -11,9 +11,8 @@ function(create_resources directory output) file(READ ${bin} filedata HEX) string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1, " filedata ${filedata}) string(REGEX REPLACE "..$" "" filedata ${filedata}) - - file(APPEND ${output} "#include \n\n") + file(APPEND ${output} "const uint8_t ${filename}[] = { ${filedata} };\n") - file(APPEND ${output} "const uint64_t ${filename}_size = sizeof(${filename});") + file(APPEND ${output} "const uint64_t ${filename}_size = sizeof(${filename});\n\n") endforeach() endfunction() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 67f38a4..eb9f3b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.4) project(RNR) -set(CMAKE_CXX_STANDARD 23) - include(CMake/CreateResources.cmake) option(COMPILE_PLAYER "Compile the RNR player" ON) diff --git a/Projects/CMakeLists.txt b/Projects/CMakeLists.txt index 1d91cef..2c0e8f2 100644 --- a/Projects/CMakeLists.txt +++ b/Projects/CMakeLists.txt @@ -1,6 +1,9 @@ -include_directories(Engine/Header) +# Luau +set(LUAU_BUILD_CLI OFF CACHE BOOL "" FORCE) +set(LUAU_BUILD_TESTS OFF CACHE BOOL "" FORCE) -add_subdirectory(${DEPENDENCIES_DIR}/Luau Build) +add_subdirectory(${DEPENDENCIES_DIR}/Luau ${CMAKE_BINARY_DIR}/Dependencies/Luau) +# RNR add_subdirectory(Engine) -add_subdirectory(Client) +add_subdirectory(Client) \ No newline at end of file diff --git a/Projects/Client/Common/CMakeLists.txt b/Projects/Client/Common/CMakeLists.txt index 9ac8f69..2163f46 100644 --- a/Projects/Client/Common/CMakeLists.txt +++ b/Projects/Client/Common/CMakeLists.txt @@ -1,4 +1,4 @@ -add_subdirectory(${DEPENDENCIES_DIR}/GLAD Build) +add_subdirectory(${DEPENDENCIES_DIR}/GLAD ${CMAKE_BINARY_DIR}/Dependencies/GLAD) project(Common) @@ -14,5 +14,5 @@ qt_add_library(Common STATIC Source/GL/Widget.cpp ) -include_directories(Header) +target_include_directories(Common PUBLIC Header) target_link_libraries(Common PUBLIC ${QT6_LIBRARIES_INCL} Engine) \ No newline at end of file diff --git a/Projects/Client/Player/CMakeLists.txt b/Projects/Client/Player/CMakeLists.txt index 6c8b083..6e18569 100644 --- a/Projects/Client/Player/CMakeLists.txt +++ b/Projects/Client/Player/CMakeLists.txt @@ -1,8 +1,10 @@ project(Player) -create_resources(Resource ${CMAKE_BINARY_DIR}/PlayerResources.hpp) +create_resources(Resource ${CMAKE_BINARY_DIR}/Resources/PlayerResources.hpp) qt_add_executable(Player + ${CMAKE_BINARY_DIR}/Resources/PlayerResources.hpp + Header/MainWindow.hpp Source/main.cpp diff --git a/Projects/Client/Server/CMakeLists.txt b/Projects/Client/Server/CMakeLists.txt index 0df348c..2e8a2ed 100644 --- a/Projects/Client/Server/CMakeLists.txt +++ b/Projects/Client/Server/CMakeLists.txt @@ -1,8 +1,10 @@ project(Server) -create_resources(Resources ${CMAKE_BINARY_DIR}/ServerResources.hpp) +create_resources(Resource ${CMAKE_BINARY_DIR}/Resources/ServerResources.hpp) add_executable(Server + ${CMAKE_BINARY_DIR}/Resources/ServerResources.hpp + Source/main.cpp ) diff --git a/Projects/Client/Studio/CMakeLists.txt b/Projects/Client/Studio/CMakeLists.txt index 9207426..05c3faa 100644 --- a/Projects/Client/Studio/CMakeLists.txt +++ b/Projects/Client/Studio/CMakeLists.txt @@ -1,8 +1,10 @@ project(Studio) -create_resources(Resource ${CMAKE_BINARY_DIR}/StudioResources.hpp) +create_resources(Resource ${CMAKE_BINARY_DIR}/Resources/StudioResources.hpp) qt_add_executable(Studio + ${CMAKE_BINARY_DIR}/Resources/StudioResources.hpp + Header/MainWindow.hpp Source/main.cpp diff --git a/Projects/Engine/CMakeLists.txt b/Projects/Engine/CMakeLists.txt index 802fc81..6243128 100644 --- a/Projects/Engine/CMakeLists.txt +++ b/Projects/Engine/CMakeLists.txt @@ -1,5 +1,7 @@ project(Engine) +include_directories(Engine/Header) + add_library(Engine STATIC Header/Helpers/Name.hpp Header/Helpers/Strings.hpp @@ -18,4 +20,5 @@ add_library(Engine STATIC Source/Rendering/Adorn.cpp ) +target_include_directories(Engine PUBLIC Header) target_link_libraries(Engine PUBLIC ${BOOST_LIBRARIES} cglm Luau.Analysis Luau.Ast Luau.Compiler Luau.VM) \ No newline at end of file diff --git a/Projects/Engine/Header/Helpers/Name.hpp b/Projects/Engine/Header/Helpers/Name.hpp index ecef72d..c14cb99 100644 --- a/Projects/Engine/Header/Helpers/Name.hpp +++ b/Projects/Engine/Header/Helpers/Name.hpp @@ -12,5 +12,5 @@ namespace RNR static void compare(const RNR::Name* a, const RNR::Name* b); static void declare(const char* sName, int dictionaryIndex); static std::map* dictionary; - } + }; } \ No newline at end of file diff --git a/Projects/Engine/Header/Rendering/TextureProxyBase.hpp b/Projects/Engine/Header/Rendering/TextureProxyBase.hpp new file mode 100644 index 0000000..a9f381f --- /dev/null +++ b/Projects/Engine/Header/Rendering/TextureProxyBase.hpp @@ -0,0 +1,9 @@ +#pragma once + +namespace RNR +{ + class TextureProxyBase + { + + }; +} \ No newline at end of file diff --git a/Projects/Engine/Source/Helpers/Name.cpp b/Projects/Engine/Source/Helpers/Name.cpp index 5e411c6..26a6537 100644 --- a/Projects/Engine/Source/Helpers/Name.cpp +++ b/Projects/Engine/Source/Helpers/Name.cpp @@ -6,15 +6,15 @@ namespace RNR char* Name::c_str() { - // + return NULL; } - static void Name::compare(const RNR::Name* a, const RNR::Name* b) + void Name::compare(const RNR::Name* a, const RNR::Name* b) { // } - static void Name::declare(const char* sName, int dictionaryIndex) + void Name::declare(const char* sName, int dictionaryIndex) { // }