Skip to content

Commit

Permalink
Rename nodes directory to node and move callbacks directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
Flone-dnb committed Nov 30, 2024
1 parent a438d3b commit ab4a872
Show file tree
Hide file tree
Showing 59 changed files with 120 additions and 117 deletions.
34 changes: 17 additions & 17 deletions docs/Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ Now let's see how we can create a world in `onGameStarted`:
#include "MyGameInstance.h"
// Custom.
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "misc/PrimitiveMeshGenerator.h"
MyGameInstance::MyGameInstance(
Expand Down Expand Up @@ -627,7 +627,7 @@ If you instead want to load some level/map as your new world you need to use `lo
#include "MyGameInstance.h"

// Custom.
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "misc/PrimitiveMeshGenerator.h"

MyGameInstance::MyGameInstance(
Expand Down Expand Up @@ -657,10 +657,10 @@ void MyGameInstance::onGameStarted(){
## Lighting
Light source nodes (such as point/spot/directional) are stored in `game/nodes/light`. Just spawn one of these nodes and configure their setting using `setLight...` functions and `setWorldLocation`/`setWorldRotation`. Here is an example:
Light source nodes (such as point/spot/directional) are stored in `game/node/light`. Just spawn one of these nodes and configure their setting using `setLight...` functions and `setWorldLocation`/`setWorldRotation`. Here is an example:
```Cpp
#include "game/nodes/light/PointLightNode.h"
#include "game/node/light/PointLightNode.h"
void MyGameInstance::onGameStarted(){
// Create world.
Expand Down Expand Up @@ -698,7 +698,7 @@ void MyGameInstance::onGameStarted(){
Using `EnvironmentNode` you can configure environment settings such as ambient light, skybox, etc. Here is an example:

```Cpp
#include "game/nodes/EnvironmentNode.h"
#include "game/node/EnvironmentNode.h"

void MyGameInstance::onGameStarted(){
// Create world.
Expand Down Expand Up @@ -737,7 +737,7 @@ Note that your world can only have 1 active environment node. If you will spawn

In this section we will start with the most simplest character node: a node that has a camera and can fly around using WASD and mouse movement.

Let's create new files `FlyingCharacter.h` and `FlyingCharacter.cpp` inside of our new directory named `private/nodes` to our library target (we pick our library target since generally library targets will contain all functionality (so that it can be used in multiple executable targets such as `tests`) while executable targets generally will only contain `main.cpp`). Open `CMakeLists.txt` of your library target and add new files to `PROJECT_SOURCES`:
Let's create new files `FlyingCharacter.h` and `FlyingCharacter.cpp` inside of our new directory named `private/node` to our library target (we pick our library target since generally library targets will contain all functionality (so that it can be used in multiple executable targets such as `tests`) while executable targets generally will only contain `main.cpp`). Open `CMakeLists.txt` of your library target and add new files to `PROJECT_SOURCES`:

```
## `CMakeLists.txt`
Expand All @@ -746,8 +746,8 @@ Let's create new files `FlyingCharacter.h` and `FlyingCharacter.cpp` inside of o
## Specify project sources.
set(PROJECT_SOURCES
## ... some files here ...
private/nodes/FlyingCharacter.h
private/nodes/FlyingCharacter.cpp
private/node/FlyingCharacter.h
private/node/FlyingCharacter.cpp
## add your .h/.cpp files here
)
Expand All @@ -769,7 +769,7 @@ We will start with the most basic node header file:
#pragma once

// Custom.
#include "game/nodes/SpatialNode.h"
#include "game/node/SpatialNode.h"

// Using engine namespace.
using namespace ne;
Expand Down Expand Up @@ -810,7 +810,7 @@ Now let's add reflection to our node so that the editor will be able to recogniz
#pragma once

// Custom.
#include "game/nodes/SpatialNode.h"
#include "game/node/SpatialNode.h"

#include "FlyingCharacter.generated.h"

Expand Down Expand Up @@ -862,7 +862,7 @@ Now before moving to handling user input let's add a camera node. There are seve
#pragma once
// Custom.
#include "game/nodes/SpatialNode.h"
#include "game/node/SpatialNode.h"
#include "FlyingCharacter.generated.h"
Expand Down Expand Up @@ -900,7 +900,7 @@ Now let's create a camera node in our constructor:
#include "FlyingCharacter.h"

// Custom.
#include "game/nodes/CameraNode.h"
#include "game/node/CameraNode.h"

#include "FlyingCharacter.generated_impl.h"

Expand All @@ -921,7 +921,7 @@ Now let's compile our program and make sure we have a world, in our `GameInstanc
// MyGameInstance.cpp
#include "MyGameInstance.h"
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "misc/PrimitiveMeshGenerator.h"
#include "nodes/FlyingCharacter.h"
Expand Down Expand Up @@ -989,10 +989,10 @@ Now compile and run your project. There should be no errors but still black scre
// MyGameInstance.cpp
#include "MyGameInstance.h"

#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "misc/PrimitiveMeshGenerator.h"
#include "nodes/FlyingCharacter.h"
#include "game/nodes/light/DirectionalLightNode.h" // <- new include
#include "game/node/light/DirectionalLightNode.h" // <- new include
#include "math/MathHelpers.hpp" // <- new include

void MyGameInstance::onGameStarted() {
Expand Down Expand Up @@ -1256,7 +1256,7 @@ Now in our node's constructor let's bind to input events. We don't need to care
#include "FlyingCharacter.h"

// Custom.
#include "game/nodes/CameraNode.h"
#include "game/node/CameraNode.h"
#include "GameInputEventIds.hpp"

#include "FlyingCharacter.generated_impl.h"
Expand Down Expand Up @@ -2368,7 +2368,7 @@ Once such function is called it will trigger register input bindings in your gam

There are also other `on...` function in `Window` that you might find handy in simulating user input.

For more examples see `src/engine_tests/game/nodes/Node.cpp`, there are some tests that simulate user input.
For more examples see `src/engine_tests/game/node/Node.cpp`, there are some tests that simulate user input.

## Exporting your game

Expand Down
10 changes: 5 additions & 5 deletions src/editor_lib/private/EditorGameInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

// Custom.
#include "game/camera/CameraManager.h"
#include "game/nodes/MeshNode.h"
#include "game/Window.h"
#include "input/InputManager.h"
#include "misc/PrimitiveMeshGenerator.h"
#include "game/nodes/EnvironmentNode.h"
#include "game/nodes/light/DirectionalLightNode.h"
#include "game/nodes/light/PointLightNode.h"
#include "game/node/MeshNode.h"
#include "game/node/EnvironmentNode.h"
#include "game/node/light/DirectionalLightNode.h"
#include "game/node/light/PointLightNode.h"
#include "game/node/light/SpotlightNode.h"
#include "math/MathHelpers.hpp"
#include "game/nodes/light/SpotlightNode.h"
#include "misc/EditorNodeCreationHelpers.hpp"
#include "nodes/EditorCameraNode.h"
#include "input/EditorInputEventIds.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/editor_lib/public/misc/EditorNodeCreationHelpers.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

// Custom.
#include "game/nodes/Node.h"
#include "game/node/Node.h"

namespace ne {
/** Helper tools for creation nodes in the editor. */
Expand Down
2 changes: 1 addition & 1 deletion src/editor_lib/public/nodes/EditorCameraNode.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

// Custom.
#include "game/nodes/CameraNode.h"
#include "game/node/CameraNode.h"

namespace ne {
/** Camera used in the editor. */
Expand Down
36 changes: 18 additions & 18 deletions src/engine_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,24 +256,24 @@ set(PROJECT_SOURCES
private/game/camera/CameraProperties.cpp
public/game/camera/CameraManager.h
private/game/camera/CameraManager.cpp
public/game/callbacks/NodeFunction.hpp
public/game/callbacks/NodeNotificationBroadcaster.hpp
private/game/nodes/Node.cpp
public/game/nodes/Node.h
private/game/nodes/SpatialNode.cpp
public/game/nodes/SpatialNode.h
private/game/nodes/MeshNode.cpp
public/game/nodes/MeshNode.h
private/game/nodes/CameraNode.cpp
public/game/nodes/CameraNode.h
private/game/nodes/EnvironmentNode.cpp
public/game/nodes/EnvironmentNode.h
private/game/nodes/light/PointLightNode.cpp
public/game/nodes/light/PointLightNode.h
private/game/nodes/light/DirectionalLightNode.cpp
public/game/nodes/light/DirectionalLightNode.h
private/game/nodes/light/SpotlightNode.cpp
public/game/nodes/light/SpotlightNode.h
public/game/node/callback/NodeFunction.hpp
public/game/node/callback/NodeNotificationBroadcaster.hpp
private/game/node/Node.cpp
public/game/node/Node.h
private/game/node/SpatialNode.cpp
public/game/node/SpatialNode.h
private/game/node/MeshNode.cpp
public/game/node/MeshNode.h
private/game/node/CameraNode.cpp
public/game/node/CameraNode.h
private/game/node/EnvironmentNode.cpp
public/game/node/EnvironmentNode.h
private/game/node/light/PointLightNode.cpp
public/game/node/light/PointLightNode.h
private/game/node/light/DirectionalLightNode.cpp
public/game/node/light/DirectionalLightNode.h
private/game/node/light/SpotlightNode.cpp
public/game/node/light/SpotlightNode.h
public/io/properties/SerializeProperty.h
private/io/properties/SerializeProperty.cpp
private/io/properties/GuidProperty.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/game/GameManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "io/FieldSerializerManager.h"
#include "game/camera/CameraManager.h"
#include "shader/ShaderManager.h"
#include "game/nodes/Node.h"
#include "game/node/Node.h"
#include "misc/Profiler.hpp"
#include "GcInfoCallbacks.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/game/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Custom.
#include "io/Logger.h"
#include "game/GameManager.h"
#include "game/nodes/Node.h"
#include "game/node/Node.h"

namespace ne {

Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/game/camera/CameraManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// Custom.
#include "io/Logger.h"
#include "game/nodes/CameraNode.h"
#include "game/node/CameraNode.h"
#include "misc/Profiler.hpp"
#include "render/Renderer.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/CameraNode.h"
#include "game/node/CameraNode.h"

// Custom.
#include "game/GameInstance.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/EnvironmentNode.h"
#include "game/node/EnvironmentNode.h"

// Custom.
#include "render/Renderer.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"

// Standard.
#include <format>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/Node.h"
#include "game/node/Node.h"

// Standard.
#include <format>
Expand All @@ -9,7 +9,7 @@
#include "game/World.h"
#include "game/GameManager.h"
#include "misc/Timer.h"
#include "game/nodes/SpatialNode.h"
#include "game/node/SpatialNode.h"
#include "misc/Profiler.hpp"

#include "Node.generated_impl.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/SpatialNode.h"
#include "game/node/SpatialNode.h"

// Standard.
#include <format>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/light/DirectionalLightNode.h"
#include "game/node/light/DirectionalLightNode.h"

// Custom.
#include "game/Window.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/light/PointLightNode.h"
#include "game/node/light/PointLightNode.h"

// Custom.
#include "game/Window.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game/nodes/light/SpotlightNode.h"
#include "game/node/light/SpotlightNode.h"

// Custom.
#include "game/Window.h"
Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/io/MeshImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// Custom.
#include "misc/ProjectPaths.h"
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "material/Material.h"
#include "io/TextureImporter.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <limits>

// Custom.
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "io/serializers/SerializableObjectFieldSerializer.h"

namespace ne {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <format>

// Custom.
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "io/serializers/SerializableObjectFieldSerializer.h"

namespace ne {
Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/material/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "game/GameManager.h"
#include "game/Window.h"
#include "io/Logger.h"
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "render/general/resource/GpuResourceManager.h"
#include "shader/general/resource/binding/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resource/binding/texture/ShaderTextureResourceBindingManager.h"
Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/misc/shapes/AABB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <limits>

// Custom.
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"

#undef max
#undef min
Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/render/directx/DirectXRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "render/general/resource/shadow/ShadowMapHandle.h"
#include "render/directx/resource/DirectXResource.h"
#include "material/Material.h"
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "shader/hlsl/RootSignatureGenerator.h"
#include "shader/general/resource/binding/cpuwrite/ShaderCpuWriteResourceBinding.h"
#include "render/general/resource/frame/FrameResourceManager.h"
Expand Down
12 changes: 6 additions & 6 deletions src/engine_lib/private/render/general/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "render/vulkan/VulkanRenderer.h"
#include "render/general/pipeline/PipelineManager.h"
#include "misc/Profiler.hpp"
#include "game/nodes/EnvironmentNode.h"
#include "render/general/pipeline/PipelineManager.h"
#include "render/general/resource/GpuResourceManager.h"
#include "shader/general/resource/LightingShaderResourceManager.h"
Expand All @@ -23,15 +22,16 @@
#include "shader/general/resource/binding/global/GlobalShaderResourceBindingManager.h"
#include "shader/general/ShaderMacro.h"
#include "shader/ShaderManager.h"
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "game/camera/CameraManager.h"
#include "game/camera/CameraProperties.h"
#include "shader/general/EngineShaders.hpp"
#include "shader/general/resource/ShaderLightArray.h"
#include "game/nodes/light/PointLightNode.h"
#include "game/nodes/light/DirectionalLightNode.h"
#include "game/nodes/light/SpotlightNode.h"
#include "game/nodes/CameraNode.h"
#include "game/node/light/PointLightNode.h"
#include "game/node/light/DirectionalLightNode.h"
#include "game/node/light/SpotlightNode.h"
#include "game/node/CameraNode.h"
#include "game/node/EnvironmentNode.h"
#include "material/Material.h"
#if defined(WIN32)
#pragma comment(lib, "Winmm.lib")
Expand Down
2 changes: 1 addition & 1 deletion src/engine_lib/private/render/vulkan/VulkanRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "game/camera/CameraManager.h"
#include "game/camera/CameraProperties.h"
#include "render/vulkan/pipeline/VulkanPipeline.h"
#include "game/nodes/MeshNode.h"
#include "game/node/MeshNode.h"
#include "shader/general/resource/binding/cpuwrite/ShaderCpuWriteResourceBinding.h"
#include "shader/glsl/resource/binding/texture/GlslShaderTextureResourceBinding.h"
#include "shader/general/resource/cpuwrite/DynamicCpuWriteShaderResourceArrayManager.h"
Expand Down
Loading

0 comments on commit ab4a872

Please sign in to comment.