From faa6854e540d1d5a87f40151844fd566ae7bef38 Mon Sep 17 00:00:00 2001 From: VIGNESH KUMAR <45727291+VICTORVICKIE@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:53:48 +0530 Subject: [PATCH] use % --- raylib.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/raylib.js b/raylib.js index 8d300b2..15c8691 100644 --- a/raylib.js +++ b/raylib.js @@ -226,8 +226,9 @@ class RaylibJs { // Mark end with null bytes[fmt_text.length] = 0; - this.textFormatBufferIndex += 1; - if (this.textFormatBufferIndex >= MAX_TEXTFORMAT_BUFFERS) this.textFormatBufferIndex = 0; + + // Move to next buffer for next function call + this.textFormatBufferIndex = (this.textFormatBufferIndex + 1) % MAX_TEXTFORMAT_BUFFERS; return heap_ptr; }