From 193c3902f66718c9259df5d72fa27b3b69697091 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sun, 17 Sep 2017 00:54:52 -0400 Subject: [PATCH] Update README, small complilation warning fixes, reject zero-size FBOs --- README.md | 8 +++++--- src/app/ModuleWidget.cpp | 4 +--- src/util.cpp | 2 +- src/widgets/FramebufferWidget.cpp | 3 +++ src/widgets/TextField.cpp | 2 ++ 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a2390194..4b092bf5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -***Note: This repo is unsupported until September 7. See you at [Knobcon](https://knobcon.com/)!*** - # Rack *Rack* is the engine for the VCV open-source virtual Eurorack DAW. @@ -9,7 +7,7 @@ *If the build fails for you, please report the issue with a detailed error message to help the portability of Rack.* Clone this repository and `cd` into it. -On Windows, use [MSYS2](http://www.msys2.org/) and launch a mingw32/64 shell. +On Windows, use [MSYS2](http://www.msys2.org/) and launch a mingw64 shell. Clone submodules. @@ -25,6 +23,10 @@ Build Rack. make +Run Rack. + + make run + ## License Rack source code by [Andrew Belt](https://andrewbelt.name/) licensed under the [BSD-3-Clause](LICENSE.txt) diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index 0a41aa0c..72ab94aa 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -126,9 +126,8 @@ void ModuleWidget::draw(NVGcontext *vg) { Widget::draw(vg); -/* // CPU usage text - if (dynamic_cast(gScene)->toolbar->cpuUsageButton->value > 0.0) { + if (0) { float cpuTime = module ? module->cpuTime : 0.0; std::string text = stringf("%.1f%%", cpuTime * 100.0); @@ -147,7 +146,6 @@ void ModuleWidget::draw(NVGcontext *vg) { bndMenuItem(vg, 0.0, 0.0, box.size.x, BND_WIDGET_HEIGHT, BND_DEFAULT, -1, text.c_str()); nvgRestore(vg); } -*/ nvgResetScissor(vg); } diff --git a/src/util.cpp b/src/util.cpp index 8fba2144..923d441d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -57,7 +57,7 @@ void openBrowser(std::string url) { // shell injection is possible, so make sure the URL is trusted or hard coded #if ARCH_LIN std::string command = "xdg-open " + url; - system(command.c_str()); + (void)system(command.c_str()); #endif #if ARCH_MAC std::string command = "open " + url; diff --git a/src/widgets/FramebufferWidget.cpp b/src/widgets/FramebufferWidget.cpp index 9b5b0d9e..b637a6d4 100644 --- a/src/widgets/FramebufferWidget.cpp +++ b/src/widgets/FramebufferWidget.cpp @@ -41,6 +41,9 @@ void FramebufferWidget::step() { internal->box.size = box.size.plus(padding.mult(2)); Vec fbSize = internal->box.size.mult(gPixelRatio * oversample); // assert(fbSize.isFinite()); + // Reject zero area size + if (fbSize.x <= 0.0 || fbSize.y <= 0.0) + return; // Delete old one first to free up GPU memory internal->setFramebuffer(NULL); diff --git a/src/widgets/TextField.cpp b/src/widgets/TextField.cpp index afc7d224..31846f0e 100644 --- a/src/widgets/TextField.cpp +++ b/src/widgets/TextField.cpp @@ -33,6 +33,7 @@ bool TextField::onText(int codepoint) { char c = codepoint; std::string newText(1, c); insertText(newText); + return true; } bool TextField::onKey(int key) { @@ -99,6 +100,7 @@ bool TextField::onKey(int key) { begin = mini(maxi(begin, 0), text.size()); end = mini(maxi(end, 0), text.size()); + return true; } void TextField::onSelect() {