From 65bbdfe1c300baae65d977c1dc9228ccc58acf2f Mon Sep 17 00:00:00 2001 From: Oscar Sebio Cajaraville Date: Tue, 20 Feb 2018 19:52:45 +0100 Subject: [PATCH] Prep for v0.1.1 Changed version numbers. Added about window. Added OpenMP directive to make texture dilation faster. Selecting a system font for windows builds. --- Fornos.sln | 3 ++ Src/fornosui.cpp | 37 +++++++++++++++++++++-- Src/image.cpp | 11 +++++++ VS/Fornos.vcxproj | 75 ++++++++++++++++++++++++++++++++++++++++++++++ VS/fornos.rc | Bin 5350 -> 5354 bytes 5 files changed, 124 insertions(+), 2 deletions(-) diff --git a/Fornos.sln b/Fornos.sln index 1dcdc76..f79208e 100644 --- a/Fornos.sln +++ b/Fornos.sln @@ -8,11 +8,14 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 + Distribution|x64 = Distribution|x64 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F3C028D0-DD47-4671-AB0F-E8005741F210}.Debug|x64.ActiveCfg = Debug|x64 {F3C028D0-DD47-4671-AB0F-E8005741F210}.Debug|x64.Build.0 = Debug|x64 + {F3C028D0-DD47-4671-AB0F-E8005741F210}.Distribution|x64.ActiveCfg = Distribution|x64 + {F3C028D0-DD47-4671-AB0F-E8005741F210}.Distribution|x64.Build.0 = Distribution|x64 {F3C028D0-DD47-4671-AB0F-E8005741F210}.Release|x64.ActiveCfg = Release|x64 {F3C028D0-DD47-4671-AB0F-E8005741F210}.Release|x64.Build.0 = Release|x64 EndGlobalSection diff --git a/Src/fornosui.cpp b/Src/fornosui.cpp index 1cab813..fc5250c 100644 --- a/Src/fornosui.cpp +++ b/Src/fornosui.cpp @@ -28,6 +28,7 @@ SOFTWARE. #include #include #include +#include static const char* normalImportNames[3] = { "Import", "Compute per face", "Compute per vertex" }; @@ -702,6 +703,7 @@ class FornosUI_Impl void renderWorkInProgress(); void renderErrors(); void renderLogWindow(); + void renderAboutPopup(); void startBaking(); private: @@ -717,6 +719,7 @@ class FornosUI_Impl std::string _bakeErrors; bool _showLog = false; + bool _showAbout = false; float _mainMenuHeight = 0; }; @@ -752,7 +755,7 @@ void FornosUI_Impl::render(int windowWidth, int windowHeight) renderWorkInProgress(); renderErrors(); - + renderAboutPopup(); } void FornosUI_Impl::renderMainMenu() @@ -763,7 +766,7 @@ void FornosUI_Impl::renderMainMenu() { ImGui::MenuItem("Log", "CTRL+L", &_showLog); ImGui::Separator(); - if (ImGui::MenuItem("About")) { ImGui::OpenPopup("About"); } + ImGui::MenuItem("About", nullptr, &_showAbout); ImGui::EndMenu(); } _mainMenuHeight = ImGui::GetWindowHeight(); @@ -875,6 +878,27 @@ void FornosUI_Impl::renderLogWindow() ImGui::End(); } +void FornosUI_Impl::renderAboutPopup() +{ + if (_showAbout && !ImGui::IsPopupOpen("AboutPopup")) + { + ImGui::OpenPopup("AboutPopup"); + } + + if (ImGui::BeginPopupModal("AboutPopup", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar)) + { + ImGui::Text("Fornos"); + ImGui::Text("v0.1.1"); + ImGui::Text("Oscar S.C. (c) 2018"); + if (ImGui::Button("Ok")) + { + ImGui::CloseCurrentPopup(); + _showAbout = false; + } + ImGui::EndPopup(); + } +} + void FornosUI_Impl::startBaking() { _runner->start(_params, _bakeErrors); @@ -893,7 +917,16 @@ void FornosUI::init(FornosRunner *runner, GLFWwindow *window) { _impl->setRunner(runner); ImGui_ImplGlfwGL3_Init(window, true); + SetupImGuiStyle(true, 1.0f); + + ImGuiIO& io = ImGui::GetIO(); + +#if _WIN32 + const std::string windir = std::getenv("windir"); + const std::string fontdir = windir + "\\fonts\\segoeui.ttf"; + io.Fonts->AddFontFromFileTTF(fontdir.c_str(), 16.0f); +#endif } void FornosUI::shutdown() diff --git a/Src/image.cpp b/Src/image.cpp index 0c74e41..fc68d8a 100644 --- a/Src/image.cpp +++ b/Src/image.cpp @@ -22,7 +22,9 @@ SOFTWARE. #include "image.h" #include "compute.h" +#include "logging.h" #include "math.h" +#include "timing.h" #include #pragma warning(disable:4996) @@ -122,13 +124,19 @@ std::vector createValidPixelsTableRGB return validPixels; } +#define DEBUG 1 + void dilateRGB(uint8_t *data, const CompressedMapUV *map, const std::vector &validPixels, const size_t maxDist) { + Timing timing; + timing.begin(); + const PixPos offsets[] = { { 1,0 },{ -1,0 },{ 0,1 },{ 0,-1 },{ 1,1 },{ 1,-1 },{ -1,1 },{ -1,-1 } }; const int w = int(map->width); const int h = int(map->height); +#pragma omp parallel for for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) @@ -172,6 +180,9 @@ void dilateRGB(uint8_t *data, const CompressedMapUV *map, const std::vectorDebug Win32 + + Distribution + Win32 + + + Distribution + x64 + Release Win32 @@ -38,6 +46,13 @@ true MultiByte + + Application + false + v141 + true + MultiByte + Application true @@ -51,6 +66,13 @@ true MultiByte + + Application + false + v141 + true + MultiByte + @@ -62,17 +84,27 @@ + + + + + + $(SolutionDir)Builds\$(Platform)\$(Configuration)\ Intermediate\$(Platform)\$(Configuration)\ + + $(SolutionDir)Builds\$(Platform)\$(Configuration)\ + Intermediate\$(Platform)\$(Configuration)\ + $(SolutionDir)Builds\$(Platform)\$(Configuration)\ Intermediate\$(Platform)\$(Configuration)\ @@ -95,6 +127,7 @@ Disabled true ..\3rdParty\glad\include;..\3rdParty\glfw\include;..\3rdParty\imgui;..\3rdParty\imgui\addons\imguifilesystem;..\3rdParty\tinyexr;..\3rdParty\tinyply;%(AdditionalIncludeDirectories) + NDEBUG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) glfw3.lib;%(AdditionalDependencies) @@ -118,6 +151,22 @@ glfw3.lib;%(AdditionalDependencies) + + + Level3 + MaxSpeed + true + true + true + ..\3rdParty\glad\include;..\3rdParty\glfw\include;..\3rdParty\imgui;..\3rdParty\imgui\addons\imguifilesystem;..\3rdParty\tinyexr;..\3rdParty\tinyply;%(AdditionalIncludeDirectories) + + + true + true + ..\3rdParty\glfw\lib;%(AdditionalLibraryDirectories) + glfw3.lib;%(AdditionalDependencies) + + Level3 @@ -127,6 +176,32 @@ true ..\3rdParty\glad\include;..\3rdParty\glfw\include;..\3rdParty\imgui;..\3rdParty\imgui\addons\imguifilesystem;..\3rdParty\tinyexr;..\3rdParty\tinyply;%(AdditionalIncludeDirectories) MultiThreaded + NDEBUG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) + + + true + true + glfw3.lib;%(AdditionalDependencies) + ..\3rdParty\glfw\lib;%(AdditionalLibraryDirectories) + Windows + + + + + + + + + Level3 + Full + true + true + true + ..\3rdParty\glad\include;..\3rdParty\glfw\include;..\3rdParty\imgui;..\3rdParty\imgui\addons\imguifilesystem;..\3rdParty\tinyexr;..\3rdParty\tinyply;%(AdditionalIncludeDirectories) + MultiThreaded + NDEBUG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) + NotSet + true true diff --git a/VS/fornos.rc b/VS/fornos.rc index 34182acd32186a41ad0c2f0b8271c84a007f5046..c48c1f7f4d8b278bcced6866800802aa4549336b 100644 GIT binary patch delta 47 zcmaE+`AT!c6b?qi$x}HD84Wid=dff3Qj9#}Oh7S49_h($d_tSu_?|FrRueqH3;