Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Sources/OvAudio/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project "OvAudio"
cppdialect "C++20"
targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}")
objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}")
fatalwarnings { "All" }

files {
"**.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ namespace OvCore::Rendering::PostProcess
*/
AEffect(OvRendering::Core::CompositeRenderer& p_renderer);

/**
* Virtual destructor
*/
virtual ~AEffect() = default;

/**
* Returns true if the effect is applicable with the given settings.
* If the effect is not applicable, it will be skipped by the post processing render pass
* @param p_settings
*/
virtual bool IsApplicable(const EffectSettings& p_settings) const;

/**
* Draw the effect
* @note: make sure the effect is applicable before calling this method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ namespace OvCore::Rendering

protected:
virtual void OnBeginFrame(const OvRendering::Data::FrameDescriptor& p_frameDescriptor) override;
virtual void OnBeforeDraw(OvRendering::Data::PipelineState& p_pso, const OvRendering::Entities::Drawable& p_drawable);
virtual void OnBeforeDraw(OvRendering::Data::PipelineState& p_pso, const OvRendering::Entities::Drawable& p_drawable) override;
};
}
1 change: 1 addition & 0 deletions Sources/OvCore/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project "OvCore"
cppdialect "C++20"
targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}")
objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}")
fatalwarnings { "All" }

-- If MSVC, set big obj flag
filter { "toolset:msc" }
Expand Down
2 changes: 1 addition & 1 deletion Sources/OvCore/src/OvCore/ECS/Components/CAudioSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void OvCore::ECS::Components::CAudioSource::OnInspector(OvUI::Internal::WidgetCo
{
float graphY = graphX < m_audioSource.GetAttenuationThreshold() ? 1.0f : 1.0f / (1.0f + 1.0f * (graphX - m_audioSource.GetAttenuationThreshold()));

if (abs(graphX - distanceToListener) <= 0.25f)
if (std::abs(graphX - distanceToListener) <= 0.25f)
{
graph.forceHover = static_cast<int>(graphX * 4.0f);
graph.overlay = std::to_string(static_cast<int>(graphY * 100.0f)) + "%";
Expand Down
27 changes: 16 additions & 11 deletions Sources/OvCore/src/OvCore/Rendering/PostProcessRenderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,23 @@ void OvCore::Rendering::PostProcessRenderPass::Draw(OvRendering::Data::PipelineS

for (auto& effect : m_effects)
{
const auto& settings = stack->Get(typeid(*effect));

if (effect && effect->IsApplicable(settings))
if (effect)
{
effect->Draw(
p_pso,
m_pingPongBuffers[0],
m_pingPongBuffers[1],
settings
);

++m_pingPongBuffers;
auto& effectRef = *effect;
const auto& effectType = typeid(effectRef);
const auto& settings = stack->Get(effectType);

if (effect->IsApplicable(settings))
{
effect->Draw(
p_pso,
m_pingPongBuffers[0],
m_pingPongBuffers[1],
settings
);

++m_pingPongBuffers;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions Sources/OvCore/src/OvCore/Rendering/SceneRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ SceneRenderer::SceneDrawablesDescriptor OvCore::Rendering::SceneRenderer::ParseS
case MESH_BOUNDS: return mesh->GetBoundingSphere();
case DEPRECATED_MODEL_BOUNDS: return model->GetBoundingSphere();
case CUSTOM_BOUNDS: return modelRenderer->GetCustomBoundingSphere();
default: return std::nullopt;
}
return std::nullopt;
}();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OvCore::Resources::Material * OvCore::ResourceManagement::MaterialManager::Creat
Resources::Material* material = OvCore::Resources::Loaders::MaterialLoader::Create(realPath);
if (material)
{
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(material) + offsetof(Resources::Material, path)) = p_path.string(); // Force the resource path to fit the given path
const_cast<std::string&>(material->path) = p_path.string(); // Force the resource path to fit the given path
}

return material;
Expand Down
6 changes: 4 additions & 2 deletions Sources/OvCore/src/OvCore/ResourceManagement/ModelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@ OvRendering::Resources::Parsers::EModelParserFlags GetAssetMetadata(const std::s
if (metaFile.GetOrDefault("DROP_NORMALS", false)) flags |= OvRendering::Resources::Parsers::EModelParserFlags::DROP_NORMALS;
if (metaFile.GetOrDefault("GEN_BOUNDING_BOXES", false)) flags |= OvRendering::Resources::Parsers::EModelParserFlags::GEN_BOUNDING_BOXES;

return { flags };
return flags;
}

OvRendering::Resources::Model* OvCore::ResourceManagement::ModelManager::CreateResource(const std::filesystem::path& p_path)
{
std::string realPath = GetRealPath(p_path).string();
auto model = OvRendering::Resources::Loaders::ModelLoader::Create(realPath, GetAssetMetadata(realPath));
if (model)
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(model) + offsetof(OvRendering::Resources::Model, path)) = p_path.string(); // Force the resource path to fit the given path
{
const_cast<std::string&>(model->path) = p_path.string(); // Force the resource path to fit the given path
}

return model;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ OvRendering::Resources::Shader* OvCore::ResourceManagement::ShaderManager::Creat
auto pathParserCallback = [this](const std::string& s) { return GetRealPath(std::filesystem::path{s}).string(); };
OvRendering::Resources::Shader* shader = OvRendering::Resources::Loaders::ShaderLoader::Create(realPath, pathParserCallback);
if (shader)
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(shader) + offsetof(OvRendering::Resources::Shader, path)) = p_path.string(); // Force the resource path to fit the given path
{
const_cast<std::string&>(shader->path) = p_path.string(); // Force the resource path to fit the given path
}

return shader;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ OvAudio::Resources::Sound* OvCore::ResourceManagement::SoundManager::CreateResou
std::string realPath = GetRealPath(p_path).string();
OvAudio::Resources::Sound* sound = OvAudio::Resources::Loaders::SoundLoader::Create(realPath);
if (sound)
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(sound) + offsetof(OvAudio::Resources::Sound, path)) = p_path.string(); // Force the resource path to fit the given path
{
const_cast<std::string&>(sound->path) = p_path.string(); // Force the resource path to fit the given path
}

return sound;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ OvRendering::Resources::Texture* OvCore::ResourceManagement::TextureManager::Cre
);

if (texture)
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(texture) + offsetof(OvRendering::Resources::Texture, path)) = p_path.string(); // Force the resource path to fit the given path
{
const_cast<std::string&>(texture->path) = p_path.string(); // Force the resource path to fit the given path
}

return texture;
}
Expand Down
1 change: 1 addition & 0 deletions Sources/OvDebug/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project "OvDebug"
cppdialect "C++20"
targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}")
objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}")
fatalwarnings { "All" }

files {
"**.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace OvEditor::Panels
/**
* Returns the camera used by the camera controller
*/
virtual OvRendering::Entities::Camera* GetCamera();
virtual OvRendering::Entities::Camera* GetCamera() override;

/**
* Returns the grid color of the view
Expand Down
4 changes: 2 additions & 2 deletions Sources/OvEditor/include/OvEditor/Panels/SceneView.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ namespace OvEditor::Panels
/**
* Returns the scene used by this view
*/
virtual OvCore::SceneSystem::Scene* GetScene();
virtual OvCore::SceneSystem::Scene* GetScene() override;

/**
* Set the gizmo operation
* @param p_operation
*/
void SetGizmoOperation(Core::EGizmoOperation p_operation);

/**
* Returns the current gizmo operation
*/
Expand Down
1 change: 1 addition & 0 deletions Sources/OvEditor/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project "OvEditor"
targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}")
objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}")
debugdir "%{wks.location}/Build/%{cfg.buildcfg}"
fatalwarnings { "All" }

files {
"**.h",
Expand Down
2 changes: 1 addition & 1 deletion Sources/OvEditor/src/OvEditor/Core/CameraController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void OvEditor::Core::CameraController::HandleInputs(float p_deltaTime)
{
auto camPos = targetPos + offset * dist;
auto direction = OvMaths::FVector3::Normalize(targetPos - camPos);
m_camera.SetRotation(OvMaths::FQuaternion::LookAt(direction, abs(direction.y) == 1.0f ? OvMaths::FVector3::Right : OvMaths::FVector3::Up));
m_camera.SetRotation(OvMaths::FQuaternion::LookAt(direction, std::abs(direction.y) == 1.0f ? OvMaths::FVector3::Right : OvMaths::FVector3::Up));
m_cameraDestinations.push({ camPos, m_camera.GetRotation() });
};

Expand Down
2 changes: 1 addition & 1 deletion Sources/OvEditor/src/OvEditor/Core/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ OvEditor::Core::Context::Context(const std::filesystem::path& p_projectFolder) :
windowSettings.width = bestFitWindowSizeAndPosition[2];
windowSettings.height = bestFitWindowSizeAndPosition[3];
window = std::make_unique<OvWindowing::Window>(*device, windowSettings);
std::vector<uint64_t> iconRaw = { 0,0,144115188614240000,7500771567664627712,7860776967494637312,0,0,0,0,7212820467466371072,11247766461832697600,14274185407633888512,12905091124788992000,5626708973701824512,514575842263176960,0,0,6564302121125019648,18381468271671515136,18381468271654737920,18237353083595659264,18165295488836311040,6708138037527189504,0,4186681893338480640,7932834557741046016,17876782538917681152,11319824055216379904,15210934132358518784,18381468271520454400,1085667680982603520,0,18093237891929479168,18309410677600032768,11391881649237530624,7932834561381570304,17300321784231761408,15210934132375296000,8293405106311272448,2961143145139082752,16507969723533236736,17516777143216379904,10671305705855129600,7356091234422036224,16580027318695106560,2240567205413984000,18381468271470188544,10959253511276599296,4330520004484136960,10815138323200743424,11607771853338181632,8364614976649238272,17444719546862998784,2669156352,18381468269893064448,6419342512197474304,11103650170688640000,6492244531366860800,14346241902646925312,13841557270159628032,7428148827772098304,3464698581331941120,18381468268953606144,1645680384,18381468271554008832,7140201027266418688,5987558797656659712,17588834734687262208,7284033640602212096,14273902834169157632,18381468269087692288,6852253225049397248,17732667349600245504,16291515470083266560,10022503688432981760,11968059825861367552,9733991836700645376,14850363587428816640,18381468271168132864,16147400282007410688,656430432014827520,18381468270950094848,15715054717226194944,72057596690306560,11823944635485519872,15859169905251653376,17084149004500473856,8581352906816952064,2527949855582584832,18381468271419856896,8581352907253225472,252776704,1376441223417430016,14994761349590357760,10527190521537370112,0,9806614576878321664,18381468271671515136,17156206598538401792,6059619689256392448,10166619973990488064,18381468271403079424,17444719549178451968,420746240,870625192710242304,4906133035823863552,18381468269289150464,18381468271671515136,18381468271671515136,9950729769032620032,14778305994951169792,269422336,0,0,18381468268785833984,8941923452686178304,18381468270950094848,3440842496,1233456333565402880,0,0,0,11823944636091210240,2383877888,16724143605745719296,2316834816,0,0 };
std::vector<uint64_t> iconRaw = { 0,0,144115188614240000ULL,7500771567664627712ULL,7860776967494637312ULL,0,0,0,0,7212820467466371072ULL,11247766461832697600ULL,14274185407633888512ULL,12905091124788992000ULL,5626708973701824512ULL,514575842263176960,0,0,6564302121125019648ULL,18381468271671515136ULL,18381468271654737920ULL,18237353083595659264ULL,18165295488836311040ULL,6708138037527189504ULL,0,4186681893338480640ULL,7932834557741046016ULL,17876782538917681152ULL,11319824055216379904ULL,15210934132358518784ULL,18381468271520454400ULL,1085667680982603520ULL,0,18093237891929479168ULL,18309410677600032768ULL,11391881649237530624ULL,7932834561381570304ULL,17300321784231761408ULL,15210934132375296000ULL,8293405106311272448ULL,2961143145139082752ULL,16507969723533236736ULL,17516777143216379904ULL,10671305705855129600ULL,7356091234422036224ULL,16580027318695106560ULL,2240567205413984000ULL,18381468271470188544ULL,10959253511276599296ULL,4330520004484136960ULL,10815138323200743424ULL,11607771853338181632ULL,8364614976649238272ULL,17444719546862998784ULL,2669156352,18381468269893064448ULL,6419342512197474304ULL,11103650170688640000ULL,6492244531366860800ULL,14346241902646925312ULL,13841557270159628032ULL,7428148827772098304ULL,3464698581331941120ULL,18381468268953606144ULL,1645680384,18381468271554008832ULL,7140201027266418688ULL,5987558797656659712ULL,17588834734687262208ULL,7284033640602212096ULL,14273902834169157632ULL,18381468269087692288ULL,6852253225049397248ULL,17732667349600245504ULL,16291515470083266560ULL,10022503688432981760ULL,11968059825861367552ULL,9733991836700645376ULL,14850363587428816640ULL,18381468271168132864ULL,16147400282007410688ULL,656430432014827520,18381468270950094848ULL,15715054717226194944ULL,72057596690306560,11823944635485519872ULL,15859169905251653376ULL,17084149004500473856ULL,8581352906816952064ULL,2527949855582584832ULL,18381468271419856896ULL,8581352907253225472ULL,252776704,1376441223417430016ULL,14994761349590357760ULL,10527190521537370112ULL,0,9806614576878321664ULL,18381468271671515136ULL,17156206598538401792ULL,6059619689256392448ULL,10166619973990488064ULL,18381468271403079424ULL,17444719549178451968ULL,420746240,870625192710242304,4906133035823863552ULL,18381468269289150464ULL,18381468271671515136ULL,18381468271671515136ULL,9950729769032620032ULL,14778305994951169792ULL,269422336,0,0,18381468268785833984ULL,8941923452686178304ULL,18381468270950094848ULL,3440842496,1233456333565402880ULL,0,0,0,11823944636091210240ULL,2383877888,16724143605745719296ULL,2316834816,0,0 };
window->SetIconFromMemory(reinterpret_cast<uint8_t*>(iconRaw.data()), 16, 16);
inputManager = std::make_unique<OvWindowing::Inputs::InputManager>(*window);
window->MakeCurrentContext();
Expand Down
16 changes: 9 additions & 7 deletions Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ void OvEditor::Core::EditorActions::SaveAs()
switch (message.GetUserAction())
{
case OvWindowing::Dialogs::MessageBox::EUserAction::YES: break;
case OvWindowing::Dialogs::MessageBox::EUserAction::NO: return;
default: return;
}
}

auto currentScene = m_context.sceneManager.GetCurrentScene();
SaveSceneToDisk(*currentScene, dialog.GetSelectedFilePath());
OVLOG_INFO("Current scene saved to: " + dialog.GetSelectedFilePath());
Expand Down Expand Up @@ -942,31 +942,31 @@ void OvEditor::Core::EditorActions::PropagateFileRename(std::string p_previousNa
if (OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::ModelManager>().MoveResource(p_previousName, p_newName))
{
OvRendering::Resources::Model* resource = OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::ModelManager>()[p_newName];
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(resource) + offsetof(OvRendering::Resources::Model, path)) = p_newName;
const_cast<std::string&>(resource->path) = p_newName;
}

if (OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::TextureManager>().MoveResource(p_previousName, p_newName))
{
OvRendering::Resources::Texture* resource = OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::TextureManager>()[p_newName];
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(resource) + offsetof(OvRendering::Resources::Texture, path)) = p_newName;
const_cast<std::string&>(resource->path) = p_newName;
}

if (OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::ShaderManager>().MoveResource(p_previousName, p_newName))
{
OvRendering::Resources::Shader* resource = OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::ShaderManager>()[p_newName];
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(resource) + offsetof(OvRendering::Resources::Shader, path)) = p_newName;
const_cast<std::string&>(resource->path) = p_newName;
}

if (OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::MaterialManager>().MoveResource(p_previousName, p_newName))
{
OvCore::Resources::Material* resource = OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::MaterialManager>()[p_newName];
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(resource) + offsetof(OvCore::Resources::Material, path)) = p_newName;
const_cast<std::string&>(resource->path) = p_newName;
}

if (OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::SoundManager>().MoveResource(p_previousName, p_newName))
{
OvAudio::Resources::Sound* resource = OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::SoundManager>()[p_newName];
*reinterpret_cast<std::string*>(reinterpret_cast<char*>(resource) + offsetof(OvAudio::Resources::Sound, path)) = p_newName;
const_cast<std::string&>(resource->path) = p_newName;
}
}
else
Expand Down Expand Up @@ -1072,6 +1072,8 @@ void OvEditor::Core::EditorActions::PropagateFileRename(std::string p_previousNa
case OvTools::Utils::PathParser::EFileType::SOUND:
PropagateFileRenameThroughSavedFilesOfType(p_previousName, p_newName, OvTools::Utils::PathParser::EFileType::SCENE);
break;
default:
break;
}

EDITOR_PANEL(Panels::Inspector, "Inspector").Refresh();
Expand Down
15 changes: 7 additions & 8 deletions Sources/OvEditor/src/OvEditor/Core/ProjectHub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,16 @@ namespace OvEditor::Core
}
};

deleteButton.ClickedEvent += [this, &text, &actions, project] {
text.Destroy();
actions.Destroy();
Utils::ProjectManagement::UnregisterProject(project);
};
deleteButton.ClickedEvent += [this, &text, &actions, project] {
text.Destroy();
actions.Destroy();
Utils::ProjectManagement::UnregisterProject(project);
};

openButton.lineBreak = false;
deleteButton.lineBreak;
openButton.lineBreak = false;
}
}

std::optional<ProjectHubResult> GetResult() const
{
return m_result;
Expand Down
3 changes: 3 additions & 0 deletions Sources/OvEditor/src/OvEditor/Panels/AssetView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ OvEditor::Panels::AssetView::AssetView
if (auto resource = OvCore::Global::ServiceLocator::Get<OvCore::ResourceManagement::MaterialManager>().GetResource(path); resource)
SetMaterial(*resource);
break;

default:
break;
}
};
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/OvEditor/src/OvEditor/Panels/SceneView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ OvEditor::Panels::SceneView::SceneView
case SCENE: OnSceneDropped(path); break;
case MODEL: OnModelDropped(path); break;
case MATERIAL: OnMaterialDropped(path); break;
default: break;
}
};

OvCore::ECS::Actor::DestroyedEvent += [this](const OvCore::ECS::Actor& actor)
{
if (m_highlightedActor.has_value() && m_highlightedActor.value().GetID() == actor.GetID())
Expand Down
1 change: 1 addition & 0 deletions Sources/OvGame/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project "OvGame"
targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}")
objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}")
debugdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}")
fatalwarnings { "All" }

files {
"**.h",
Expand Down
Loading