Fix 1-bit bitmap rendering and add player turn modal
This commit is contained in:
@@ -484,11 +484,11 @@ void LowLevelRenderer::draw_arc(int center_x, int center_y, int radius, int star
|
||||
|
||||
void LowLevelRenderer::draw_bitmap(const unsigned char* bitmap, int x, int y, int width, int height, bool invert)
|
||||
{
|
||||
int byteWidth = (width + 7) / 8; // Bitmaps are typically padded to the next full byte for each row
|
||||
for (int py = 0; py < height; ++py) {
|
||||
for (int px = 0; px < width; ++px) {
|
||||
int bit_index = py * width + px;
|
||||
int byte_index = bit_index / 8;
|
||||
int bit_offset = 7 - (bit_index % 8); // MSB first
|
||||
int byte_index = py * byteWidth + (px / 8);
|
||||
int bit_offset = 7 - (px % 8); // MSB first
|
||||
bool pixel_on = (bitmap[byte_index] & (1 << bit_offset)) != 0;
|
||||
if (invert) {
|
||||
pixel_on = !pixel_on;
|
||||
|
||||
Reference in New Issue
Block a user