diff --git a/.gitignore b/.gitignore index 39ef4ff7..4b48de02 100644 --- a/.gitignore +++ b/.gitignore @@ -854,3 +854,6 @@ bin-int/Debug-windows-x86_64/Nuake/scene.obj.enc bin-int/Debug-windows-x86_64/Nuake/userinterface.obj.enc Editor/recent.json bin-int +imgui.ini +.vscode/launch.json +.directory diff --git a/Nuake/dependencies/soloud_p5.lua b/Nuake/dependencies/soloud_p5.lua index d5a980a7..ed271fc0 100644 --- a/Nuake/dependencies/soloud_p5.lua +++ b/Nuake/dependencies/soloud_p5.lua @@ -37,11 +37,11 @@ project 'Soloud' filter "system:linux" defines { - "WITH_OSS" + "WITH_ALSA" } files { - "soloud/src/backend/oss/soloud_oss.cpp" + "soloud/src/backend/alsa/soloud_alsa.cpp" } filter "configurations:Debug" diff --git a/Nuake/src/Audio/AudioManager.cpp b/Nuake/src/Audio/AudioManager.cpp index d831bd2f..8d9af0ca 100644 --- a/Nuake/src/Audio/AudioManager.cpp +++ b/Nuake/src/Audio/AudioManager.cpp @@ -28,7 +28,7 @@ namespace Nuake { m_Soloud = CreateRef(); // TODO: Sample rate, back end, buffer size, flags. - m_Soloud->init(); + m_Soloud->init(SoLoud::Soloud::CLIP_ROUNDOFF,SoLoud::Soloud::ALSA); m_AudioThread = std::thread(&AudioManager::AudioThreadLoop, this); diff --git a/Nuake/src/Core/FileSystem.cpp b/Nuake/src/Core/FileSystem.cpp index 974269c3..60f01ea8 100644 --- a/Nuake/src/Core/FileSystem.cpp +++ b/Nuake/src/Core/FileSystem.cpp @@ -142,7 +142,7 @@ namespace Nuake { std::filesystem::path pathObj(fullPath); auto returnvalue = pathObj.parent_path().string(); - return returnvalue + "\\"; + return returnvalue + "/"; } std::string FileSystem::ReadFile(const std::string& path, bool absolute) diff --git a/Nuake/src/Rendering/SceneRenderer.cpp b/Nuake/src/Rendering/SceneRenderer.cpp index 246ff074..1eeb8682 100644 --- a/Nuake/src/Rendering/SceneRenderer.cpp +++ b/Nuake/src/Rendering/SceneRenderer.cpp @@ -202,32 +202,6 @@ namespace Nuake static float nammount = 0.0001; static float dbsize = 1.25f; static float feather = 1.0f; - ImGui::Begin("DOF Setting"); - { - ImGui::DragFloat("focalDepth", &focalDepth, 0.01f); - ImGui::DragFloat("focalLength", &focalLength, 0.01f); - ImGui::DragFloat("fstop", &fstop, 0.01f); - ImGui::DragInt("samples", &samples, 0.01f); - ImGui::DragInt("rings", &rings, 0.01f); - ImGui::Checkbox("showFocus", &showFocus); - ImGui::Checkbox("manualDof", &manualdof); - ImGui::Checkbox("autoFocus", &autoFocus); - ImGui::DragInt("rings", &rings, 0.01f); - ImGui::DragFloat("ndofstart", &ndofstart, 0.01f); - ImGui::DragFloat("ndofDist", &ndofDist, 0.01f); - ImGui::DragFloat("fdofstart", &fdofstart, 0.01f); - ImGui::DragFloat("fdofdist", &fdofdist, 0.01f); - ImGui::DragFloat("coc", &coc, 0.01f); - ImGui::DragFloat("maxBlue", &maxBlue, 0.01f); - ImGui::DragFloat("threshold", &threshold, 0.01f); - ImGui::DragFloat("gain", &gain, 0.01f); - ImGui::DragFloat("biaos", &biaos, 0.01f); - ImGui::DragFloat("fringe", &fringe, 0.01f); - ImGui::DragFloat("nammount", &nammount, 0.01f); - ImGui::DragFloat("dbsize", &dbsize, 0.01f); - ImGui::DragFloat("feather", &feather, 0.01f); - } - ImGui::End(); mDOFBuffer->QueueResize(framebuffer.GetSize()); mDOFBuffer->Bind(); @@ -266,12 +240,6 @@ namespace Nuake } mDOFBuffer->Unbind(); - if (ImGui::Begin("DOF")) - { - ImGui::Image((void*)mDOFBuffer->GetTexture()->GetID(), ImGui::GetContentRegionAvail(), ImVec2(0, 1), ImVec2(1, 0)); - } - ImGui::End(); - if (sceneEnv->BarrelDistortionEnabled) { mBarrelDistortionBuffer->QueueResize(framebuffer.GetSize()); diff --git a/Nuake/src/Rendering/Shaders/ShaderManager.cpp b/Nuake/src/Rendering/Shaders/ShaderManager.cpp index 2ef32d4d..df0545cc 100644 --- a/Nuake/src/Rendering/Shaders/ShaderManager.cpp +++ b/Nuake/src/Rendering/Shaders/ShaderManager.cpp @@ -4,7 +4,7 @@ #include "src/Resource/StaticResources.h" #define LoadEmbeddedShader(file) \ -m_Shaders[file##_path] = CreateScope(file##_path, std::string(file, file + file##_len)); +m_Shaders[file##_path] = CreateScope(file##_path, std::string(reinterpret_cast(file), reinterpret_cast(file) + file##_len)); namespace Nuake { @@ -17,7 +17,7 @@ namespace Nuake LoadEmbeddedShader(Resources_Shaders_atmospheric_sky_shader); LoadEmbeddedShader(Resources_Shaders_barrel_distortion_shader); LoadEmbeddedShader(Resources_Shaders_bloom_shader); - LoadEmbeddedShader(Resources_Shaders_blur_shader); + LoadEmbeddedShader(Resources_Shaders_blur_shader); LoadEmbeddedShader(Resources_Shaders_BRD_shader); LoadEmbeddedShader(Resources_Shaders_combine_shader); LoadEmbeddedShader(Resources_Shaders_copy_shader); diff --git a/Nuake/src/Scripting/ScriptingEngine.cpp b/Nuake/src/Scripting/ScriptingEngine.cpp index 8885ff33..326d3e05 100644 --- a/Nuake/src/Scripting/ScriptingEngine.cpp +++ b/Nuake/src/Scripting/ScriptingEngine.cpp @@ -66,7 +66,7 @@ namespace Nuake { } } -#define GET_STATIC_RESOURCE_SCRIPT_SRC(name) std::string(name, name + name##_len) +#define GET_STATIC_RESOURCE_SCRIPT_SRC(name) std::string(reinterpret_cast(name), reinterpret_cast(name) + name##_len) std::map _ModulesSRC = { @@ -94,8 +94,8 @@ namespace Nuake { { size_t prefixPosition = sname.find(NuakeModulePrefix); sname.erase(prefixPosition, NuakeModulePrefix.length()); - path = sname; - + path = "Resources/Scripts/"+std::string(sname); + if (_ModulesSRC.find(sname) != _ModulesSRC.end()) { fileContent = _ModulesSRC[sname]; diff --git a/Nuake/src/Vendors/katana-parser/selector.c b/Nuake/src/Vendors/katana-parser/selector.c index 957650da..d3e7e480 100644 --- a/Nuake/src/Vendors/katana-parser/selector.c +++ b/Nuake/src/Vendors/katana-parser/selector.c @@ -24,15 +24,15 @@ #include #include #include -strcasecmp(const char* a, const char* b) -{ - #ifdef NK_WIN - return _stricmp(a, b); - #endif - #ifdef NK_LINUX - return strcasecmp(a, b); - #endif -} +// strcasecmp(const char* a, const char* b) +// { +// #ifdef NK_WIN +// return _stricmp(a, b); +// #endif +// #ifdef NK_LINUX +// return strcasecmp(a, b); +// #endif +// } #undef assert #define assert(x) diff --git a/premake5.lua b/premake5.lua index 4ca3158d..a708409a 100644 --- a/premake5.lua +++ b/premake5.lua @@ -121,7 +121,7 @@ project "NuakeRuntime" location "Runtime" kind "ConsoleApp" language "C++" - + targetdir ("bin/" .. outputdir .. "/%{prj.name}") objdir ("bin-int/" .. outputdir .. "/%{prj.name}") debugdir ("Editor") @@ -144,9 +144,9 @@ project "NuakeRuntime" "%{prj.name}/../Nuake/Dependencies/build", "%{prj.name}/../Nuake/Dependencies/soloud/include" } - - libdirs - { + + libdirs + { "%{prj.name}/../Nuake/dependencies/assimp/lib/", "%{prj.name}/../Nuake/dependencies/freetype-windows-binaries/release static/win64", "%{prj.name}/../bin/%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}/Nuake/", @@ -159,8 +159,8 @@ project "NuakeRuntime" } links - { - "Nuake", + { + "Nuake", "GLFW", "glad", "assimp", @@ -183,13 +183,17 @@ project "NuakeRuntime" filter "system:linux" links { - "GL" + "GL", + "glfw", + "glad", + "X11", + "asound", } filter "configurations:Debug" runtime "Debug" symbols "on" - defines + defines { "NK_DEBUG" } @@ -199,7 +203,7 @@ project "NuakeRuntime" runtime "Release" optimize "on" - defines + defines { "NK_DIST", "WIN32_LEAN_AND_MEAN" @@ -213,7 +217,7 @@ project "NuakeRuntime" runtime "Release" optimize "on" flags { "WinMain" } - defines + defines { "NK_DIST" } @@ -298,7 +302,8 @@ project "Editor" "GL", "glfw", "glad", - "X11" + "X11", + "asound", } defines @@ -334,4 +339,4 @@ project "Editor" -- copy a file from the objects directory to the target directory postbuildcommands { --"{COPY} "Nuake/dependencies/GLFW/lib-vc2019/glfw3.dll" " .. "./bin/" .. outputdir .. "/%{prj.name}/glfw3.dll" - } \ No newline at end of file + }