From 0c854ff1cc29d1111957ff6efb47c21df7587adb Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Fri, 4 Dec 2020 15:34:52 +0000 Subject: [PATCH] remove unused code --- src/app.cpp | 19 +------------- src/app.hpp | 2 +- src/nvg_util.cpp | 68 ------------------------------------------------ src/nvg_util.hpp | 11 -------- 4 files changed, 2 insertions(+), 98 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 1319f1c..eaea2df 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -3,6 +3,7 @@ // #include "nanovg/deko3d/nanovg_dk.h" #include "nanovg_dk.h" #include +#include #include #ifndef NDEBUG @@ -49,16 +50,6 @@ void App::Loop() { } } -template -void test(Args... args) { - const auto size = sizeof...(args); - std::printf("we have this many args %lu\n", size); -} - -// void function(std::same_as> auto ... args) { -// // ... -// } - void App::Poll() { // this will break with new libnx. when it does, let me know and i'll fix it hidScanInput(); @@ -101,14 +92,6 @@ void App::Poll() { } }; - if (this->controller.A) { - // test(pair{"cat", true}, pair{"dog", false}); - // LOG("float returned is %.2f\n", nvgText(this->vg, 0, 0, "hello there hhhhhhhhh", nullptr)); - } else if (this->controller.Y) { - // test(pair{"cat", true}); - // gfx::drawButtons(this->vg, gfx::pair{gfx::Button::A, "ayy"}, gfx::pair{gfx::Button::A, "beee"}); - } - display("A", this->controller.A); display("B", this->controller.B); display("X", this->controller.X); diff --git a/src/app.hpp b/src/app.hpp index 5cacecd..5b8dbdb 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -105,7 +105,7 @@ class App final { void DrawConfirm(); void DrawProgress(); -private: // from nanovg decko3d example by addubz +private: // from nanovg decko3d example by adubbz static constexpr unsigned NumFramebuffers = 2; static constexpr unsigned StaticCmdSize = 0x1000; dk::UniqueDevice device; diff --git a/src/nvg_util.cpp b/src/nvg_util.cpp index 72a4b02..88a5d74 100644 --- a/src/nvg_util.cpp +++ b/src/nvg_util.cpp @@ -120,41 +120,6 @@ void drawRect(NVGcontext* vg, float x, float y, float w, float h, const NVGpaint nvgFill(vg); } -void drawRoundedRect(NVGcontext* vg, float x, float y, float w, float h, float r, Colour c) { - nvgBeginPath(vg); - nvgRoundedRect(vg, x, y, w, h, r); - nvgFillColor(vg, getColour(c)); - nvgFill(vg); -} - -void drawRoundedRect(NVGcontext* vg, float x, float y, float w, float h, float r, const NVGcolor& c) { - nvgBeginPath(vg); - nvgRoundedRect(vg, x, y, w, h, r); - nvgFillColor(vg, c); - nvgFill(vg); -} - -void drawRoundedRect(NVGcontext* vg, float x, float y, float w, float h, float r, const NVGcolor&& c) { - nvgBeginPath(vg); - nvgRoundedRect(vg, x, y, w, h, r); - nvgFillColor(vg, c); - nvgFill(vg); -} - -void drawRoundedRect(NVGcontext* vg, float x, float y, float w, float h, float r, const NVGpaint& p) { - nvgBeginPath(vg); - nvgRoundedRect(vg, x, y, w, h, r); - nvgFillPaint(vg, p); - nvgFill(vg); -} - -void drawRoundedRect(NVGcontext* vg, float x, float y, float w, float h, float r, const NVGpaint&& p) { - nvgBeginPath(vg); - nvgRoundedRect(vg, x, y, w, h, r); - nvgFillPaint(vg, p); - nvgFill(vg); -} - void drawText(NVGcontext* vg, float x, float y, float size, const char* str, const char* end, int align, Colour c) { nvgBeginPath(vg); nvgFontSize(vg, size); @@ -188,41 +153,8 @@ void drawTextArgs(NVGcontext* vg, float x, float y, float size, int align, Colou va_end(v); } -void drawTriangle(NVGcontext* vg, float aX, float aY, float bX, float bY, float cX, float cY, Colour c) { - nvgBeginPath(vg); - nvgMoveTo(vg, aX, aY); - nvgLineTo(vg, bX, bY); - nvgLineTo(vg, cX, cY); - nvgFillColor(vg, getColour(c)); - nvgFill(vg); -} - -void drawTriangle(NVGcontext* vg, float aX, float aY, float bX, float bY, float cX, float cY, const NVGcolor& c) { - nvgBeginPath(vg); - nvgMoveTo(vg, aX, aY); - nvgLineTo(vg, bX, bY); - nvgLineTo(vg, cX, cY); - nvgFillColor(vg, c); - nvgFill(vg); -} - -void drawTriangle(NVGcontext* vg, float aX, float aY, float bX, float bY, float cX, float cY, const NVGcolor&& c) { - nvgBeginPath(vg); - nvgMoveTo(vg, aX, aY); - nvgLineTo(vg, bX, bY); - nvgLineTo(vg, cX, cY); - nvgFillColor(vg, c); - nvgFill(vg); -} - void drawButton(NVGcontext* vg, float x, float y, float size, Button button) { drawText(vg, x, y, size, getButton(button), nullptr, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE, getColour(Colour::WHITE)); } -void drawButtonText(NVGcontext* vg, float x, float y, float size, Button button, const char* text) { - const float text_pos = x + size + 12.f; - drawButton(vg, x, y, size, button); - drawText(vg, text_pos, y, size, text, nullptr, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE, getColour(Colour::WHITE)); -} - } // namespace tj::gfx diff --git a/src/nvg_util.hpp b/src/nvg_util.hpp index 497d487..e4894e6 100644 --- a/src/nvg_util.hpp +++ b/src/nvg_util.hpp @@ -64,23 +64,12 @@ void drawRect(NVGcontext*, float x, float y, float w, float h, const NVGcolor&& void drawRect(NVGcontext*, float x, float y, float w, float h, const NVGpaint& p); void drawRect(NVGcontext*, float x, float y, float w, float h, const NVGpaint&& p); -void drawRoundedRect(NVGcontext*, float x, float y, float w, float h, float r, Colour c); -void drawRoundedRect(NVGcontext*, float x, float y, float w, float h, float r, const NVGcolor& c); -void drawRoundedRect(NVGcontext*, float x, float y, float w, float h, float r, const NVGcolor&& c); -void drawRoundedRect(NVGcontext*, float x, float y, float w, float h, float r, const NVGpaint& p); -void drawRoundedRect(NVGcontext*, float x, float y, float w, float h, float r, const NVGpaint&& p); - -void drawTriangle(NVGcontext*, float aX, float aY, float bX, float bY, float cX, float cY, Colour c); -void drawTriangle(NVGcontext*, float aX, float aY, float bX, float bY, float cX, float cY, const NVGcolor& c); -void drawTriangle(NVGcontext*, float aX, float aY, float bX, float bY, float cX, float cY, const NVGcolor&& c); - void drawText(NVGcontext*, float x, float y, float size, const char* str, const char* end, int align, Colour c); void drawText(NVGcontext*, float x, float y, float size, const char* str, const char* end, int align, const NVGcolor& c); void drawText(NVGcontext*, float x, float y, float size, const char* str, const char* end, int align, const NVGcolor&& c); void drawTextArgs(NVGcontext*, float x, float y, float size, int align, Colour c, const char* str, ...); void drawButton(NVGcontext* vg, float x, float y, float size, Button button); -void drawButtonText(NVGcontext* vg, float x, float y, float size, Button button, const char* text); const char* getButton(Button button);