From e3d4763a1946cc3c38b97dd4e76faa1f1fd7d4d0 Mon Sep 17 00:00:00 2001 From: rjindael Date: Sat, 8 Jul 2023 01:53:17 -0700 Subject: [PATCH] Overhaul everything (and close #1) --- .gitattributes | 3 +- .gitmodules | 3 + CMake/CreateResources.cmake | 19 +++ CMakeLists.txt | 90 ++------------ Dependencies/GLAD/CMakeLists.txt | 10 ++ .../GLAD/Header}/KHR/khrplatform.h | 0 .../GLAD/Header}/glad/glad.h | 0 {glad/src => Dependencies/GLAD/Source}/glad.c | 0 Dependencies/Luau | 1 + Projects/CMakeLists.txt | 10 ++ Projects/Client/CMakeLists.txt | 15 +++ Projects/Client/Common/CMakeLists.txt | 19 +++ Projects/Client/Common/Header/GL/Adorn.hpp | 12 ++ .../Common/Header/GL}/RenderContext.hpp | 2 + Projects/Client/Common/Header/GL/Widget.hpp | 30 +++++ Projects/Client/Common/Source/GL/Adorn.cpp | 9 ++ Projects/Client/Common/Source/GL/Widget.cpp | 30 +++++ Projects/Client/Player/CMakeLists.txt | 13 ++ Projects/Client/Player/Header/MainWindow.hpp | 14 +++ .../Client/Player/Resource/Icon.png | Bin Projects/Client/Player/Source/MainWindow.cpp | 15 +++ Projects/Client/Player/Source/main.cpp | 15 +++ Projects/Client/Server/CMakeLists.txt | 10 ++ .../Client/Server/Header}/.gitkeep | 0 .../Client/Server/Resource/Icon.png | Bin Projects/Client/Server/Source/main.cpp | 6 + Projects/Client/Studio/CMakeLists.txt | 13 ++ Projects/Client/Studio/Header/MainWindow.hpp | 21 ++++ .../Client/Studio/Resource/Icon.png | Bin Projects/Client/Studio/Source/MainWindow.cpp | 23 ++++ .../Client/Studio/Source}/main.cpp | 11 +- Projects/Engine/CMakeLists.txt | 21 ++++ .../Engine/Header/App/GUI}/.gitkeep | 0 .../Engine/Header/App/Humanoid}/Humanoid.hpp | 13 +- .../Engine/Header/App/Script}/.gitkeep | 0 .../Engine/Header/App/Tool}/.gitkeep | 0 .../Header/App/V8/DataModel/ForceField.hpp | 15 +++ .../Engine/Header/App/V8/Kernel}/.gitkeep | 0 .../Engine/Header/App/V8/Tree}/Instance.hpp | 10 +- .../Engine/Header/App/V8/World}/World.hpp | 0 Projects/Engine/Header/Helpers/Name.hpp | 16 +++ Projects/Engine/Header/Helpers/Strings.hpp | 14 +++ Projects/Engine/Header/Network/GUID.hpp | 17 +++ .../Engine/Header/Network/RakNet}/.gitkeep | 0 Projects/Engine/Header/Rendering/Adorn.hpp | 15 +++ {src/engine => Projects/Engine}/LICENSE | 0 .../Engine/Source/App/GUI}/.gitkeep | 0 .../Engine/Source/App/Humanoid/Humanoid.cpp | 44 +++++++ .../Engine/Source/App/Script}/.gitkeep | 0 .../Engine/Source/App/Tool}/.gitkeep | 0 .../Source/App/V8/DataModel/ForceField.cpp | 19 +++ .../Engine/Source/App/V8/Kernel}/.gitkeep | 0 .../Engine/Source/App/V8/Tree/Instance.cpp | 111 +++++++++++++++++ Projects/Engine/Source/App/V8/World/World.cpp | 29 +++++ Projects/Engine/Source/Helpers/Name.cpp | 21 ++++ Projects/Engine/Source/Helpers/Strings.cpp | 28 +++++ Projects/Engine/Source/Network/GUID.cpp | 19 +++ .../Engine/Source/Network/RakNet}/.gitkeep | 0 Projects/Engine/Source/Rendering/Adorn.cpp | 6 + README.md | 16 +-- cmake/resource.cmake | 11 -- rsc/README | 3 - src/client/common/Adorn.cpp | 6 - src/client/common/RNRGraphicsWidget.cpp | 26 ---- src/client/player/main.cpp | 6 - src/client/server/main.cpp | 6 - src/client/studio/StudioWindow.cpp | 27 ---- src/engine/app/Name.cpp | 0 src/engine/app/gui/Adorn.cpp | 0 src/engine/app/humanoid/Forcefield.cpp | 0 src/engine/app/humanoid/Humanoid.cpp | 6 - src/engine/app/v8/tree/Instance.cpp | 104 ---------------- src/engine/app/v8/world/World.cpp | 21 ---- src/engine/network/Guid.cpp | 16 --- src/engine/rendering/g3d/.gitkeep | 0 src/engine/utilities/.gitkeep | 0 src/include/client/common/Adorn.hpp | 15 --- .../client/common/RNRGraphicsWidget.hpp | 24 ---- src/include/client/server/.gitkeep | 0 src/include/client/studio/StudioWindow.hpp | 19 --- src/include/engine/LICENSE | 116 ------------------ src/include/engine/app/Name.hpp | 17 --- src/include/engine/app/gui/Adorn.hpp | 17 --- .../engine/app/humanoid/Forcefield.hpp | 8 -- src/include/engine/app/lua/.gitkeep | 0 src/include/engine/app/v8/kernel/.gitkeep | 0 src/include/engine/app/v8/model/.gitkeep | 0 src/include/engine/network/Guid.hpp | 15 --- src/include/engine/network/raknet/.gitkeep | 0 src/include/engine/rendering/.gitkeep | 0 .../engine/rendering/TextureProxyBase.hpp | 9 -- src/include/engine/utilities/.gitkeep | 0 92 files changed, 705 insertions(+), 575 deletions(-) create mode 100644 .gitmodules create mode 100644 CMake/CreateResources.cmake create mode 100644 Dependencies/GLAD/CMakeLists.txt rename {glad/include => Dependencies/GLAD/Header}/KHR/khrplatform.h (100%) rename {glad/include => Dependencies/GLAD/Header}/glad/glad.h (100%) rename {glad/src => Dependencies/GLAD/Source}/glad.c (100%) create mode 160000 Dependencies/Luau create mode 100644 Projects/CMakeLists.txt create mode 100644 Projects/Client/CMakeLists.txt create mode 100644 Projects/Client/Common/CMakeLists.txt create mode 100644 Projects/Client/Common/Header/GL/Adorn.hpp rename {src/include/client/common => Projects/Client/Common/Header/GL}/RenderContext.hpp (83%) create mode 100644 Projects/Client/Common/Header/GL/Widget.hpp create mode 100644 Projects/Client/Common/Source/GL/Adorn.cpp create mode 100644 Projects/Client/Common/Source/GL/Widget.cpp create mode 100644 Projects/Client/Player/CMakeLists.txt create mode 100644 Projects/Client/Player/Header/MainWindow.hpp rename rsc/client/icon.png => Projects/Client/Player/Resource/Icon.png (100%) create mode 100644 Projects/Client/Player/Source/MainWindow.cpp create mode 100644 Projects/Client/Player/Source/main.cpp create mode 100644 Projects/Client/Server/CMakeLists.txt rename {rsc/content => Projects/Client/Server/Header}/.gitkeep (100%) rename rsc/server/icon.png => Projects/Client/Server/Resource/Icon.png (100%) create mode 100644 Projects/Client/Server/Source/main.cpp create mode 100644 Projects/Client/Studio/CMakeLists.txt create mode 100644 Projects/Client/Studio/Header/MainWindow.hpp rename rsc/studio/icon.png => Projects/Client/Studio/Resource/Icon.png (100%) create mode 100644 Projects/Client/Studio/Source/MainWindow.cpp rename {src/client/studio => Projects/Client/Studio/Source}/main.cpp (75%) create mode 100644 Projects/Engine/CMakeLists.txt rename {src/engine/app/gui => Projects/Engine/Header/App/GUI}/.gitkeep (100%) rename {src/include/engine/app/humanoid => Projects/Engine/Header/App/Humanoid}/Humanoid.hpp (79%) rename {src/engine/app/humanoid => Projects/Engine/Header/App/Script}/.gitkeep (100%) rename {src/engine/app/lua => Projects/Engine/Header/App/Tool}/.gitkeep (100%) create mode 100644 Projects/Engine/Header/App/V8/DataModel/ForceField.hpp rename {src/engine/app/v8/kernel => Projects/Engine/Header/App/V8/Kernel}/.gitkeep (100%) rename {src/include/engine/app/v8/tree => Projects/Engine/Header/App/V8/Tree}/Instance.hpp (92%) rename {src/include/engine/app/v8/world => Projects/Engine/Header/App/V8/World}/World.hpp (100%) create mode 100644 Projects/Engine/Header/Helpers/Name.hpp create mode 100644 Projects/Engine/Header/Helpers/Strings.hpp create mode 100644 Projects/Engine/Header/Network/GUID.hpp rename {src/engine/app/v8/model => Projects/Engine/Header/Network/RakNet}/.gitkeep (100%) create mode 100644 Projects/Engine/Header/Rendering/Adorn.hpp rename {src/engine => Projects/Engine}/LICENSE (100%) rename {src/engine/app/v8/tree => Projects/Engine/Source/App/GUI}/.gitkeep (100%) create mode 100644 Projects/Engine/Source/App/Humanoid/Humanoid.cpp rename {src/engine/app/v8/world => Projects/Engine/Source/App/Script}/.gitkeep (100%) rename {src/engine/network => Projects/Engine/Source/App/Tool}/.gitkeep (100%) create mode 100644 Projects/Engine/Source/App/V8/DataModel/ForceField.cpp rename {src/engine/network/raknet => Projects/Engine/Source/App/V8/Kernel}/.gitkeep (100%) create mode 100644 Projects/Engine/Source/App/V8/Tree/Instance.cpp create mode 100644 Projects/Engine/Source/App/V8/World/World.cpp create mode 100644 Projects/Engine/Source/Helpers/Name.cpp create mode 100644 Projects/Engine/Source/Helpers/Strings.cpp create mode 100644 Projects/Engine/Source/Network/GUID.cpp rename {src/engine/rendering => Projects/Engine/Source/Network/RakNet}/.gitkeep (100%) create mode 100644 Projects/Engine/Source/Rendering/Adorn.cpp delete mode 100644 cmake/resource.cmake delete mode 100644 rsc/README delete mode 100644 src/client/common/Adorn.cpp delete mode 100644 src/client/common/RNRGraphicsWidget.cpp delete mode 100644 src/client/player/main.cpp delete mode 100644 src/client/server/main.cpp delete mode 100644 src/client/studio/StudioWindow.cpp delete mode 100644 src/engine/app/Name.cpp delete mode 100644 src/engine/app/gui/Adorn.cpp delete mode 100644 src/engine/app/humanoid/Forcefield.cpp delete mode 100644 src/engine/app/humanoid/Humanoid.cpp delete mode 100644 src/engine/app/v8/tree/Instance.cpp delete mode 100644 src/engine/app/v8/world/World.cpp delete mode 100644 src/engine/network/Guid.cpp delete mode 100644 src/engine/rendering/g3d/.gitkeep delete mode 100644 src/engine/utilities/.gitkeep delete mode 100644 src/include/client/common/Adorn.hpp delete mode 100644 src/include/client/common/RNRGraphicsWidget.hpp delete mode 100644 src/include/client/server/.gitkeep delete mode 100644 src/include/client/studio/StudioWindow.hpp delete mode 100644 src/include/engine/LICENSE delete mode 100644 src/include/engine/app/Name.hpp delete mode 100644 src/include/engine/app/gui/Adorn.hpp delete mode 100644 src/include/engine/app/humanoid/Forcefield.hpp delete mode 100644 src/include/engine/app/lua/.gitkeep delete mode 100644 src/include/engine/app/v8/kernel/.gitkeep delete mode 100644 src/include/engine/app/v8/model/.gitkeep delete mode 100644 src/include/engine/network/Guid.hpp delete mode 100644 src/include/engine/network/raknet/.gitkeep delete mode 100644 src/include/engine/rendering/.gitkeep delete mode 100644 src/include/engine/rendering/TextureProxyBase.hpp delete mode 100644 src/include/engine/utilities/.gitkeep diff --git a/.gitattributes b/.gitattributes index c8a47b5..632f19f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ -glad/** linguist-vendored \ No newline at end of file +# Ignore GLAD generated API files +glad.* linguist-vendored \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e9204ba --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Dependencies/Luau"] + path = Dependencies/Luau + url = https://github.com/roblox/luau diff --git a/CMake/CreateResources.cmake b/CMake/CreateResources.cmake new file mode 100644 index 0000000..4602298 --- /dev/null +++ b/CMake/CreateResources.cmake @@ -0,0 +1,19 @@ +function(create_resources directory output) + file(WRITE ${output} "") + file(GLOB bins ${directory}/*) + + foreach(bin ${bins}) + string(REGEX MATCH "([^/]+)$" filename ${bin}) + string(REGEX REPLACE "\.[^.]*$" "" filename ${filename}) + string(REGEX REPLACE "\\.| |-" "_" filename ${filename}) + string(TOLOWER ${filename} filename) + + 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});") + endforeach() +endfunction() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c92eb6e..2f517b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,88 +1,18 @@ cmake_minimum_required(VERSION 3.4) -include(cmake/resource.cmake) +project(RNR) -project(engine) -project(player) -project(server) -project(studio) +set(CMAKE_CXX_STANDARD 23) -option(COMPILE_PLAYER "Compile the RNR Player" ON) -option(COMPILE_SERVER "Compile the RNR Server" ON) -option(COMPILE_STUDIO "Compile the RNR Studio" ON) +include(CMake/CreateResources.cmake) + +option(COMPILE_PLAYER "Compile the RNR player" ON) +option(COMPILE_PLAYER "Compile the RNR studio" ON) +option(COMPILE_PLAYER "Compile the RNR server" ON) + +set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/Dependencies) find_package(Boost REQUIRED) find_package(cglm REQUIRED CONFIG) -add_library(engine STATIC - src/engine/app/gui/Adorn.cpp - src/include/engine/app/gui/Adorn.hpp - src/engine/app/humanoid/Humanoid.cpp - src/include/engine/app/humanoid/Humanoid.hpp - src/engine/app/humanoid/Forcefield.cpp - src/include/engine/app/humanoid/Forcefield.hpp - src/engine/app/v8/tree/Instance.cpp - src/include/engine/app/v8/tree/Instance.hpp - src/engine/app/Name.cpp - src/include/engine/app/Name.hpp - src/engine/network/Guid.cpp - src/include/engine/network/Guid.hpp - src/include/engine/rendering/TextureProxyBase.hpp -) - -target_include_directories(engine PUBLIC src/include ${CMAKE_BINARY_DIR}) -target_link_libraries(engine PUBLIC ${BOOST_LIBRARIES} cglm) - -if(COMPILE_PLAYER OR COMPILE_STUDIO) - project(glad) - add_library(glad STATIC - glad/src/glad.c - glad/include/glad/glad.h - glad/include/KHR/khrplatform.h - ) - target_include_directories(glad PUBLIC glad/include) - project(qt_common) - find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets OpenGLWidgets) - set(QT6_LIBRARIES_INCL Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets glad) - qt_standard_project_setup() - - qt_add_library(qt_common STATIC - src/client/common/RNRGraphicsWidget.cpp - src/include/client/common/RNRGraphicsWidget.hpp - src/client/common/Adorn.cpp - src/include/client/common/Adorn.hpp - ) - target_link_libraries(qt_common PUBLIC ${QT6_LIBRARIES_INCL} engine) -endif() - -if(COMPILE_PLAYER) - create_resources(rsc/client ${CMAKE_BINARY_DIR}/player_rsc.h) - qt_add_executable(player - src/client/player/main.cpp - - ${CMAKE_BINARY_DIR}/player_rsc.h - ) - target_link_libraries(player PRIVATE qt_common engine) -endif() - -if(COMPILE_SERVER) - create_resources(rsc/server ${CMAKE_BINARY_DIR}/server_rsc.h) - add_executable(server - src/client/server/main.cpp - - ${CMAKE_BINARY_DIR}/server_rsc.h - ) - target_link_libraries(server PRIVATE engine) -endif() - -if(COMPILE_STUDIO) - create_resources(rsc/studio ${CMAKE_BINARY_DIR}/studio_rsc.h) - qt_add_executable(studio - src/client/studio/StudioWindow.cpp - src/include/client/studio/StudioWindow.hpp - src/client/studio/main.cpp - - ${CMAKE_BINARY_DIR}/studio_rsc.h - ) - target_link_libraries(studio PRIVATE qt_common engine) -endif() \ No newline at end of file +add_subdirectory(Projects) \ No newline at end of file diff --git a/Dependencies/GLAD/CMakeLists.txt b/Dependencies/GLAD/CMakeLists.txt new file mode 100644 index 0000000..574d00d --- /dev/null +++ b/Dependencies/GLAD/CMakeLists.txt @@ -0,0 +1,10 @@ +project(GLAD) + +add_library(GLAD STATIC + Header/glad/glad.h + Header/KHR/khrplatform.h + + Source/glad.c +) + +target_include_directories(GLAD PUBLIC Header) \ No newline at end of file diff --git a/glad/include/KHR/khrplatform.h b/Dependencies/GLAD/Header/KHR/khrplatform.h similarity index 100% rename from glad/include/KHR/khrplatform.h rename to Dependencies/GLAD/Header/KHR/khrplatform.h diff --git a/glad/include/glad/glad.h b/Dependencies/GLAD/Header/glad/glad.h similarity index 100% rename from glad/include/glad/glad.h rename to Dependencies/GLAD/Header/glad/glad.h diff --git a/glad/src/glad.c b/Dependencies/GLAD/Source/glad.c similarity index 100% rename from glad/src/glad.c rename to Dependencies/GLAD/Source/glad.c diff --git a/Dependencies/Luau b/Dependencies/Luau new file mode 160000 index 0000000..e25de95 --- /dev/null +++ b/Dependencies/Luau @@ -0,0 +1 @@ +Subproject commit e25de95445f2d635a125ab463426bb7fda017093 diff --git a/Projects/CMakeLists.txt b/Projects/CMakeLists.txt new file mode 100644 index 0000000..1d2e704 --- /dev/null +++ b/Projects/CMakeLists.txt @@ -0,0 +1,10 @@ +include_directories(Engine/Header) + +add_subdirectory(Engine) +add_subdirectory(Client) + +add_subdirectory(${DEPENDENCIES_DIR}/Luau Build) +target_link_libraries(Engine Luau.Analysis) +target_link_libraries(Engine Luau.Ast) +target_link_libraries(Engine Luau.Compiler) +target_link_libraries(Engine Luau.VM) \ No newline at end of file diff --git a/Projects/Client/CMakeLists.txt b/Projects/Client/CMakeLists.txt new file mode 100644 index 0000000..e9f5162 --- /dev/null +++ b/Projects/Client/CMakeLists.txt @@ -0,0 +1,15 @@ +if(COMPILE_PLAYER OR COMPILE_STUDIO) + add_subdirectory(Common) + + if(COMPILE_PLAYER) + add_subdirectory(Player) + endif() + + if(COMPILE_STUDIO) + add_subdirectory(Studio) + endif() +endif() + +if(COMPILE_SERVER) + add_subdirectory(Server) +endif() \ No newline at end of file diff --git a/Projects/Client/Common/CMakeLists.txt b/Projects/Client/Common/CMakeLists.txt new file mode 100644 index 0000000..15dd773 --- /dev/null +++ b/Projects/Client/Common/CMakeLists.txt @@ -0,0 +1,19 @@ +add_subdirectory(${DEPENDENCIES_DIR}/GLAD Build) + +project(Common) + +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets OpenGLWidgets) +set(QT6_LIBRARIES_INCL Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets glad) + +qt_standard_project_setup() +qt_add_library(Common STATIC + Header/GL/Adorn.hpp + Header/GL/RenderContext.hpp + Header/GL/Widget.hpp + + Source/GL/Adorn.cpp + Source/GL/Widget.cpp +) + +include_directories(Header) +target_link_libraries(Common PUBLIC ${QT6_LIBRARIES_INCL} Engine) \ No newline at end of file diff --git a/Projects/Client/Common/Header/GL/Adorn.hpp b/Projects/Client/Common/Header/GL/Adorn.hpp new file mode 100644 index 0000000..1699bff --- /dev/null +++ b/Projects/Client/Common/Header/GL/Adorn.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include + +namespace GL +{ + class Adorn : public RNR::Adorn + { + public: + Adorn(); + } +} \ No newline at end of file diff --git a/src/include/client/common/RenderContext.hpp b/Projects/Client/Common/Header/GL/RenderContext.hpp similarity index 83% rename from src/include/client/common/RenderContext.hpp rename to Projects/Client/Common/Header/GL/RenderContext.hpp index b5c58f9..370f858 100644 --- a/src/include/client/common/RenderContext.hpp +++ b/Projects/Client/Common/Header/GL/RenderContext.hpp @@ -1,3 +1,5 @@ +#pragma once + #include namespace GL diff --git a/Projects/Client/Common/Header/GL/Widget.hpp b/Projects/Client/Common/Header/GL/Widget.hpp new file mode 100644 index 0000000..62db2f9 --- /dev/null +++ b/Projects/Client/Common/Header/GL/Widget.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include +#include +#include + +#include + +namespace GL +{ + class Widget : public QOpenGLWidget + { + Q_OBJECT + + public: + Widget(QWidget* parent = nullptr); + + double delta; + + Adorn* adorn; + + protected: + virtual void initialize(); + virtual void paint(); + virtual void resize(int x, int y); + + private: + QElapsedTimer timer; + }; +} diff --git a/Projects/Client/Common/Source/GL/Adorn.cpp b/Projects/Client/Common/Source/GL/Adorn.cpp new file mode 100644 index 0000000..e2158fc --- /dev/null +++ b/Projects/Client/Common/Source/GL/Adorn.cpp @@ -0,0 +1,9 @@ +#include + +namespace GL +{ + Adorn::Adorn() + { + // + } +} \ No newline at end of file diff --git a/Projects/Client/Common/Source/GL/Widget.cpp b/Projects/Client/Common/Source/GL/Widget.cpp new file mode 100644 index 0000000..f28098f --- /dev/null +++ b/Projects/Client/Common/Source/GL/Widget.cpp @@ -0,0 +1,30 @@ +#include + +namespace GL +{ + Widget::Widget(QWidget* parent) : QOpenGLWidget(parent) + { + this->adorn = new GL::Adorn(); + } + + void Widget::initialize() + { + printf("RNR::GLWidget::initialize: initializing\n"); + + if (gladLoadGL()) + { + printf("RNR::GLWidget::initialize: initialized\n"); + } + } + + void Widget::paint() + { + this->delta = ((double)this->timer.elapsed()) / 1000.0; + this->timer.start(); + } + + void Widget::resize(int x, int y) + { + printf("RNR::GLWidget::resize: resizing to (%i, %i)\n", x, y); + } +} \ No newline at end of file diff --git a/Projects/Client/Player/CMakeLists.txt b/Projects/Client/Player/CMakeLists.txt new file mode 100644 index 0000000..6c8b083 --- /dev/null +++ b/Projects/Client/Player/CMakeLists.txt @@ -0,0 +1,13 @@ +project(Player) + +create_resources(Resource ${CMAKE_BINARY_DIR}/PlayerResources.hpp) + +qt_add_executable(Player + Header/MainWindow.hpp + + Source/main.cpp + Source/MainWindow.cpp +) + +target_include_directories(Player PRIVATE Header) +target_link_libraries(Player PRIVATE Common Engine) \ No newline at end of file diff --git a/Projects/Client/Player/Header/MainWindow.hpp b/Projects/Client/Player/Header/MainWindow.hpp new file mode 100644 index 0000000..2835d01 --- /dev/null +++ b/Projects/Client/Player/Header/MainWindow.hpp @@ -0,0 +1,14 @@ +#pragma once + +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT + + public: + MainWindow(); + + protected: + void closeEvent(QCloseEvent* event); +} \ No newline at end of file diff --git a/rsc/client/icon.png b/Projects/Client/Player/Resource/Icon.png similarity index 100% rename from rsc/client/icon.png rename to Projects/Client/Player/Resource/Icon.png diff --git a/Projects/Client/Player/Source/MainWindow.cpp b/Projects/Client/Player/Source/MainWindow.cpp new file mode 100644 index 0000000..744d25e --- /dev/null +++ b/Projects/Client/Player/Source/MainWindow.cpp @@ -0,0 +1,15 @@ +#include + +MainWindow::MainWindow() +{ + QPixmap pixmap = QPixmap(); + pixmap.loadFromData(icon, icon_size); + + setWindowTitle(QString("RNR")); + setWindowIcon(QIcon(pixmap)); +} + +void MainWindow::closeEvent(QCloseEvent* event) +{ + // +} \ No newline at end of file diff --git a/Projects/Client/Player/Source/main.cpp b/Projects/Client/Player/Source/main.cpp new file mode 100644 index 0000000..7bf250c --- /dev/null +++ b/Projects/Client/Player/Source/main.cpp @@ -0,0 +1,15 @@ +#include + +#include + +#include + +int main(int argc, char** argv) +{ + QApplication app(argc, argv); + MainWindow window = MainWindow(); + + window.show(); + + return app.exec(); +} \ No newline at end of file diff --git a/Projects/Client/Server/CMakeLists.txt b/Projects/Client/Server/CMakeLists.txt new file mode 100644 index 0000000..0df348c --- /dev/null +++ b/Projects/Client/Server/CMakeLists.txt @@ -0,0 +1,10 @@ +project(Server) + +create_resources(Resources ${CMAKE_BINARY_DIR}/ServerResources.hpp) + +add_executable(Server + Source/main.cpp +) + +target_include_directories(Server PRIVATE Header) +target_link_libraries(Server PRIVATE Engine) \ No newline at end of file diff --git a/rsc/content/.gitkeep b/Projects/Client/Server/Header/.gitkeep similarity index 100% rename from rsc/content/.gitkeep rename to Projects/Client/Server/Header/.gitkeep diff --git a/rsc/server/icon.png b/Projects/Client/Server/Resource/Icon.png similarity index 100% rename from rsc/server/icon.png rename to Projects/Client/Server/Resource/Icon.png diff --git a/Projects/Client/Server/Source/main.cpp b/Projects/Client/Server/Source/main.cpp new file mode 100644 index 0000000..283ea8c --- /dev/null +++ b/Projects/Client/Server/Source/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char** argv) +{ + printf("RNR Server\n"); +} \ No newline at end of file diff --git a/Projects/Client/Studio/CMakeLists.txt b/Projects/Client/Studio/CMakeLists.txt new file mode 100644 index 0000000..9207426 --- /dev/null +++ b/Projects/Client/Studio/CMakeLists.txt @@ -0,0 +1,13 @@ +project(Studio) + +create_resources(Resource ${CMAKE_BINARY_DIR}/StudioResources.hpp) + +qt_add_executable(Studio + Header/MainWindow.hpp + + Source/main.cpp + Source/MainWindow.cpp +) + +target_include_directories(Studio PRIVATE Header) +target_link_libraries(Studio PRIVATE Common Engine) \ No newline at end of file diff --git a/Projects/Client/Studio/Header/MainWindow.hpp b/Projects/Client/Studio/Header/MainWindow.hpp new file mode 100644 index 0000000..ce04801 --- /dev/null +++ b/Projects/Client/Studio/Header/MainWindow.hpp @@ -0,0 +1,21 @@ +#pragma once + +#include +#include +#include + +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT + + public: + MainWindow(); + + GL::Widget* widget; + QTreeWidget* explorer; + + protected: + void closeEvent(QCloseEvent* event); +} \ No newline at end of file diff --git a/rsc/studio/icon.png b/Projects/Client/Studio/Resource/Icon.png similarity index 100% rename from rsc/studio/icon.png rename to Projects/Client/Studio/Resource/Icon.png diff --git a/Projects/Client/Studio/Source/MainWindow.cpp b/Projects/Client/Studio/Source/MainWindow.cpp new file mode 100644 index 0000000..807de07 --- /dev/null +++ b/Projects/Client/Studio/Source/MainWindow.cpp @@ -0,0 +1,23 @@ +#include + +MainWindow::MainWindow() +{ + QPixmap pixmap = QPixmap(); + pixmap.loadFromData(icon, icon_size); + + QWidget* content_widget = new QWidget(); + QGridLayout* grid = new QGridLayout(); + + this->graphics_widget = new GL::Widget(); + grid->addWidget(this->graphics_widget, 0, 0, 1, 1); + content_widget->setLayout(grid); + + setWindowTitle(QString("RNR Studio")); + setWindowIcon(QIcon(pixmap)); + setCentralWidget(content_widget); +} + +void MainWindow::closeEvent(QCloseEvent* event) +{ + // +} \ No newline at end of file diff --git a/src/client/studio/main.cpp b/Projects/Client/Studio/Source/main.cpp similarity index 75% rename from src/client/studio/main.cpp rename to Projects/Client/Studio/Source/main.cpp index a3f60a0..aac9662 100644 --- a/src/client/studio/main.cpp +++ b/Projects/Client/Studio/Source/main.cpp @@ -1,8 +1,8 @@ -#include +#include #include -#include +#include int main(int argc, char** argv) { @@ -13,15 +13,14 @@ int main(int argc, char** argv) QSurfaceFormat::setDefaultFormat(format); QApplication app(argc, argv); - StudioWindow window = StudioWindow(); - + MainWindow window = MainWindow(); + window.show(); bool running = true; - while(running) + while (running) { app.processEvents(); - window.graphics_widget->update(); } } \ No newline at end of file diff --git a/Projects/Engine/CMakeLists.txt b/Projects/Engine/CMakeLists.txt new file mode 100644 index 0000000..664add5 --- /dev/null +++ b/Projects/Engine/CMakeLists.txt @@ -0,0 +1,21 @@ +project(Engine) + +add_library(engine STATIC + Header/Helpers/Name.hpp + Header/Helpers/Strings.hpp + Header/App/V8/DataModel/ForceField.hpp + Header/App/V8/Humanoid/Humanoid.hpp + Header/App/V8/World/World.hpp + Header/Network/GUID.hpp + Header/Rendering/Adorn.hpp + + Source/Helpers/Name.cpp + Source/Helpers/Strings.cpp + Source/App/V8/DataModel/ForceField.cpp + Source/App/V8/Humanoid/Humanoid.cpp + Source/App/V8/World/World.cpp + Source/Network/GUID.cpp + Source/Rendering/Adorn.cpp +) + +target_link_libraries(Engine PUBLIC ${BOOST_LIBRARIES} cglm) \ No newline at end of file diff --git a/src/engine/app/gui/.gitkeep b/Projects/Engine/Header/App/GUI/.gitkeep similarity index 100% rename from src/engine/app/gui/.gitkeep rename to Projects/Engine/Header/App/GUI/.gitkeep diff --git a/src/include/engine/app/humanoid/Humanoid.hpp b/Projects/Engine/Header/App/Humanoid/Humanoid.hpp similarity index 79% rename from src/include/engine/app/humanoid/Humanoid.hpp rename to Projects/Engine/Header/App/Humanoid/Humanoid.hpp index fcc2518..81769a2 100644 --- a/src/include/engine/app/humanoid/Humanoid.hpp +++ b/Projects/Engine/Header/App/Humanoid/Humanoid.hpp @@ -1,15 +1,11 @@ #pragma once -#include +#include namespace RNR { class Humanoid : Instance { - private: - float m_health; - float m_maxHealth; - float m_walkRotationalVelocity; public: Humanoid(); ~Humanoid(); @@ -17,8 +13,13 @@ namespace RNR bool canSit(); void buildJoints(); void checkForJointDeath(); - void computeForce(float force, bool something); + void computeForce(float force, bool throttling); void getTorso(); void getHead(); + + private: + float m_health; + float m_maxHealth; + float m_walkRotationalVelocity; }; } \ No newline at end of file diff --git a/src/engine/app/humanoid/.gitkeep b/Projects/Engine/Header/App/Script/.gitkeep similarity index 100% rename from src/engine/app/humanoid/.gitkeep rename to Projects/Engine/Header/App/Script/.gitkeep diff --git a/src/engine/app/lua/.gitkeep b/Projects/Engine/Header/App/Tool/.gitkeep similarity index 100% rename from src/engine/app/lua/.gitkeep rename to Projects/Engine/Header/App/Tool/.gitkeep diff --git a/Projects/Engine/Header/App/V8/DataModel/ForceField.hpp b/Projects/Engine/Header/App/V8/DataModel/ForceField.hpp new file mode 100644 index 0000000..f600b32 --- /dev/null +++ b/Projects/Engine/Header/App/V8/DataModel/ForceField.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace RNR +{ + class ForceField + { + public: + ForceField(); + ~ForceField(); + + void renderForceField(boost::shared_ptr* descendant, RNR::Adorn* adorn, int cycle); + } +} \ No newline at end of file diff --git a/src/engine/app/v8/kernel/.gitkeep b/Projects/Engine/Header/App/V8/Kernel/.gitkeep similarity index 100% rename from src/engine/app/v8/kernel/.gitkeep rename to Projects/Engine/Header/App/V8/Kernel/.gitkeep diff --git a/src/include/engine/app/v8/tree/Instance.hpp b/Projects/Engine/Header/App/V8/Tree/Instance.hpp similarity index 92% rename from src/include/engine/app/v8/tree/Instance.hpp rename to Projects/Engine/Header/App/V8/Tree/Instance.hpp index 2beabfc..81752e0 100644 --- a/src/include/engine/app/v8/tree/Instance.hpp +++ b/Projects/Engine/Header/App/V8/Tree/Instance.hpp @@ -1,9 +1,12 @@ #pragma once +#include #include -#include + #include +#include + namespace RNR { class Instance @@ -13,10 +16,12 @@ namespace RNR RNR::Instance* m_parent; std::vector> m_children; bool m_archivable; + public: Instance(); Instance(std::string name); - + ~Instance(); + bool contains(RNR::Instance* child); bool isAncestorOf(RNR::Instance* instance); @@ -36,6 +41,5 @@ namespace RNR int numChildren() { return this->m_children.size(); }; void onChildAdded(RNR::Instance* childAdded); - }; } \ No newline at end of file diff --git a/src/include/engine/app/v8/world/World.hpp b/Projects/Engine/Header/App/V8/World/World.hpp similarity index 100% rename from src/include/engine/app/v8/world/World.hpp rename to Projects/Engine/Header/App/V8/World/World.hpp diff --git a/Projects/Engine/Header/Helpers/Name.hpp b/Projects/Engine/Header/Helpers/Name.hpp new file mode 100644 index 0000000..ecef72d --- /dev/null +++ b/Projects/Engine/Header/Helpers/Name.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace RNR +{ + class Name + { + public: + char* c_str(); + + 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/Helpers/Strings.hpp b/Projects/Engine/Header/Helpers/Strings.hpp new file mode 100644 index 0000000..8e84720 --- /dev/null +++ b/Projects/Engine/Header/Helpers/Strings.hpp @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + +namespace RNR +{ + class Strings + { + public: + static uint8_t random_char(); + static std::string random_hex(const uint64_t length); + } +} \ No newline at end of file diff --git a/Projects/Engine/Header/Network/GUID.hpp b/Projects/Engine/Header/Network/GUID.hpp new file mode 100644 index 0000000..3cfd17d --- /dev/null +++ b/Projects/Engine/Header/Network/GUID.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include + +#include + +namespace RNR +{ + class GUID + { + public: + GUID(); + + std::string generateGUID(); + static void compare(RNR::GUID* a, RNR::GUID* b); + }; +} \ No newline at end of file diff --git a/src/engine/app/v8/model/.gitkeep b/Projects/Engine/Header/Network/RakNet/.gitkeep similarity index 100% rename from src/engine/app/v8/model/.gitkeep rename to Projects/Engine/Header/Network/RakNet/.gitkeep diff --git a/Projects/Engine/Header/Rendering/Adorn.hpp b/Projects/Engine/Header/Rendering/Adorn.hpp new file mode 100644 index 0000000..6fbd0dd --- /dev/null +++ b/Projects/Engine/Header/Rendering/Adorn.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include + +#include + +#include + +namespace RNR +{ + class Adorn + { + // + }; +} \ No newline at end of file diff --git a/src/engine/LICENSE b/Projects/Engine/LICENSE similarity index 100% rename from src/engine/LICENSE rename to Projects/Engine/LICENSE diff --git a/src/engine/app/v8/tree/.gitkeep b/Projects/Engine/Source/App/GUI/.gitkeep similarity index 100% rename from src/engine/app/v8/tree/.gitkeep rename to Projects/Engine/Source/App/GUI/.gitkeep diff --git a/Projects/Engine/Source/App/Humanoid/Humanoid.cpp b/Projects/Engine/Source/App/Humanoid/Humanoid.cpp new file mode 100644 index 0000000..13862e5 --- /dev/null +++ b/Projects/Engine/Source/App/Humanoid/Humanoid.cpp @@ -0,0 +1,44 @@ +#include + +namespace RNR +{ + Humanoid::Humanoid() + { + // + } + + Humanoid::~Humanoid() + { + // + } + + bool Humanoid::canSit() + { + return true; + } + + void Humanoid::buildJoints() + { + // + } + + void Humanoid::checkForJointDeath() + { + // + } + + void Humanoid::computeForce(float force, bool throttling) + { + // + } + + void Humanoid::getTorso() + { + // + } + + void Humanoid::getHead() + { + // + } +} \ No newline at end of file diff --git a/src/engine/app/v8/world/.gitkeep b/Projects/Engine/Source/App/Script/.gitkeep similarity index 100% rename from src/engine/app/v8/world/.gitkeep rename to Projects/Engine/Source/App/Script/.gitkeep diff --git a/src/engine/network/.gitkeep b/Projects/Engine/Source/App/Tool/.gitkeep similarity index 100% rename from src/engine/network/.gitkeep rename to Projects/Engine/Source/App/Tool/.gitkeep diff --git a/Projects/Engine/Source/App/V8/DataModel/ForceField.cpp b/Projects/Engine/Source/App/V8/DataModel/ForceField.cpp new file mode 100644 index 0000000..81b6b05 --- /dev/null +++ b/Projects/Engine/Source/App/V8/DataModel/ForceField.cpp @@ -0,0 +1,19 @@ +#include + +namespace RNR +{ + void ForceField::ForceField() + { + // + } + + void ForceField::~ForceField() + { + // + } + + void ForceField::renderForceField(boost::shared_ptr* descendant, RNR::Adorn* adorn, int cycle) + { + // + } +} \ No newline at end of file diff --git a/src/engine/network/raknet/.gitkeep b/Projects/Engine/Source/App/V8/Kernel/.gitkeep similarity index 100% rename from src/engine/network/raknet/.gitkeep rename to Projects/Engine/Source/App/V8/Kernel/.gitkeep diff --git a/Projects/Engine/Source/App/V8/Tree/Instance.cpp b/Projects/Engine/Source/App/V8/Tree/Instance.cpp new file mode 100644 index 0000000..02cd104 --- /dev/null +++ b/Projects/Engine/Source/App/V8/Tree/Instance.cpp @@ -0,0 +1,111 @@ +#include + +namespace RNR +{ + Instance::Instance() + { + // + } + + Instance::Instance(std::string name) + { + // + } + + bool Instance::contains(RNR::Instance* child) + { + auto child_it = std::find(m_children.begin(), m_children.end(), (boost::shared_ptr)child); + + return child_it != m_children.end(); + } + + bool RNR::Instance::isAncestorOf(RNR::Instance* instance) + { + RNR::Instance* instance_parent = instance->m_parent; + while (instance_parent != 0) + { + instance_parent = instance_parent->m_parent; + + if (instance_parent == this) + return true; + } + + return false; + } + + bool RNR::Instance::askSetParent(RNR::Instance* instance) + { + return true; + } + + bool RNR::Instance::canSetParent(RNR::Instance* instance) + { + return !instance || instance->canAddChild(this); + } + + bool RNR::Instance::askAddChild(RNR::Instance* instance) + { + return true; + } + + bool RNR::Instance::canAddChild(RNR::Instance* instance) + { + if (instance->contains(this) || instance->m_parent == this) + return false; + + if (askAddChild(instance)) + return true; + + return instance->askSetParent(this); + } + + void RNR::Instance::setName(std::string name) + { + if (name != this->m_name) + { + this->m_name = name; + // raise property changed + } + } + + void RNR::Instance::setParent(RNR::Instance* newParent) + { + if (newParent != m_parent) + { + char error_text[255]; + if (this == newParent) + { + snprintf(error_text, 255, "Attempt to set %s as its own parent", m_name); + throw std::runtime_error(error_text); + } + if (isAncestorOf(newParent)) + { + snprintf(error_text, 255, "Attempt to set parent of %s to %s results in circular reference", newParent->getName(), m_name); + throw std::runtime_error(error_text); + } + + if (m_parent) + { + std::vector>* children = m_parent->getChildren(); + auto child_it = std::find(children->begin(), children->end(), (boost::shared_ptr)this); + + if (child_it != children->end()) + children->erase(child_it); + + if (m_parent->numChildren() == 0) + { + // signal onlastchildremoved + } + } + + m_parent = newParent; + m_parent->m_children.push_back((boost::shared_ptr)this); + newParent->onChildAdded(this); + } + } + + void RNR::Instance::onChildAdded(RNR::Instance* childAdded) + { + // + } +} \ No newline at end of file diff --git a/Projects/Engine/Source/App/V8/World/World.cpp b/Projects/Engine/Source/App/V8/World/World.cpp new file mode 100644 index 0000000..72a9d22 --- /dev/null +++ b/Projects/Engine/Source/App/V8/World/World.cpp @@ -0,0 +1,29 @@ +#include + +namespace RNR +{ + World::World() + { + // + } + + World::~World() + { + // + } + + void World::preStep() + { + // + } + + double World::step(float timestep) + { + // + } + + void World::update() + { + // + } +} \ No newline at end of file diff --git a/Projects/Engine/Source/Helpers/Name.cpp b/Projects/Engine/Source/Helpers/Name.cpp new file mode 100644 index 0000000..5e411c6 --- /dev/null +++ b/Projects/Engine/Source/Helpers/Name.cpp @@ -0,0 +1,21 @@ +#include + +namespace RNR +{ + std::map* Name::dictionary = new std::map(); + + char* Name::c_str() + { + // + } + + static void Name::compare(const RNR::Name* a, const RNR::Name* b) + { + // + } + + static void Name::declare(const char* sName, int dictionaryIndex) + { + // + } +} \ No newline at end of file diff --git a/Projects/Engine/Source/Helpers/Strings.cpp b/Projects/Engine/Source/Helpers/Strings.cpp new file mode 100644 index 0000000..2ee7ad3 --- /dev/null +++ b/Projects/Engine/Source/Helpers/Strings.cpp @@ -0,0 +1,28 @@ +#include + +namespace RNR +{ + static uint8_t Strings::random_char() + { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(0, 255); + return static_cast(dis(gen)); + } + + static std::string Strings::random_hex(const uint64_t length) + { + std::stringstream result; + + for (uint64_t i = 0; i < length; i++) + { + uint8_t rc = random_char(); + std::stringstream hexstream; + hexstream << std::hex << int(rc); + std::string hex = hexstream.str(); + result << (hex.length() < 2 ? '0' + hex : hex); + } + + return result.str(); + } +} \ No newline at end of file diff --git a/Projects/Engine/Source/Network/GUID.cpp b/Projects/Engine/Source/Network/GUID.cpp new file mode 100644 index 0000000..10fb9ad --- /dev/null +++ b/Projects/Engine/Source/Network/GUID.cpp @@ -0,0 +1,19 @@ +#include + +namespace RNR +{ + Guid::Guid() + { + + } + + void Guid::compare(Guid* a, Guid* b) + { + + } + + std::string Guid::generateGUID() + { + return "RBX" + Strings::generateRandomString(16); + } +} \ No newline at end of file diff --git a/src/engine/rendering/.gitkeep b/Projects/Engine/Source/Network/RakNet/.gitkeep similarity index 100% rename from src/engine/rendering/.gitkeep rename to Projects/Engine/Source/Network/RakNet/.gitkeep diff --git a/Projects/Engine/Source/Rendering/Adorn.cpp b/Projects/Engine/Source/Rendering/Adorn.cpp new file mode 100644 index 0000000..d345f1b --- /dev/null +++ b/Projects/Engine/Source/Rendering/Adorn.cpp @@ -0,0 +1,6 @@ +#include + +namespace RNR +{ + // +} \ No newline at end of file diff --git a/README.md b/README.md index c194598..937bef1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # RNR -RNR (**R**NR's **N**ot **R**oblox) is a project that aims to recreate the look and feel of classic Roblox while bringing in new features as well as remaining fully compatible with clients from that era. +RNR (**R**NR's **N**ot **R**oblox) is a project that aims to recreate the look and feel of classic Roblox with extra features while remaining fully compatible with clients from that era. Interested in contributing? [Feel free to make a pull request!](https://github.com/kiseki-lol/RNR/pulls) @@ -8,11 +8,13 @@ There are several goals that RNR seeks to achieve, those being; - Full native x64 support on Windows and Linux - Efficient and powerful renderer built from scratch (with only OpenGL support for the time being) - Easy-to-use (simple CLI options to launch and host games, as well as a level editor with a modern UI) -- Fully compatible with Roblox versions up to 0.3.744.0 (dated April 2008) in areas such as hosting, joining, level file serialization, etc. -- Incorporates all the various facets of the Roblox engine, with a little bit extra (e.g. a network replication whitelist, fancy shader support, etc.) +- Fully compatible with Roblox versions up to 0.3.744.0 (dated April 2008) in areas such as hosting, joining, levels, etc. +- Incorporates all the various facets of the Roblox engine, plus a little bit extra (e.g. a network replication whitelist, fancy shader support, etc.) - Made with clean-room reverse engineering +- Uses Roblox's [Luau](https://github.com/roblox/luau) as its scripting language while remaining fully compatible with classic Roblox scripts written using Lua 5.1 - As free and open-source as is possible (with client code being licensed under the GPL and the engine itself released into the public domain, void of any copyright) -- Patching all the security vulnerabilities and bugs that legacy Roblox clients had +- Patching all the security vulnerabilities and fixing bugs/inefficiencies that legacy Roblox clients had +- Quick build times # Building RNR uses [CMake](https://cmake.org/) as its build system and [GCC](https://gcc.gnu.org/) as its compiler. To build RNR, you must first have the following packages installed: @@ -24,13 +26,13 @@ For Windows: - If you're *targeting* Windows, [MinGW-w64](https://www.mingw-w64.org/) is the preferred toolset of choice. - If you're *building on* Windows, you may use a platform such as [MSYS2](https://www.msys2.org/), which provides an all-in-one environment for running MinGW or GCC. -Additionally, you must also acquire the content folder of the Roblox client you would like to use its resources from and place it in `rsc/content`. Proprietary Roblox assets are not included with RNR. +Additionally, you must also acquire the content folder of the Roblox client you would like to use its resources from and place it in the root of the repository. Proprietary Roblox assets are not included with RNR. Finally, you may run `cmake --build .` in the path of the folder you've cloned the repository to so that you may configure and then finally build RNR. # License RNR is licensed under two separate licenses: -- The bulk of the code (which includes the player, studio, and server projects) are all licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.txt) license. -- The RNR engine is licensed under the [Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt) license. +- The bulk of RNR (which includes the player, studio, and server projects) are all licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.txt) license. +- The RNR engine itself is licensed under the [Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt) license. Copies of both licenses have been bundled with RNR. \ No newline at end of file diff --git a/cmake/resource.cmake b/cmake/resource.cmake deleted file mode 100644 index f23c3b9..0000000 --- a/cmake/resource.cmake +++ /dev/null @@ -1,11 +0,0 @@ -function(create_resources dir output) - file(WRITE ${output} "") - file(GLOB bins ${dir}/*) - foreach(bin ${bins}) - string(REGEX MATCH "([^/]+)$" filename ${bin}) - string(REGEX REPLACE "\\.| |-" "_" filename ${filename}) - file(READ ${bin} filedata HEX) - string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," filedata ${filedata}) - file(APPEND ${output} "const unsigned char ${filename}[] = {${filedata}};\nconst unsigned long long ${filename}_size = sizeof(${filename});\n") - endforeach() -endfunction() \ No newline at end of file diff --git a/rsc/README b/rsc/README deleted file mode 100644 index 8483602..0000000 --- a/rsc/README +++ /dev/null @@ -1,3 +0,0 @@ -# /rsc - -These are files that will be embedded in their respective projects. \ No newline at end of file diff --git a/src/client/common/Adorn.cpp b/src/client/common/Adorn.cpp deleted file mode 100644 index ee824f6..0000000 --- a/src/client/common/Adorn.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -GL::Adorn::Adorn() -{ - -} \ No newline at end of file diff --git a/src/client/common/RNRGraphicsWidget.cpp b/src/client/common/RNRGraphicsWidget.cpp deleted file mode 100644 index e60cc6b..0000000 --- a/src/client/common/RNRGraphicsWidget.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include - -RNRGraphicsWidget::RNRGraphicsWidget(QWidget* parent) : QOpenGLWidget(parent) -{ - gl_adorn = new GL::Adorn(); -} - -void RNRGraphicsWidget::initializeGL() -{ - printf("qt_common: initializeGL\n"); - - if(gladLoadGL()) { - printf("gl: initialized\n"); - } -} - -void RNRGraphicsWidget::paintGL() -{ - this->delta_time = ((double)timer.elapsed())/1000.0; - timer.start(); -} - -void RNRGraphicsWidget::resizeGL(int w, int h) -{ - printf("qt_common: resizeGL %i %i\n", w, h); -} \ No newline at end of file diff --git a/src/client/player/main.cpp b/src/client/player/main.cpp deleted file mode 100644 index 9bbfa18..0000000 --- a/src/client/player/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char** argv) -{ - printf("Hi\n"); -} \ No newline at end of file diff --git a/src/client/server/main.cpp b/src/client/server/main.cpp deleted file mode 100644 index e5ecee2..0000000 --- a/src/client/server/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() -{ - printf("Hello world!"); -} \ No newline at end of file diff --git a/src/client/studio/StudioWindow.cpp b/src/client/studio/StudioWindow.cpp deleted file mode 100644 index 953dc5b..0000000 --- a/src/client/studio/StudioWindow.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -#include "studio_rsc.h" - -StudioWindow::StudioWindow() -{ - setWindowTitle(QString("RNR Studio")); - - QPixmap icon_pixmap = QPixmap(); - icon_pixmap.loadFromData(icon_png, icon_png_size); - - QWidget *content_widget = new QWidget(); - QGridLayout* grid = new QGridLayout(); - - this->graphics_widget = new RNRGraphicsWidget(); - - grid->addWidget(this->graphics_widget, 0, 0, 1, 1); - - content_widget->setLayout(grid); - setCentralWidget(content_widget); - setWindowIcon(QIcon(icon_pixmap)); -} - -void StudioWindow::closeEvent(QCloseEvent* event) -{ - -} \ No newline at end of file diff --git a/src/engine/app/Name.cpp b/src/engine/app/Name.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/src/engine/app/gui/Adorn.cpp b/src/engine/app/gui/Adorn.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/src/engine/app/humanoid/Forcefield.cpp b/src/engine/app/humanoid/Forcefield.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/src/engine/app/humanoid/Humanoid.cpp b/src/engine/app/humanoid/Humanoid.cpp deleted file mode 100644 index 69cca13..0000000 --- a/src/engine/app/humanoid/Humanoid.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -RNR::Humanoid::Humanoid() -{ - this->setName("Humanoid"); -} \ No newline at end of file diff --git a/src/engine/app/v8/tree/Instance.cpp b/src/engine/app/v8/tree/Instance.cpp deleted file mode 100644 index c3f16ea..0000000 --- a/src/engine/app/v8/tree/Instance.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include -#include - -RNR::Instance::Instance() -{ - -} - -RNR::Instance::Instance(std::string name) -{ - -} - -bool RNR::Instance::contains(RNR::Instance* child) -{ - auto child_it = std::find(m_children.begin(), m_children.end(), (boost::shared_ptr)child); - if(child_it != m_children.end()) - return true; - return false; -} - -bool RNR::Instance::isAncestorOf(RNR::Instance* instance) -{ - RNR::Instance* instance_parent = instance->m_parent; - while(instance_parent != 0) - { - instance_parent = instance_parent->m_parent; - if(instance_parent == this) - return true; - } - return false; -} - -bool RNR::Instance::askSetParent(RNR::Instance* instance) -{ - return true; -} - -bool RNR::Instance::canSetParent(RNR::Instance* instance) -{ - return !instance || instance->canAddChild(this); -} - -bool RNR::Instance::askAddChild(RNR::Instance* instance) -{ - return true; -} - -bool RNR::Instance::canAddChild(RNR::Instance* instance) -{ - if(instance->contains(this) || instance->m_parent == this) - return false; - if(askAddChild(instance)) - return true; - return instance->askSetParent(this); -} - -void RNR::Instance::setName(std::string name) -{ - if(name != this->m_name) - { - this->m_name = name; - // raise property changed - } -} - -void RNR::Instance::setParent(RNR::Instance* newParent) -{ - if(newParent != m_parent) - { - char error_text[255]; - if(this == newParent) - { - snprintf(error_text, 255, "Attempt to set %s as its own parent", m_name); - throw std::runtime_error(error_text); - } - if(isAncestorOf(newParent)) - { - snprintf(error_text, 255, "Attempt to set parent of %s to %s results in circular reference", newParent->getName(), m_name); - throw std::runtime_error(error_text); - } - - if(m_parent) - { - std::vector>* children = m_parent->getChildren(); - auto child_it = std::find(children->begin(), children->end(), (boost::shared_ptr)this); - if(child_it != children->end()) - children->erase(child_it); - if(m_parent->numChildren() == 0) - { - // signal onlastchildremoved - } - } - - m_parent = newParent; - m_parent->m_children.push_back((boost::shared_ptr)this); - newParent->onChildAdded(this); - } -} - -void RNR::Instance::onChildAdded(RNR::Instance* childAdded) -{ - -} \ No newline at end of file diff --git a/src/engine/app/v8/world/World.cpp b/src/engine/app/v8/world/World.cpp deleted file mode 100644 index 72cedca..0000000 --- a/src/engine/app/v8/world/World.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -RNR::World::World() -{ - -} - -void RNR::World::preStep() -{ - -} - -double RNR::World::step(float timestep) -{ - -} - -void RNR::World::update() -{ - -} \ No newline at end of file diff --git a/src/engine/network/Guid.cpp b/src/engine/network/Guid.cpp deleted file mode 100644 index eb5c737..0000000 --- a/src/engine/network/Guid.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include - -RNR::Guid::Guid() -{ - -} - -void RNR::Guid::compare(RNR::Guid* a, RNR::Guid* b) -{ - -} - -void RNR::Guid::generateGUID(std::string* result) -{ - -} \ No newline at end of file diff --git a/src/engine/rendering/g3d/.gitkeep b/src/engine/rendering/g3d/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/engine/utilities/.gitkeep b/src/engine/utilities/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/include/client/common/Adorn.hpp b/src/include/client/common/Adorn.hpp deleted file mode 100644 index 240f6b8..0000000 --- a/src/include/client/common/Adorn.hpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#pragma once - -// TODO: add G3D - -namespace GL -{ - // 2d rendering api - class Adorn : public RNR::Adorn - { - public: - Adorn(); - - }; -} \ No newline at end of file diff --git a/src/include/client/common/RNRGraphicsWidget.hpp b/src/include/client/common/RNRGraphicsWidget.hpp deleted file mode 100644 index eb87d94..0000000 --- a/src/include/client/common/RNRGraphicsWidget.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class RNRGraphicsWidget : public QOpenGLWidget -{ - Q_OBJECT - -public: - RNRGraphicsWidget(QWidget* parent = nullptr); - - double delta_time; - - GL::Adorn* gl_adorn; -protected: - virtual void paintGL(); - virtual void initializeGL(); - virtual void resizeGL(int w, int h); -private: - QElapsedTimer timer; -}; \ No newline at end of file diff --git a/src/include/client/server/.gitkeep b/src/include/client/server/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/include/client/studio/StudioWindow.hpp b/src/include/client/studio/StudioWindow.hpp deleted file mode 100644 index b7c605d..0000000 --- a/src/include/client/studio/StudioWindow.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class StudioWindow : public QMainWindow -{ - Q_OBJECT - - public: - StudioWindow(); - - RNRGraphicsWidget* graphics_widget; - QTreeWidget* datamodel_tree; - protected: - void closeEvent(QCloseEvent* event); -}; \ No newline at end of file diff --git a/src/include/engine/LICENSE b/src/include/engine/LICENSE deleted file mode 100644 index 3bbbc1e..0000000 --- a/src/include/engine/LICENSE +++ /dev/null @@ -1,116 +0,0 @@ -CC0 1.0 Universal - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator and -subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for the -purpose of contributing to a commons of creative, cultural and scientific -works ("Commons") that the public can reliably and without fear of later -claims of infringement build upon, modify, incorporate in other works, reuse -and redistribute as freely as possible in any form whatsoever and for any -purposes, including without limitation commercial purposes. These owners may -contribute to the Commons to promote the ideal of a free culture and the -further production of creative, cultural and scientific works, or to gain -reputation or greater distribution for their Work in part through the use and -efforts of others. - -For these and/or other purposes and motivations, and without any expectation -of additional consideration or compensation, the person associating CC0 with a -Work (the "Affirmer"), to the extent that he or she is an owner of Copyright -and Related Rights in the Work, voluntarily elects to apply CC0 to the Work -and publicly distribute the Work under its terms, with knowledge of his or her -Copyright and Related Rights in the Work and the meaning and intended legal -effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not limited -to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, communicate, - and translate a Work; - - ii. moral rights retained by the original author(s) and/or performer(s); - - iii. publicity and privacy rights pertaining to a person's image or likeness - depicted in a Work; - - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - - v. rights protecting the extraction, dissemination, use and reuse of data in - a Work; - - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation thereof, - including any amended or successor version of such directive); and - - vii. other similar, equivalent or corresponding rights throughout the world - based on applicable law or treaty, and any national implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention of, -applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and -unconditionally waives, abandons, and surrenders all of Affirmer's Copyright -and Related Rights and associated claims and causes of action, whether now -known or unknown (including existing as well as future claims and causes of -action), in the Work (i) in all territories worldwide, (ii) for the maximum -duration provided by applicable law or treaty (including future time -extensions), (iii) in any current or future medium and for any number of -copies, and (iv) for any purpose whatsoever, including without limitation -commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes -the Waiver for the benefit of each member of the public at large and to the -detriment of Affirmer's heirs and successors, fully intending that such Waiver -shall not be subject to revocation, rescission, cancellation, termination, or -any other legal or equitable action to disrupt the quiet enjoyment of the Work -by the public as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. Should any part of the Waiver for any reason be -judged legally invalid or ineffective under applicable law, then the Waiver -shall be preserved to the maximum extent permitted taking into account -Affirmer's express Statement of Purpose. In addition, to the extent the Waiver -is so judged Affirmer hereby grants to each affected person a royalty-free, -non transferable, non sublicensable, non exclusive, irrevocable and -unconditional license to exercise Affirmer's Copyright and Related Rights in -the Work (i) in all territories worldwide, (ii) for the maximum duration -provided by applicable law or treaty (including future time extensions), (iii) -in any current or future medium and for any number of copies, and (iv) for any -purpose whatsoever, including without limitation commercial, advertising or -promotional purposes (the "License"). The License shall be deemed effective as -of the date CC0 was applied by Affirmer to the Work. Should any part of the -License for any reason be judged legally invalid or ineffective under -applicable law, such partial invalidity or ineffectiveness shall not -invalidate the remainder of the License, and in such case Affirmer hereby -affirms that he or she will not (i) exercise any of his or her remaining -Copyright and Related Rights in the Work or (ii) assert any associated claims -and causes of action with respect to the Work, in either case contrary to -Affirmer's express Statement of Purpose. - -4. Limitations and Disclaimers. - - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - - b. Affirmer offers the Work as-is and makes no representations or warranties - of any kind concerning the Work, express, implied, statutory or otherwise, - including without limitation warranties of title, merchantability, fitness - for a particular purpose, non infringement, or the absence of latent or - other defects, accuracy, or the present or absence of errors, whether or not - discoverable, all to the greatest extent permissible under applicable law. - - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without limitation - any person's Copyright and Related Rights in the Work. Further, Affirmer - disclaims responsibility for obtaining any necessary consents, permissions - or other rights required for any use of the Work. - - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to this - CC0 or use of the Work. - -For more information, please see - \ No newline at end of file diff --git a/src/include/engine/app/Name.hpp b/src/include/engine/app/Name.hpp deleted file mode 100644 index 32fb2db..0000000 --- a/src/include/engine/app/Name.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include - -namespace RNR -{ - class Name - { - public: - - char* c_str(); - - 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/src/include/engine/app/gui/Adorn.hpp b/src/include/engine/app/gui/Adorn.hpp deleted file mode 100644 index 4a3ad51..0000000 --- a/src/include/engine/app/gui/Adorn.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include -#include -#include - -// TODO: add G3D - -namespace RNR -{ - // 2d rendering api - class Adorn - { - public: - - }; -} \ No newline at end of file diff --git a/src/include/engine/app/humanoid/Forcefield.hpp b/src/include/engine/app/humanoid/Forcefield.hpp deleted file mode 100644 index 257f853..0000000 --- a/src/include/engine/app/humanoid/Forcefield.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -namespace RNR -{ - void renderForceField(boost::shared_ptr *descendant, RNR::Adorn *adorn, int cycle); -} \ No newline at end of file diff --git a/src/include/engine/app/lua/.gitkeep b/src/include/engine/app/lua/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/include/engine/app/v8/kernel/.gitkeep b/src/include/engine/app/v8/kernel/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/include/engine/app/v8/model/.gitkeep b/src/include/engine/app/v8/model/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/include/engine/network/Guid.hpp b/src/include/engine/network/Guid.hpp deleted file mode 100644 index 05fea9b..0000000 --- a/src/include/engine/network/Guid.hpp +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -namespace RNR -{ - class Guid - { - public: - Guid(); - - static void generateGUID(std::string *result); - static void compare(RNR::Guid* a, RNR::Guid* b); - }; -} \ No newline at end of file diff --git a/src/include/engine/network/raknet/.gitkeep b/src/include/engine/network/raknet/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/include/engine/rendering/.gitkeep b/src/include/engine/rendering/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/include/engine/rendering/TextureProxyBase.hpp b/src/include/engine/rendering/TextureProxyBase.hpp deleted file mode 100644 index a9f381f..0000000 --- a/src/include/engine/rendering/TextureProxyBase.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -namespace RNR -{ - class TextureProxyBase - { - - }; -} \ No newline at end of file diff --git a/src/include/engine/utilities/.gitkeep b/src/include/engine/utilities/.gitkeep deleted file mode 100644 index e69de29..0000000