mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:08:12 +00:00
Kernel/Graphics: Remove unused overloaded write methods of Console
If we happen to print a string, we could use a StringView instead. For now, let's remove them entirely.
This commit is contained in:
parent
01d7c1b722
commit
e8d85b0694
5 changed files with 1 additions and 46 deletions
|
@ -132,22 +132,7 @@ void TextModeConsole::write(size_t x, size_t y, char ch) const
|
|||
m_y = 0;
|
||||
}
|
||||
}
|
||||
void TextModeConsole::write(size_t x, size_t y, String cstring) const
|
||||
{
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2));
|
||||
u16 color_mask = (m_default_foreground_color << 8) | (m_default_background_color << 12);
|
||||
for (size_t index = 0; index < cstring.length(); index++) {
|
||||
buf[index] = color_mask | cstring[index];
|
||||
}
|
||||
m_x = x + cstring.length();
|
||||
if (m_x >= max_column()) {
|
||||
m_x = 0;
|
||||
m_y = y + 1;
|
||||
if (m_y >= max_row())
|
||||
m_y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color foreground) const
|
||||
{
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
|
@ -161,22 +146,6 @@ void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color
|
|||
m_y = 0;
|
||||
}
|
||||
}
|
||||
void TextModeConsole::write(size_t x, size_t y, String cstring, Color background, Color foreground) const
|
||||
{
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2));
|
||||
u16 color_mask = foreground << 8 | background << 12;
|
||||
for (size_t index = 0; index < cstring.length(); index++) {
|
||||
buf[index] = color_mask | cstring[index];
|
||||
}
|
||||
m_x = x + cstring.length();
|
||||
if (m_x >= max_column()) {
|
||||
m_x = 0;
|
||||
m_y = y + 1;
|
||||
if (m_y >= max_row())
|
||||
m_y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextModeConsole::clear_vga_row(u16 row)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue