Overhaul everything (and close #1)
This commit is contained in:
parent
7228e1e26e
commit
e3d4763a19
|
|
@ -1 +1,2 @@
|
||||||
glad/** linguist-vendored
|
# Ignore GLAD generated API files
|
||||||
|
glad.* linguist-vendored
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "Dependencies/Luau"]
|
||||||
|
path = Dependencies/Luau
|
||||||
|
url = https://github.com/roblox/luau
|
||||||
|
|
@ -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 <stdint.h>\n\n")
|
||||||
|
file(APPEND ${output} "const uint8_t ${filename}[] = { ${filedata} };\n")
|
||||||
|
file(APPEND ${output} "const uint64_t ${filename}_size = sizeof(${filename});")
|
||||||
|
endforeach()
|
||||||
|
endfunction()
|
||||||
|
|
@ -1,88 +1,18 @@
|
||||||
cmake_minimum_required(VERSION 3.4)
|
cmake_minimum_required(VERSION 3.4)
|
||||||
|
|
||||||
include(cmake/resource.cmake)
|
project(RNR)
|
||||||
|
|
||||||
project(engine)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
project(player)
|
|
||||||
project(server)
|
|
||||||
project(studio)
|
|
||||||
|
|
||||||
option(COMPILE_PLAYER "Compile the RNR Player" ON)
|
include(CMake/CreateResources.cmake)
|
||||||
option(COMPILE_SERVER "Compile the RNR Server" ON)
|
|
||||||
option(COMPILE_STUDIO "Compile the RNR Studio" ON)
|
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(Boost REQUIRED)
|
||||||
find_package(cglm REQUIRED CONFIG)
|
find_package(cglm REQUIRED CONFIG)
|
||||||
|
|
||||||
add_library(engine STATIC
|
add_subdirectory(Projects)
|
||||||
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()
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e25de95445f2d635a125ab463426bb7fda017093
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -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()
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Rendering/Adorn.hpp>
|
||||||
|
|
||||||
|
namespace GL
|
||||||
|
{
|
||||||
|
class Adorn : public RNR::Adorn
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Adorn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <cglm/cglm.h>
|
#include <cglm/cglm.h>
|
||||||
|
|
||||||
namespace GL
|
namespace GL
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QOpenGLWidget>
|
||||||
|
#include <QElapsedTimer>
|
||||||
|
#include <glad/glad.h>
|
||||||
|
|
||||||
|
#include <GL/Adorn.hpp>
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include <GL/Adorn.hpp>
|
||||||
|
|
||||||
|
namespace GL
|
||||||
|
{
|
||||||
|
Adorn::Adorn()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
#include <GL/Widget.hpp>
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
class MainWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
MainWindow();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent* event);
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include <MainWindow.hpp>
|
||||||
|
|
||||||
|
MainWindow::MainWindow()
|
||||||
|
{
|
||||||
|
QPixmap pixmap = QPixmap();
|
||||||
|
pixmap.loadFromData(icon, icon_size);
|
||||||
|
|
||||||
|
setWindowTitle(QString("RNR"));
|
||||||
|
setWindowIcon(QIcon(pixmap));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::closeEvent(QCloseEvent* event)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include <stdio>
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
|
#include <MainWindow.hpp>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
MainWindow window = MainWindow();
|
||||||
|
|
||||||
|
window.show();
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include <stdio>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
printf("RNR Server\n");
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QTreeWidget>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include <GL/Widget.hpp>
|
||||||
|
|
||||||
|
class MainWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
MainWindow();
|
||||||
|
|
||||||
|
GL::Widget* widget;
|
||||||
|
QTreeWidget* explorer;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent* event);
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
|
@ -0,0 +1,23 @@
|
||||||
|
#include <MainWindow.hpp>
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include <client/studio/StudioWindow.hpp>
|
#include <MainWindow.hpp>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
@ -13,15 +13,14 @@ int main(int argc, char** argv)
|
||||||
QSurfaceFormat::setDefaultFormat(format);
|
QSurfaceFormat::setDefaultFormat(format);
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
StudioWindow window = StudioWindow();
|
MainWindow window = MainWindow();
|
||||||
|
|
||||||
window.show();
|
window.show();
|
||||||
|
|
||||||
bool running = true;
|
bool running = true;
|
||||||
while(running)
|
while (running)
|
||||||
{
|
{
|
||||||
app.processEvents();
|
app.processEvents();
|
||||||
|
|
||||||
window.graphics_widget->update();
|
window.graphics_widget->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <engine/app/v8/tree/Instance.hpp>
|
#include <App/V8/Tree/Instance.hpp>
|
||||||
|
|
||||||
namespace RNR
|
namespace RNR
|
||||||
{
|
{
|
||||||
class Humanoid : Instance
|
class Humanoid : Instance
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
float m_health;
|
|
||||||
float m_maxHealth;
|
|
||||||
float m_walkRotationalVelocity;
|
|
||||||
public:
|
public:
|
||||||
Humanoid();
|
Humanoid();
|
||||||
~Humanoid();
|
~Humanoid();
|
||||||
|
|
@ -17,8 +13,13 @@ namespace RNR
|
||||||
bool canSit();
|
bool canSit();
|
||||||
void buildJoints();
|
void buildJoints();
|
||||||
void checkForJointDeath();
|
void checkForJointDeath();
|
||||||
void computeForce(float force, bool something);
|
void computeForce(float force, bool throttling);
|
||||||
void getTorso();
|
void getTorso();
|
||||||
void getHead();
|
void getHead();
|
||||||
|
|
||||||
|
private:
|
||||||
|
float m_health;
|
||||||
|
float m_maxHealth;
|
||||||
|
float m_walkRotationalVelocity;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Rendering/Adorn.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
class ForceField
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ForceField();
|
||||||
|
~ForceField();
|
||||||
|
|
||||||
|
void renderForceField(boost::shared_ptr<RNR::Instance>* descendant, RNR::Adorn* adorn, int cycle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <engine/app/Name.hpp>
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
|
#include <App/Helpers/Name.hpp>
|
||||||
|
|
||||||
namespace RNR
|
namespace RNR
|
||||||
{
|
{
|
||||||
class Instance
|
class Instance
|
||||||
|
|
@ -13,10 +16,12 @@ namespace RNR
|
||||||
RNR::Instance* m_parent;
|
RNR::Instance* m_parent;
|
||||||
std::vector<boost::shared_ptr<RNR::Instance>> m_children;
|
std::vector<boost::shared_ptr<RNR::Instance>> m_children;
|
||||||
bool m_archivable;
|
bool m_archivable;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Instance();
|
Instance();
|
||||||
Instance(std::string name);
|
Instance(std::string name);
|
||||||
|
~Instance();
|
||||||
|
|
||||||
bool contains(RNR::Instance* child);
|
bool contains(RNR::Instance* child);
|
||||||
bool isAncestorOf(RNR::Instance* instance);
|
bool isAncestorOf(RNR::Instance* instance);
|
||||||
|
|
||||||
|
|
@ -36,6 +41,5 @@ namespace RNR
|
||||||
int numChildren() { return this->m_children.size(); };
|
int numChildren() { return this->m_children.size(); };
|
||||||
|
|
||||||
void onChildAdded(RNR::Instance* childAdded);
|
void onChildAdded(RNR::Instance* childAdded);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
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<int, RNR::Name*>* dictionary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
class Strings
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static uint8_t random_char();
|
||||||
|
static std::string random_hex(const uint64_t length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <App/Helpers/Strings.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
class GUID
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GUID();
|
||||||
|
|
||||||
|
std::string generateGUID();
|
||||||
|
static void compare(RNR::GUID* a, RNR::GUID* b);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <cglm/cglm.h>
|
||||||
|
|
||||||
|
#include <App/Rendering/TextureProxyBase.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
class Adorn
|
||||||
|
{
|
||||||
|
//
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
#include <App/Humanoid/Humanoid.hpp>
|
||||||
|
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include <App/V8/DataModel/ForceField.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
void ForceField::ForceField()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
void ForceField::~ForceField()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
void ForceField::renderForceField(boost::shared_ptr<RNR::Instance>* descendant, RNR::Adorn* adorn, int cycle)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
#include <App/V8/Tree/Instance.hpp>
|
||||||
|
|
||||||
|
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<RNR::Instance>)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<boost::shared_ptr<RNR::Instance>>* children = m_parent->getChildren();
|
||||||
|
auto child_it = std::find(children->begin(), children->end(), (boost::shared_ptr<RNR::Instance>)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<RNR::Instance>)this);
|
||||||
|
newParent->onChildAdded(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RNR::Instance::onChildAdded(RNR::Instance* childAdded)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
#include <App/V8/World/World.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
World::World()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
World::~World()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
void World::preStep()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
double World::step(float timestep)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
void World::update()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
#include <Helpers/Name.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
std::map<int, RNR::Name*>* Name::dictionary = new std::map<int, RNR::Name*>();
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
#include <App/Helpers/Strings.hpp>
|
||||||
|
|
||||||
|
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<uint8_t>(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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include <Network/Guid.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
Guid::Guid()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Guid::compare(Guid* a, Guid* b)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Guid::generateGUID()
|
||||||
|
{
|
||||||
|
return "RBX" + Strings::generateRandomString(16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include <App/Rendering/Adorn.hpp>
|
||||||
|
|
||||||
|
namespace RNR
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
16
README.md
16
README.md
|
|
@ -1,5 +1,5 @@
|
||||||
# RNR
|
# 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)
|
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
|
- Full native x64 support on Windows and Linux
|
||||||
- Efficient and powerful renderer built from scratch (with only OpenGL support for the time being)
|
- 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)
|
- 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.
|
- 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, with a little bit extra (e.g. a network replication whitelist, fancy shader support, 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
|
- 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)
|
- 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
|
# 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:
|
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 *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.
|
- 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.
|
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
|
# License
|
||||||
RNR is licensed under two separate licenses:
|
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 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 is licensed under the [Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/legalcode.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.
|
Copies of both licenses have been bundled with RNR.
|
||||||
|
|
@ -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()
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
# /rsc
|
|
||||||
|
|
||||||
These are files that will be embedded in their respective projects.
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#include <client/common/Adorn.hpp>
|
|
||||||
|
|
||||||
GL::Adorn::Adorn()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
#include <client/common/RNRGraphicsWidget.hpp>
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
printf("Hi\n");
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
printf("Hello world!");
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
#include <client/studio/StudioWindow.hpp>
|
|
||||||
#include <QGridLayout>
|
|
||||||
#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)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#include <engine/app/humanoid/Humanoid.hpp>
|
|
||||||
|
|
||||||
RNR::Humanoid::Humanoid()
|
|
||||||
{
|
|
||||||
this->setName("Humanoid");
|
|
||||||
}
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
#include <engine/app/v8/tree/Instance.hpp>
|
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
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<RNR::Instance>)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<boost::shared_ptr<RNR::Instance>>* children = m_parent->getChildren();
|
|
||||||
auto child_it = std::find(children->begin(), children->end(), (boost::shared_ptr<RNR::Instance>)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<RNR::Instance>)this);
|
|
||||||
newParent->onChildAdded(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void RNR::Instance::onChildAdded(RNR::Instance* childAdded)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
#include <engine/app/v8/world/World.hpp>
|
|
||||||
|
|
||||||
RNR::World::World()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void RNR::World::preStep()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
double RNR::World::step(float timestep)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void RNR::World::update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#include <engine/network/Guid.hpp>
|
|
||||||
|
|
||||||
RNR::Guid::Guid()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void RNR::Guid::compare(RNR::Guid* a, RNR::Guid* b)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void RNR::Guid::generateGUID(std::string* result)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
#include <engine/app/gui/Adorn.hpp>
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
// TODO: add G3D
|
|
||||||
|
|
||||||
namespace GL
|
|
||||||
{
|
|
||||||
// 2d rendering api
|
|
||||||
class Adorn : public RNR::Adorn
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Adorn();
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <glad/glad.h>
|
|
||||||
#include <QOpenGLWidget>
|
|
||||||
#include <QElapsedTimer>
|
|
||||||
#include <client/common/Adorn.hpp>
|
|
||||||
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QMainWindow>
|
|
||||||
#include <QTreeWidget>
|
|
||||||
#include <client/common/RNRGraphicsWidget.hpp>
|
|
||||||
#include <QTimer>
|
|
||||||
|
|
||||||
class StudioWindow : public QMainWindow
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
StudioWindow();
|
|
||||||
|
|
||||||
RNRGraphicsWidget* graphics_widget;
|
|
||||||
QTreeWidget* datamodel_tree;
|
|
||||||
protected:
|
|
||||||
void closeEvent(QCloseEvent* event);
|
|
||||||
};
|
|
||||||
|
|
@ -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
|
|
||||||
<http://creativecommons.org/publicdomain/zero/1.0/>
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
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<int, RNR::Name*>* dictionary();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <engine/rendering/TextureProxyBase.hpp>
|
|
||||||
#include <cglm/cglm.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
// TODO: add G3D
|
|
||||||
|
|
||||||
namespace RNR
|
|
||||||
{
|
|
||||||
// 2d rendering api
|
|
||||||
class Adorn
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <engine/app/gui/Adorn.hpp>
|
|
||||||
|
|
||||||
namespace RNR
|
|
||||||
{
|
|
||||||
void renderForceField(boost::shared_ptr<RNR::Instance> *descendant, RNR::Adorn *adorn, int cycle);
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace RNR
|
|
||||||
{
|
|
||||||
class Guid
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Guid();
|
|
||||||
|
|
||||||
static void generateGUID(std::string *result);
|
|
||||||
static void compare(RNR::Guid* a, RNR::Guid* b);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace RNR
|
|
||||||
{
|
|
||||||
class TextureProxyBase
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue