Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
PharaEthan committed Jan 13, 2024
2 parents 8876cd2 + 826ea25 commit b4f57f7
Show file tree
Hide file tree
Showing 395 changed files with 8,575 additions and 1,672 deletions.
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ bin*
ExodiaProfile-*.json

# Binaries for programs and plugins
r-type_client
r-type_server
r-type_*
exodia
SandBoxGames

# ImGui
imgui.ini
Expand All @@ -55,6 +55,9 @@ vgcore.*
.idea/
.vscode/

#Windows
# Windows
Release/
Debug/Assets/
Debug/Assets/

# R-Type
.rtype
40 changes: 40 additions & 0 deletions Assets/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Prefab: Player
TransformComponent:
Translation: [0, 0, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
Entities:
- Entity: 87451251541121
TagComponent:
Tag: SpaceShip
TransformComponent:
Translation: [0, 0, 0]
Rotation: [0, 0, 0]
Scale: [1, 0.5, 1]
Health:
MaxHealth: 1
CurrentHealth: 1
BoxCollider2DComponent:
Offset: [0, 0]
Size: [0.5, 0.5]
Mask: 0xFFFFFFFF
RigidBody2DComponent:
BodyType: Dynamic
Velocity: [0, 0]
GravityScale: 0
Mass: 0
ScriptComponent:
Name: Player
- Entity: 845120051210414
TagComponent:
Tag: PlayerID
TransformComponent:
Translation: [0, 1, 0]
Rotation: [0, 0, 0]
Scale: [0.25, 0.25, 1]
TextRendererComponent:
Text: Player
Color: [1, 1, 1, 1]
Font: 45121874124124
Kerning: 0
LineSpacing: 0
4 changes: 4 additions & 0 deletions CMake/BuildSandbox.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add the binaries to compile
add_subdirectory(flappybird)

message(STATUS "Flappybird compiled")
1 change: 1 addition & 0 deletions CMake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ find_package(glad CONFIG REQUIRED) # glad::glad
# -- Audio Library ---------------------------------------------------------
find_package(OpenAL CONFIG REQUIRED) # OpenAL::OpenAL
find_package(FreeALUT CONFIG REQUIRED) # FreeALUT::alut
find_package(Vorbis CONFIG REQUIRED) # Vorbis::vorbisfile

# -- Serialization Library -------------------------------------------------
find_package(yaml-cpp CONFIG REQUIRED) # yaml-cpp::yaml-cpp
Expand Down
3 changes: 3 additions & 0 deletions CMake/Libraries.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message(STATUS "Building library")

add_subdirectory(Library)
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
# Dependencies (find_package (vcpkg))
include(Dependencies)

# Libraries
include(Libraries)

# Project
include(BuildEngine)
include(BuildBinaries)
include(BuildSandbox)

# Compilation Flags
include(CompileFlags)
Expand Down
11 changes: 11 additions & 0 deletions Client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ include_directories(${INCLUDE_DIRS})
add_executable(r-type_client ${SOURCES})

target_link_libraries(r-type_client PRIVATE
Exodia-Tools
Exodia-Debug
Exodia-ECS

GameEngine
R-Type
glad::glad
Expand All @@ -66,6 +70,13 @@ target_link_libraries(r-type_client PRIVATE
yaml-cpp::yaml-cpp
imguizmo::imguizmo
FreeALUT::alut
Vorbis::vorbisfile
)

target_include_directories(r-type_client PRIVATE
${CMAKE_BINARY_DIR}/../Library/Tools/src/
${CMAKE_BINARY_DIR}/../Library/Debug/src/
${CMAKE_BINARY_DIR}/../Library/Entity-Component-System/src
)

target_include_directories(r-type_client PRIVATE ${Stb_INCLUDE_DIR})
Expand Down
38 changes: 31 additions & 7 deletions Client/src/Layer/RTypeLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,24 @@ namespace RType {
// TODO: Temp code

// Create the camera entity
Entity *cameraEntity = Scenes[GAME]->CreateEntity("Camera");
GameObject cameraEntity = Scenes[GAME]->CreateEntity("Camera");

CameraComponent &camera = cameraEntity.AddComponent<CameraComponent>();

cameraEntity.GetComponent<TransformComponent>().Translation = {0.0f, 0.0f, 15.0f};

CameraComponent &camera = cameraEntity->AddComponent<CameraComponent>().Get();
cameraEntity->GetComponent<TransformComponent>().Get().Translation = {0.0f, 0.0f, 15.0f};
camera.Camera.SetProjectionType(SceneCamera::ProjectionType::Perspective);
camera.Camera.SetViewportSize(Application::Get().GetWindow().GetWidth(),
Application::Get().GetWindow().GetHeight());

for (int i = 0; i < 60; i++) {
Entity *star = Scenes[GAME]->CreateEntity("Star" + std::to_string(i));
star->AddComponent<ScriptComponent>().Get().Bind("Star");
GameObject star = Scenes[GAME]->CreateEntity("Star" + std::to_string(i));

star.AddComponent<ScriptComponent>().Bind("Star");
}

// Create the camera
// PrefabsImporter::LoadPrefabs("Assets/Prefabs/Player.prefab", Scenes[CurrentScene]);

Scenes[CurrentScene]->OnRuntimeStart();

ConnectToServer(port, ip, serverPort);
Expand All @@ -134,6 +138,9 @@ namespace RType {

void RTypeLayer::OnUpdate(Exodia::Timestep ts) {
EXODIA_PROFILE_FUNCTION();

Renderer2D::ResetStats();

// Renderer Prep
{
EXODIA_PROFILE_SCOPE("Renderer Prep");
Expand All @@ -155,7 +162,24 @@ namespace RType {
Scenes[CurrentScene]->OnUpdateRuntime(ts);
}

void RTypeLayer::OnImGUIRender() { EXODIA_PROFILE_FUNCTION(); }
void RTypeLayer::OnImGUIRender() {
EXODIA_PROFILE_FUNCTION();

#ifdef EXODIA_DEBUG
ImGui::Begin("R-Type Statistics");
ImGui::Text("FPS: %.1f", Application::Get().GetStatistics().FPS);
ImGui::Text("Frame Time: %.3f ms", Application::Get().GetStatistics().FrameTime);
ImGui::Text("Memory Usage: %ld KB", Application::Get().GetStatistics().MemoryUsage / 1024);
ImGui::Separator();
ImGui::Text("Renderer Statistics:");
ImGui::Text("Draw Calls: %d", Renderer2D::GetStats().DrawCalls);
ImGui::Text("Quad Count: %d", Renderer2D::GetStats().QuadCount);
ImGui::Text("Vertex Count: %d", Renderer2D::GetStats().GetTotalVertexCount());
ImGui::Text("Index Count: %d", Renderer2D::GetStats().GetTotalIndexCount());
ImGui::Separator();
ImGui::End();
#endif
}

void RTypeLayer::OnEvent(Exodia::Event &event) {
EventDispatcher dispatcher(event);
Expand Down
46 changes: 22 additions & 24 deletions GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ set(SOURCES_GAME_ENGINE
src/Exodia/Core/Application/Application.cpp
src/Exodia/Core/Layer/LayerStack.cpp
src/Exodia/Core/Layer/Layer.cpp
src/Exodia/Core/Time/Timestep.cpp
src/Exodia/Core/ID/UUID.cpp

# -- Renderer source files

Expand All @@ -47,29 +45,19 @@ set(SOURCES_GAME_ENGINE
src/Exodia/Renderer/Sound/Sound.cpp
src/Exodia/Renderer/Font/Font.cpp

# -- Debug source files

src/Exodia/Debug/Profiling/InstrumentorTimer.cpp
src/Exodia/Debug/Profiling/Instrumentor.cpp
src/Exodia/Debug/Logger/Log.cpp

# -- Entity Component System (ECS) source files

src/Exodia/ECS/Entity/EntityIterator.cpp
src/Exodia/ECS/Entity/EntityView.cpp
src/Exodia/ECS/Entity/Entity.cpp
src/Exodia/ECS/World/World.cpp
src/Exodia/ECS/System/Collision/CollisionSystem.cpp
src/Exodia/ECS/System/Script/ScriptSystem.cpp
src/Exodia/ECS/System/Physics/GravitySystem.cpp
src/Exodia/ECS/System/Physics/MovingSystem.cpp
src/Exodia/ECS/EventSubscriber/EventHover.cpp

# -- Scene source files

src/Exodia/Scene/Camera/SceneCamera.cpp
src/Exodia/Scene/Serializer/SceneSerializer.cpp
src/Exodia/Scene/Scene/Scene.cpp
src/Exodia/Scene/System/Collision/CollisionSystem.cpp
src/Exodia/Scene/System/Script/ScriptSystem.cpp
src/Exodia/Scene/System/Physics/GravitySystem.cpp
src/Exodia/Scene/System/Physics/MovingSystem.cpp
src/Exodia/Scene/System/Particle/ParticleSystem.cpp
src/Exodia/Scene/EventSubscriber/EventHover.cpp
src/Exodia/Scene/GameObject/GameObject.cpp
src/Exodia/Scene/Prefabs/Prefabs.cpp

# -- Script source files

Expand All @@ -91,6 +79,7 @@ set(SOURCES_GAME_ENGINE
src/Exodia/Asset/Importer/SceneImporter.cpp
src/Exodia/Asset/Importer/SoundImporter.cpp
src/Exodia/Asset/Importer/FontImporter.cpp
src/Exodia/Asset/Importer/PrefabsImporter.cpp
src/Exodia/Asset/Manager/EditorAssetManager.cpp

# -- Exodia Math source files
Expand Down Expand Up @@ -147,6 +136,10 @@ set(INCLUDE_DIRS_GAME_ENGINE
add_library(GameEngine STATIC ${SOURCES_GAME_ENGINE})

target_link_libraries(GameEngine PRIVATE
Exodia-Tools
Exodia-Debug
Exodia-ECS

asio::asio
glm::glm
glfw
Expand All @@ -160,12 +153,17 @@ target_link_libraries(GameEngine PRIVATE
yaml-cpp::yaml-cpp
imguizmo::imguizmo
FreeALUT::alut
Vorbis::vorbisfile
)

set(EXODIA_LIB_DIR ${CMAKE_BINARY_DIR}/../Library)

target_include_directories(GameEngine PRIVATE
${EXODIA_LIB_DIR}/Tools/src
${EXODIA_LIB_DIR}/Debug/src
${CMAKE_BINARY_DIR}/../Library/Entity-Component-System/src
)

target_include_directories(GameEngine PRIVATE ${INCLUDE_DIRS_GAME_ENGINE})
target_include_directories(GameEngine PRIVATE ${Stb_INCLUDE_DIR})
target_include_directories(GameEngine PRIVATE ${CMAKE_BINARY_DIR}/_deps/imgui-src)

set_target_properties(GameEngine PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib
)
10 changes: 3 additions & 7 deletions GameEngine/src/Exodia.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// -- Entity Component System ----------------------------------------------

#include "Exodia/ECS/ECS.hpp"
#include "Exodia-ECS.hpp"

// -- Exodia Events --------------------------------------------------------

Expand Down Expand Up @@ -57,8 +57,7 @@

// -- Exodia Debug ---------------------------------------------------------

#include "Exodia/Debug/Profiling.hpp"
#include "Exodia/Debug/Logs.hpp"
#include "Exodia-Debug.hpp"

// -- Exodia Math ----------------------------------------------------------

Expand All @@ -70,10 +69,7 @@

// -- Exodia Utils ---------------------------------------------------------

#include "Utils/CrossPlatform.hpp"
#include "Exodia-Utils.hpp"
#include "Utils/PlatformUtils.hpp"
#include "Utils/LibrairyLoader.hpp"
#include "Utils/Memory.hpp"
#include "Utils/Assert.hpp"

#endif /* !EXODIA_HPP_ */
1 change: 1 addition & 0 deletions GameEngine/src/Exodia/Asset/Asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
#include "Exodia/Asset/Importer/SceneImporter.hpp"
#include "Exodia/Asset/Importer/SoundImporter.hpp"
#include "Exodia/Asset/Importer/FontImporter.hpp"
#include "Exodia/Asset/Importer/PrefabsImporter.hpp"

#endif /* !ASSET_HPP_ */
8 changes: 5 additions & 3 deletions GameEngine/src/Exodia/Asset/Importer/AssetImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
#include "Asset/Importer/TextureImporter.hpp"
#include "Asset/Importer/SceneImporter.hpp"
#include "Asset/Importer/SoundImporter.hpp"
#include "Asset/Importer/PrefabsImporter.hpp"

// Exodia Utils
#include "Utils/Assert.hpp"
#include "Utils/Memory.hpp"
#include "Exodia-Debug.hpp"
#include "Exodia-Utils.hpp"

// External includes
#include <map>
Expand All @@ -29,7 +30,8 @@ namespace Exodia {
{AssetType::Scene, SceneImporter::ImportScene},
{AssetType::Texture2D, TextureImporter::ImportTexture2D},
{AssetType::Sound2D, SoundImporter::ImportSound2D},
{AssetType::Font, FontImporter::ImportFont}};
{AssetType::Font, FontImporter::ImportFont},
{AssetType::Prefabs, PrefabsImporter::ImportPrefabs}};

/////////////
// Methods //
Expand Down
2 changes: 1 addition & 1 deletion GameEngine/src/Exodia/Asset/Importer/AssetImporter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "Asset/Utils/AssetType.hpp"

// Exodia Utils
#include "Utils/Memory.hpp"
#include "Exodia-Utils.hpp"

// External includes
#include <functional>
Expand Down
4 changes: 2 additions & 2 deletions GameEngine/src/Exodia/Asset/Importer/FontImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "FontImporter.hpp"

// Exodia Utils
#include "Utils/Memory.hpp"
#include "Exodia-Utils.hpp"

// Exodia Project
#include "Project/Project.hpp"
Expand All @@ -17,7 +17,7 @@
#include "Renderer/Font/Font.hpp"

// Exodia Debug
#include "Debug/Profiling.hpp"
#include "Exodia-Debug.hpp"

namespace Exodia {

Expand Down
Loading

0 comments on commit b4f57f7

Please sign in to comment.