Skip to content
Open
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
*.make

# Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
Expand Down Expand Up @@ -864,4 +865,4 @@ Nuake/dependencies/glad/glad.vcxproj.filters
*.csproj
*.filters
cloc.exe
Nuake/src/Modules/Modules.cpp
Nuake/src/Modules/Modules.cpp
2 changes: 1 addition & 1 deletion Editor/Source/Editor/ComponentsPanel/ComponentPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#define CompononentPropertyName(name) \
ImGui::AlignTextToFramePadding(); \
ImGui::Text(##name);
ImGui::Text(name);

#define BeginComponentTable(name, component) \
UIFont* boldFont = new UIFont(Fonts::Bold); \
Expand Down
12 changes: 6 additions & 6 deletions Editor/Source/Editor/ComponentsPanel/MaterialEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void MaterialEditor::Draw(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image1"), (ImTextureID)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetAlbedo(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -133,7 +133,7 @@ void MaterialEditor::Draw(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image3"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 1), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetNormal(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -164,7 +164,7 @@ void MaterialEditor::Draw(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image2"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("Image files (*.png) | *.png | Image files (*.jpg) | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetAO(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -198,7 +198,7 @@ void MaterialEditor::Draw(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image4"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 1), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetMetalness(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -232,7 +232,7 @@ void MaterialEditor::Draw(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image5"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetRoughness(TextureManager::Get()->GetTexture(texture));
Expand All @@ -252,4 +252,4 @@ void MaterialEditor::Draw(Ref<Nuake::Material> material)
}
ImGui::EndChild();
}
}
}
2 changes: 1 addition & 1 deletion Editor/Source/Editor/EditorApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ void EditorApplication::OnInit()
void EditorApplication::OnShutdown()
{
Nuake::Engine::Close();
}
}
4 changes: 4 additions & 0 deletions Editor/Source/Editor/Misc/ImGuiTextHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

#include <imgui/imgui.h>

#ifndef _MSC_VER
#define strncpy_s strncpy
#endif

void ImGuiTextSTD(const std::string& label, std::string& value)
{
char buffer[256];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ int GetSelectedEntity()

void EditorNetAPI::RegisterMethods()
{
RegisterMethod("Editor.SetSelectedEntityIcall", &SelectEntity);
RegisterMethod("Editor.GetSelectedEntityIcall", &GetSelectedEntity);
RegisterMethod("Editor.SetSelectedEntityIcall", (void*)(&SelectEntity));
RegisterMethod("Editor.GetSelectedEntityIcall", (void*)(&GetSelectedEntity));
}
2 changes: 1 addition & 1 deletion Editor/Source/Editor/Windows/EditorInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2260,7 +2260,7 @@ namespace Nuake {
void OpenScene()
{
// Parse the project and load it.
std::string projectPath = FileDialog::OpenFile(".scene");
std::string projectPath = FileDialog::OpenFile("Scene file\0*.scene");
if (projectPath.empty() || !FileSystem::FileExists(projectPath, true))
{
return;
Expand Down
30 changes: 15 additions & 15 deletions Editor/Source/Editor/Windows/EditorSelectionPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void EditorSelectionPanel::DrawFile(Ref<Nuake::File> file)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#skytexture1"), (void*)textureId, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (!texture.empty())
{
sky->SetTextureFace(SkyFaces::Top, FileSystem::AbsoluteToRelative(texture));
Expand All @@ -335,7 +335,7 @@ void EditorSelectionPanel::DrawFile(Ref<Nuake::File> file)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#skytexture2"), (void*)textureId, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (!texture.empty())
{
sky->SetTextureFace(SkyFaces::Bottom, FileSystem::AbsoluteToRelative(texture));
Expand All @@ -362,7 +362,7 @@ void EditorSelectionPanel::DrawFile(Ref<Nuake::File> file)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#skytexture3"), (void*)textureId, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (!texture.empty())
{
sky->SetTextureFace(SkyFaces::Left, FileSystem::AbsoluteToRelative(texture));
Expand All @@ -389,7 +389,7 @@ void EditorSelectionPanel::DrawFile(Ref<Nuake::File> file)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#skytexture4"), (void*)textureId, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (!texture.empty())
{
sky->SetTextureFace(SkyFaces::Right, FileSystem::AbsoluteToRelative(texture));
Expand All @@ -416,7 +416,7 @@ void EditorSelectionPanel::DrawFile(Ref<Nuake::File> file)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#skytexture5"), (void*)textureId, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (!texture.empty())
{
sky->SetTextureFace(SkyFaces::Front, FileSystem::AbsoluteToRelative(texture));
Expand All @@ -443,7 +443,7 @@ void EditorSelectionPanel::DrawFile(Ref<Nuake::File> file)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#skytexture6"), (void*)textureId, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (!texture.empty())
{
sky->SetTextureFace(SkyFaces::Back, FileSystem::AbsoluteToRelative(texture));
Expand Down Expand Up @@ -1587,7 +1587,7 @@ void EditorSelectionPanel::DrawMaterialPanel(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image1"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetAlbedo(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -1621,7 +1621,7 @@ void EditorSelectionPanel::DrawMaterialPanel(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image3"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 1), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetNormal(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -1652,7 +1652,7 @@ void EditorSelectionPanel::DrawMaterialPanel(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image2"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("Image files (*.png) | *.png | Image files (*.jpg) | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetAO(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -1683,7 +1683,7 @@ void EditorSelectionPanel::DrawMaterialPanel(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image4"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 1), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetMetalness(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -1717,7 +1717,7 @@ void EditorSelectionPanel::DrawMaterialPanel(Ref<Nuake::Material> material)

if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image5"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
std::string texture = FileDialog::OpenFile("Image Files\0*.png|*.jpg");
if (texture != "")
{
material->SetRoughness(TextureManager::Get()->GetTexture(texture));
Expand Down Expand Up @@ -2040,10 +2040,10 @@ void EditorSelectionPanel::DrawFieldTypeString(entt::meta_data& field, entt::met
std::string controlId = std::string("##") + displayName;
ImGui::InputText(controlId.c_str(), &fieldValProxy);

//if (fieldValProxy != fieldVal)
//{
// Engine::GetProject()->IsDirty = true;
//}
if (fieldValProxy != (const char*)fieldVal.data())
{
Engine::GetProject()->IsDirty = true;
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Editor/Source/Editor/Windows/MapImporterWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void MapImporterWindow::Draw()
using namespace Nuake;
if (ImGui::Button(buttonLbl.c_str()))
{
std::string selectedFile = FileDialog::OpenFile("*.map");
std::string selectedFile = FileDialog::OpenFile("Quake maps\0*.map");
std::string relativePath = FileSystem::AbsoluteToRelative(selectedFile);
if (!selectedFile.empty() && FileSystem::FileExists(relativePath))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "PrefabEditorWindow.h"

#include <Nuake/Core/Input.h>
#include <Nuake/Rendering/Buffers/FrameBuffer.h>
#include <Nuake/Rendering/Buffers/Framebuffer.h>
#include <Nuake/Rendering/SceneRenderer.h>
#include <Nuake/Resource/Prefab.h>
#include <Nuake/Scene/Scene.h>
Expand Down
2 changes: 1 addition & 1 deletion Editor/Source/Editor/Windows/ProjectInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace Nuake {
ImGui::SameLine();
if (ImGui::Button("Browse"))
{
std::string path = FileDialog::OpenFile("*.exe");
std::string path = FileDialog::OpenFile("Windows Executable\0*.exe");
if (path != "")
{
path += "/../";
Expand Down
70 changes: 59 additions & 11 deletions Editor/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project "Editor"
targetname ("Nuake Engine")
targetname "NuakeEngine"

kind "ConsoleApp"
language "C++"
Expand Down Expand Up @@ -72,18 +72,66 @@ project "Editor"
"msdf-gen",
"msdf-atlas-gen",
"Freetype",
"vma"
"vma",
"dxcompiler"
}
libdirs { "../Nuake/Thirdparty/dxc/lib/x64" }

prebuildcommands {
'{ECHO} "Copying dxcompiler.dll to Working directory..."',
'{COPYFILE} "%{wks.location}Nuake/Thirdparty/dxc/bin/x64/dxcompiler.dll" "%{cfg.debugdir}/"',
'{ECHO} Copying Coral to Working directory...',
'{COPYFILE} "%{wks.location}Nuake/Thirdparty/Coral/Coral.Managed/bin/%{cfg.buildcfg}/Coral.Managed.dll" "%{cfg.debugdir}/"',
'{COPYFILE} "%{wks.location}Nuake/Thirdparty/Coral/Coral.Managed/bin/%{cfg.buildcfg}/Coral.Managed.runtimeconfig.json" "%{cfg.debugdir}/"',
'{COPYFILE} "%{wks.location}NuakeNet/Build/%{cfg.buildcfg}/Binaries/NuakeNet.dll" "%{cfg.debugdir}/"',
'xcopy /E /I /Y "%{wks.location}Data" "%{cfg.debugdir}\\Resources"'
}
filter "system:windows"
defines
{
"NK_WIN"
}
prebuildcommands {
'{ECHO} "Copying dxcompiler.dll to Working directory..."',
'{COPYFILE} "%{wks.location}Nuake/Thirdparty/dxc/bin/x64/dxcompiler.dll" "%{cfg.debugdir}/"',
'{ECHO} Copying Coral to Working directory...',
'{COPYFILE} "%{wks.location}Nuake/Thirdparty/Coral/Coral.Managed/bin/%{cfg.buildcfg}/Coral.Managed.dll" "%{cfg.debugdir}/"',
'{COPYFILE} "%{wks.location}Nuake/Thirdparty/Coral/Coral.Managed/bin/%{cfg.buildcfg}/Coral.Managed.runtimeconfig.json" "%{cfg.debugdir}/"',
'{COPYFILE} "%{wks.location}NuakeNet/Build/%{cfg.buildcfg}/Binaries/NuakeNet.dll" "%{cfg.debugdir}/"',
'xcopy /E /I /Y "%{wks.location}Data" "%{cfg.debugdir}\\Resources"'
}

filter "system:linux"
defines
{
"NK_LINUX"
}

links
{
"GL",
"glfw",
"glad",
"X11",
"asound",
"glib-2.0",
"gtk-3",
"gobject-2.0"
}
linkoptions { "`pkg-config --libs glib-2.0 pango gdk-pixbuf-2.0 gtk+-3.0 glib-2.0 gobject-2.0`" }

filter "system:bsd"
defines
{
"NK_LINUX",
"NK_BSD"
}

links
{
"GL",
"glfw",
"glad",
"X11",
"asound",
"glib-2.0",
"gtk-3",
"gobject-2.0",
"pthread",
"execinfo"
}
linkoptions { "`pkg-config --libs glib-2.0 pango gdk-pixbuf-2.0 gtk+-3.0 glib-2.0 gobject-2.0`" }

filter { "system:windows", "action:vs*"}
flags
Expand Down
4 changes: 2 additions & 2 deletions Nuake/Source/Nuake/Application/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "LayerStack.h"

#include <string>
#include <Vector>
#include <vector>
#include "Nuake/Window.h"


Expand Down Expand Up @@ -86,4 +86,4 @@ namespace Nuake {
// Implemented by the client
Application* CreateApplication(int argc, char** argv);

}
}
4 changes: 2 additions & 2 deletions Nuake/Source/Nuake/Application/EntryPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Nuake {
g_ApplicationRunning = false;
}

return 1;
return 0;
}
}

Expand All @@ -41,4 +41,4 @@ int main(int argc, char** argv)
{
return Nuake::Main(argc, argv);
}
#endif
#endif
11 changes: 7 additions & 4 deletions Nuake/Source/Nuake/Core/OS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,13 @@ namespace Nuake {
{
path = "";
}
#endif

#ifdef NK_LINUX
path = "~/.config";
#elif defined(NK_LINUX)
const char* homeDir = getenv("HOME");
// fallback, should be almost impossible in almost all desktop setups
if (homeDir[0] == '\0')
homeDir = "/root";
path = std::string(homeDir) + "/.config";
#endif

return path;
Expand Down Expand Up @@ -224,4 +227,4 @@ namespace Nuake {
system(command.c_str());
#endif
}
}
}
Loading