From c19b9fd34dea24f82c69a33c38cb208e6ab1f323 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 9 Oct 2021 03:22:04 +0100 Subject: [PATCH] Fix non-debug builds; Special DPF tweaks; Disable auto-save Signed-off-by: falkTX --- dpf | 2 +- plugins/Cardinal/CardinalPlugin.cpp | 5 ++++- plugins/Cardinal/CardinalUI.cpp | 4 +++- plugins/Cardinal/GL/glew.h | 6 +++++- plugins/Cardinal/Window.cpp | 11 ++++++----- plugins/Cardinal/dep.cpp | 3 +++ 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/dpf b/dpf index d8f66c1..a1322bc 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit d8f66c1e06cafedf000fe75afcf67b96b3efbc6c +Subproject commit a1322bc0c5814633ec3c82080540a2657f4f4486 diff --git a/plugins/Cardinal/CardinalPlugin.cpp b/plugins/Cardinal/CardinalPlugin.cpp index be30991..757f220 100644 --- a/plugins/Cardinal/CardinalPlugin.cpp +++ b/plugins/Cardinal/CardinalPlugin.cpp @@ -32,7 +32,9 @@ #include -#undef DEBUG +#ifdef NDEBUG +# undef DEBUG +#endif #include "DistrhoPlugin.hpp" START_NAMESPACE_DISTRHO @@ -54,6 +56,7 @@ struct Initializer { using namespace rack; settings::devMode = true; + settings::autosaveInterval = 0; system::init(); asset::init(); logger::init(); diff --git a/plugins/Cardinal/CardinalUI.cpp b/plugins/Cardinal/CardinalUI.cpp index e020dac..c94342f 100644 --- a/plugins/Cardinal/CardinalUI.cpp +++ b/plugins/Cardinal/CardinalUI.cpp @@ -24,7 +24,9 @@ #include #include -#undef DEBUG +#ifdef NDEBUG +# undef DEBUG +#endif #include "DistrhoUI.hpp" #include "ResizeHandle.hpp" diff --git a/plugins/Cardinal/GL/glew.h b/plugins/Cardinal/GL/glew.h index 416b573..1dc94d3 100644 --- a/plugins/Cardinal/GL/glew.h +++ b/plugins/Cardinal/GL/glew.h @@ -1,3 +1,7 @@ #pragma once -#undef DEBUG + +#ifdef NDEBUG +# undef DEBUG +#endif + #include "OpenGL.hpp" diff --git a/plugins/Cardinal/Window.cpp b/plugins/Cardinal/Window.cpp index e3b8121..fe955da 100644 --- a/plugins/Cardinal/Window.cpp +++ b/plugins/Cardinal/Window.cpp @@ -15,7 +15,9 @@ #include // used in Window::screenshot #include // used in Window::screenshot -#undef DEBUG +#ifdef NDEBUG +# undef DEBUG +#endif #include "DistrhoUI.hpp" namespace rack { @@ -74,7 +76,7 @@ struct Window::Internal { int frame = 0; bool ignoreNextMouseDelta = false; - int frameSwapInterval = -1; + int frameSwapInterval = 1; double monitorRefreshRate = 60.0; // FIXME double frameTime = 0.0; double lastFrameDuration = 0.0; @@ -102,8 +104,7 @@ Window::Window() { INFO("UI pointer: %p", lastUI); vg = lastUI->getContext(); - INFO("NanoVG context: %p", vg); -// fbVg = nvgCreateSharedGL2(vg, nvgFlags); + fbVg = nvgCreateSharedGL2(vg, NVG_ANTIALIAS); // Load default Blendish font uiFont = loadFont(asset::system("res/fonts/DejaVuSans.ttf")); @@ -154,7 +155,7 @@ void Window::step() { double t1 = 0.0, t2 = 0.0, t3 = 0.0, t4 = 0.0, t5 = 0.0; // Make event handlers and step() have a clean NanoVG context - nvgReset(vg); +// nvgReset(vg); bndSetFont(uiFont->handle); diff --git a/plugins/Cardinal/dep.cpp b/plugins/Cardinal/dep.cpp index 8c105dc..c020754 100644 --- a/plugins/Cardinal/dep.cpp +++ b/plugins/Cardinal/dep.cpp @@ -2,6 +2,9 @@ #include // for fopen_u8 +#ifdef NDEBUG +# undef DEBUG +#endif #include "OpenGL.hpp" #define BLENDISH_IMPLEMENTATION