commit 1b85cd2eb1faf0c9e8788caea53ce7dfb0543627
Author: Jon Bell <jondbell@protonmail.com>
AuthorDate: Mon Apr 27 06:48:15 2020 -0600
Commit: Jon Bell <jondbell@protonmail.com>
CommitDate: Mon Apr 27 06:48:15 2020 -0600
replace hardcoded height in flipBuffer
---
source/graphics.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/graphics.cpp b/source/graphics.cpp
index c4909ba..a014fdb 100644
--- a/source/graphics.cpp
+++ b/source/graphics.cpp
@@ -826,7 +826,7 @@ void Graphics::flipBuffer(uint8_t* fb, int width, int height) {
uint8_t c = _pico8_fb[x*128 + y];
Color col = PaletteColors[_gfxState_screenPaletteMap[c]];
- int pixIdx = (((x + xOffset)*240)+ (239 - (y + yOffset)))*3;
+ int pixIdx = (((x + xOffset)*height)+ ((height - 1) - (y + yOffset)))*3;
fb[pixIdx + 0] = col.Blue;
fb[pixIdx + 1] = col.Green;