Update Arduboy2.cpp

added one line to make certain sprites visible with some games. Obono's Evasion for example would have only the top half of the score displayed, the bottom of the sprite was cut off. adding "if (h % 8 != 0) rows++;" after rows is instantiated, we have normal behavior.
This commit is contained in:
poevoid 2021-07-28 13:51:37 -07:00 committed by GitHub
parent 92701849d6
commit f6f5a52cba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -839,6 +839,7 @@ void Arduboy2Base::drawBitmap
int8_t yOffset = y & 7; int8_t yOffset = y & 7;
int8_t sRow = y >> 3; int8_t sRow = y >> 3;
uint8_t rows = h >> 3; uint8_t rows = h >> 3;
if (h % 8 != 0) rows++;
for (int a = 0; a < rows; a++) { for (int a = 0; a < rows; a++) {
int bRow = sRow + a; int bRow = sRow + a;
if (bRow > (HEIGHT/8)-1) break; if (bRow > (HEIGHT/8)-1) break;