adding text color to the render class
This commit is contained in:
@@ -18,12 +18,16 @@
|
||||
|
||||
LowLevelRenderer::LowLevelRenderer(uint8_t* buffer, int width, int height)
|
||||
: bit_buffer(buffer), V_WIDTH(width), V_HEIGHT(height), current_font(&font_acme_5_outlines),
|
||||
clipping_enabled(false), clip_x(0), clip_y(0), clip_width(width), clip_height(height) {}
|
||||
clipping_enabled(false), clip_x(0), clip_y(0), clip_width(width), clip_height(height), text_color(true) {}
|
||||
|
||||
void LowLevelRenderer::set_font(const unsigned char (*font)[96][6]) {
|
||||
current_font = font;
|
||||
}
|
||||
|
||||
void LowLevelRenderer::set_text_color(bool color) {
|
||||
text_color = color;
|
||||
}
|
||||
|
||||
// Clipping functions
|
||||
void LowLevelRenderer::set_clip_rect(int x, int y, int width, int height) {
|
||||
clip_x = x;
|
||||
@@ -431,7 +435,7 @@ void LowLevelRenderer::draw_bitmap(const unsigned char* bitmap, int x, int y, in
|
||||
pixel_on = !pixel_on;
|
||||
}
|
||||
if (pixel_on) {
|
||||
set_pixel(x + px, y + py, true);
|
||||
set_pixel(x + px, y + py, text_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -499,7 +503,7 @@ void LowLevelRenderer::draw_char_vcol(int x, int y, char c)
|
||||
// Most of these 1-bit fonts use bit 0 as the top pixel
|
||||
if (column_byte & (1 << row))
|
||||
{
|
||||
set_pixel(x + col, y + row, true);
|
||||
set_pixel(x + col, y + row, text_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,7 +541,7 @@ void LowLevelRenderer::draw_char_scaled(int x, int y, char c, int scale)
|
||||
{
|
||||
set_pixel(x + (col * scale) + sx,
|
||||
y + (row * scale) + sy,
|
||||
true);
|
||||
text_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user