-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9131ccf
commit b2f6a58
Showing
263 changed files
with
1,145 additions
and
3,768 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_subdirectory(engine) | ||
add_subdirectory(editor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_subdirectory(assetpipeline) | ||
add_subdirectory(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FILE(GLOB_RECURSE HEADERS "include/*.h*") | ||
FILE(GLOB_RECURSE SRC "src/*.c*") | ||
|
||
find_package(SDL2 REQUIRED) | ||
find_package(unofficial-sqlite3 REQUIRED) | ||
find_package(assimp CONFIG REQUIRED) | ||
|
||
add_executable(EditorApp ${SRC} ${HEADERS}) | ||
|
||
target_include_directories(EditorApp PRIVATE include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/assetpackages/include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/editor//core/include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/audio/include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/ecs/include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/shared/include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/logger/include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/core/engine//core/include) | ||
target_include_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/rendering/include) | ||
|
||
target_link_directories(EditorApp PRIVATE ${CMAKE_SOURCE_DIR}/.build/debug) | ||
|
||
target_link_libraries(EditorApp PRIVATE SDL2::SDL2) | ||
|
||
add_custom_command(TARGET EditorApp POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:EditorApp> $<TARGET_RUNTIME_DLLS:EditorApp> | ||
COMMAND_EXPAND_LISTS | ||
) | ||
|
||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC} ${HEADERS}) | ||
|
||
|
||
add_custom_command( | ||
TARGET EditorApp | ||
POST_BUILD | ||
COMMAND swift build -Xlinker ${CMAKE_BINARY_DIR}/engine/assetpackages/debug/AssetPackages.lib | ||
-Xlinker ${CMAKE_BINARY_DIR}/engine/audio/debug/Audio.lib | ||
-Xlinker ${CMAKE_BINARY_DIR}/engine/core/debug/Core.lib | ||
-Xlinker ${CMAKE_BINARY_DIR}/engine/ecs/debug/EntityComponentSystem.lib | ||
-Xlinker ${CMAKE_BINARY_DIR}/engine/input/debug/Input.lib | ||
-Xlinker ${CMAKE_BINARY_DIR}/engine/rendering/debug/Rendering.lib | ||
-Xlinker ${CMAKE_BINARY_DIR}/editor/core/debug/EditorCore.lib | ||
-Xlinker ${CMAKE_BINARY_DIR}/editor/assetpipeline/debug/AssetPipeline.lib | ||
--static-swift-stdlib | ||
COMMENT "Running swift build with custom flags..." | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
${CMAKE_SOURCE_DIR}/.build/debug/KyaniteEditor.dll | ||
$<TARGET_RUNTIME_DLLS:EditorApp>/KyaniteEditor.dll | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
${CMAKE_SOURCE_DIR}/.build/debug/KyaniteEngine.dll | ||
$<TARGET_RUNTIME_DLLS:EditorApp>/KyaniteEngine.dll | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "app/App.hxx" | ||
|
||
#include <filesystem> | ||
#include <memory> | ||
#include <sstream> | ||
|
||
#pragma comment(lib, "KyaniteEngine.lib") | ||
#pragma comment(lib, "KyaniteEditor.lib") | ||
|
||
// NOTE: These functions come from the Swift libraries. They are *not* unused | ||
extern "C" void kyanitemain(bool); | ||
extern "C" void kyaniteeditormain(); | ||
|
||
int main(int argc, char** argv) { | ||
kyaniteeditormain(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FILE(GLOB_RECURSE HEADERS "include/*.h*") | ||
FILE(GLOB_RECURSE SRC "src/*.c*") | ||
|
||
find_package(unofficial-sqlite3 REQUIRED) | ||
find_package(assimp CONFIG REQUIRED) | ||
find_package(imgui CONFIG REQUIRED) | ||
|
||
add_library(AssetPipeline SHARED ${SRC} ${HEADERS}) | ||
|
||
target_include_directories(AssetPipeline PRIVATE include) | ||
target_include_directories(AssetPipeline PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/audio/include) | ||
target_include_directories(AssetPipeline PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/ecs/include) | ||
target_include_directories(AssetPipeline PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/shared/include) | ||
target_include_directories(AssetPipeline PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/logger/include) | ||
target_include_directories(AssetPipeline PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/io/include) | ||
target_include_directories(AssetPipeline PRIVATE ${CMAKE_SOURCE_DIR}/core/engine/rendering/include) | ||
|
||
target_link_libraries(AssetPipeline PRIVATE unofficial::sqlite3::sqlite3 assimp::assimp) | ||
|
||
# Link all engine libraries | ||
target_link_libraries(AssetPipeline PRIVATE Logger EntityComponentSystem Audio IO Rendering) | ||
|
||
add_custom_command(TARGET AssetPipeline POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:AssetPipeline> $<TARGET_RUNTIME_DLLS:AssetPipeline> | ||
COMMAND_EXPAND_LISTS | ||
) | ||
|
||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC} ${HEADERS}) |
45 changes: 45 additions & 0 deletions
45
core/editor/assetpipeline/include/assetpipeline/Bridge_AssetPipeline.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#pragma once | ||
|
||
#include <shared/Exported.hxx> | ||
#include <shared/NativePointer.hxx> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
EXPORTED struct Vertex { | ||
float position[3]; | ||
float normal[3]; | ||
float texCoord[2]; | ||
} typedef Vertex; | ||
|
||
EXPORTED struct MeshData { | ||
const char* name; | ||
Vertex* vertices; | ||
uint32_t vertexCount; | ||
uint32_t* indices; | ||
uint32_t indexCount; | ||
} typedef MeshData; | ||
|
||
/** | ||
* @brief Initialize the asset pipeline | ||
*/ | ||
EXPORTED void AssetPipeline_Init(); | ||
|
||
/** | ||
* @brief Load a mesh from a file | ||
* @param path The path to the file | ||
* @param meshData The mesh data to load into | ||
* @param len The length of the mesh data | ||
*/ | ||
EXPORTED void AssetPipeline_LoadMeshes(const uint8_t* buffer, size_t bufferLen, MeshData* meshData, size_t* len); | ||
|
||
/** | ||
* @brief Free the mesh data | ||
* @param meshData The mesh data to free | ||
*/ | ||
EXPORTED void AssetPipeline_FreeMeshes(MeshData* meshData, size_t len); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
6 changes: 2 additions & 4 deletions
6
...include/editor/core/loaders/FbxLoader.hxx → ...clude/assetpipeline/loaders/FbxLoader.hxx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
#pragma once | ||
|
||
#include "../meta/ModelMeta.hxx" | ||
#include <rendering/Mesh.hxx> | ||
|
||
#include <cstdint> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
namespace kyanite::editor::loaders { | ||
namespace kyanite::editor::assetpipeline::loaders { | ||
class FbxLoader { | ||
public: | ||
FbxLoader(); | ||
~FbxLoader(); | ||
auto LoadFromBuffer(std::vector<uint8_t> buffer) -> std::vector<engine::rendering::MeshData>; | ||
auto LoadFromBuffer(std::vector<uint8_t> buffer) -> std::vector<kyanite::engine::rendering::MeshData>; | ||
}; | ||
} |
4 changes: 4 additions & 0 deletions
4
core/editor/assetpipeline/include/assetpipeline/mappers/AnimationMapper.hxx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#pragma once | ||
|
||
namespace kyanite::editor::assetpipeline::mappers::AnimationMapper { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...clude/editor/core/mappers/ModelMapper.hxx → ...ude/assetpipeline/mappers/ModelMapper.hxx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
#pragma once | ||
|
||
#include "editor/core/mappers/IMapper.hxx" | ||
#include "editor/core/meta/ModelMeta.hxx" | ||
#include "assetpipeline/mappers/IMapper.hxx" | ||
#include "assetpipeline/Bridge_AssetPipeline.h" | ||
#include <rendering/Mesh.hxx> | ||
|
||
#include <cstdint> | ||
#include <string> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
namespace kyanite::editor::mappers { | ||
namespace kyanite::editor::assetpipeline::mappers { | ||
class ModelMapper { | ||
public: | ||
ModelMapper() = default; | ||
|
||
auto MapFbx( | ||
std::vector<uint8_t> data | ||
)-> std::vector<kyanite::engine::rendering::MeshData>; | ||
) -> std::vector<kyanite::engine::rendering::MeshData>; | ||
}; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "assetpipeline/Bridge_AssetPipeline.h" | ||
#include "assetpipeline/loaders/FbxLoader.hxx" | ||
|
||
namespace assetpipeline = kyanite::editor::assetpipeline; | ||
|
||
EXPORTED void AssetPipeline_Init() { | ||
|
||
} | ||
|
||
EXPORTED void AssetPipeline_LoadMeshes(const uint8_t* buffer, size_t bufferLen, MeshData* meshData, size_t* len) { | ||
auto vec = std::vector<uint8_t>(buffer, buffer + bufferLen); | ||
auto meshes = assetpipeline::loaders::FbxLoader().LoadFromBuffer(vec); | ||
|
||
*len = meshes.size(); | ||
meshData = new MeshData[*len]; | ||
for (size_t i = 0; i < *len; i++) { | ||
meshData[i].vertexCount = meshes[i].vertices.size(); | ||
meshData[i].indexCount = meshes[i].indices.size(); | ||
meshData[i].vertices = new Vertex[meshData[i].vertexCount]; | ||
meshData[i].indices = new uint32_t[meshData[i].indexCount]; | ||
|
||
memcpy(meshData[i].vertices, meshes[i].vertices.data(), sizeof(Vertex) * meshData[i].vertexCount); | ||
memcpy(meshData[i].indices, meshes[i].indices.data(), sizeof(uint32_t) * meshData[i].indexCount); | ||
} | ||
} | ||
|
||
EXPORTED void AssetPipeline_FreeMeshes(MeshData* meshData, size_t len) { | ||
for (size_t i = 0; i < len; i++) { | ||
delete[] meshData[i].vertices; | ||
delete[] meshData[i].indices; | ||
} | ||
delete[] meshData; | ||
} |
6 changes: 3 additions & 3 deletions
6
...ore/src/editor/core/loaders/FbxLoader.cxx → ...r/assetpipeline/src/loaders/FbxLoader.cxx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
add_subdirectory(logger) | ||
add_subdirectory(shared) | ||
add_subdirectory(core) | ||
add_subdirectory(io) | ||
add_subdirectory(imgui) | ||
add_subdirectory(math) | ||
add_subdirectory(audio) | ||
add_subdirectory(input) | ||
add_subdirectory(rendering) | ||
add_subdirectory(assetpackages) | ||
add_subdirectory(ecs) | ||
|
Oops, something went wrong.