draws wonky line

This commit is contained in:
Emanuele Trabattoni
2021-05-28 00:05:42 +02:00
parent 8325dcfdd8
commit a77b66e4ef
5 changed files with 100 additions and 41 deletions

View File

@@ -49,9 +49,9 @@ namespace Render {
}
void Mare::setPixel(uint8_t* img, uint16_t x, uint16_t y, bool value){
assert(x <= _screenSize.x);
assert(y <= _screenSize.y);
img += (sizeof(uint8_t)*y*(_screenSize.x/8) + sizeof(uint8_t)*(x/8));
if (x >= _screenSize.x) return;
if (y >= _screenSize.y) return;
img += (sizeof(uint8_t)*y*(_screenSize.x>>3) + sizeof(uint8_t)*(x>>3));
if (value) *img &= ~(0x80 >> (x%8));
else *img |= (0x80 >> (x%8));
}