From 88e63b22db64b1cde7341d244c70cd63c1b9b5a4 Mon Sep 17 00:00:00 2001 From: niansa Date: Sat, 8 Apr 2023 19:08:13 +0200 Subject: [PATCH] Improved UX just another tiny bit. --- NDSUI.cpp | 6 +++++- NDSUI.hpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NDSUI.cpp b/NDSUI.cpp index 9aacfe8..2be0fe8 100644 --- a/NDSUI.cpp +++ b/NDSUI.cpp @@ -116,7 +116,10 @@ bool NDSUI::printChar(const char character, Position2D *topleftpos, const int co if (row == 0) y_start = y; row++; } else if (row) { - glBoxFilled(topleftpos->x + x, topleftpos->y + y_start, topleftpos->x + x, topleftpos->y + y - (!bold)*1, color); + if (row >= 3 || boxesRendered < 1000 || ((x&1) || (y&1))) { + glBoxFilled(topleftpos->x + x, topleftpos->y + y_start, topleftpos->x + x, topleftpos->y + y - (!bold)*1, color); + boxesRendered++; + } row = 0; } ++y; @@ -188,6 +191,7 @@ NDSUI::NDSUI() { void NDSUI::run() { currentInstance = this; + boxesRendered = 0; // Update buttons scanButtons(); // Update keyboard diff --git a/NDSUI.hpp b/NDSUI.hpp index 34ac05c..da525ca 100644 --- a/NDSUI.hpp +++ b/NDSUI.hpp @@ -61,6 +61,7 @@ class NDSUI { unsigned inputLineBufHead = 0; std::vector messages; std::unique_ptr> userInputHandler = nullptr; + unsigned boxesRendered; unsigned scrollOff = 0; static void kbCallback(int key);