| 102 | } |
| 103 | |
| 104 | void OnPaint(surface_t* surface){ |
| 105 | int fontHeight = terminalFont->lineHeight; |
| 106 | |
| 107 | if(/*paintAll*/ true){ |
| 108 | for(int i = 0; i < rowCount && (bufferOffset + i) < static_cast<int>(buffer.size()); i++){ |
| 109 | int j = 0; |
| 110 | for(; j < static_cast<int>(buffer[bufferOffset + i].size()); j++){ |
| 111 | TerminalChar ch = buffer[bufferOffset + i][j]; |
| 112 | rgba_colour_t fg = colours[ch.s.fgColour]; |
| 113 | rgba_colour_t bg = colours[ch.s.bgColour]; |
| 114 | Lemon::Graphics::DrawRect(j * 8, i * fontHeight, 8, fontHeight, bg.r, bg.g, bg.b, surface); |
| 115 | Lemon::Graphics::DrawChar(ch.c, j * 8, i * fontHeight, fg.r, fg.g, fg.b, surface, terminalFont); |
| 116 | } |
| 117 | |
| 118 | Lemon::Graphics::DrawRect(j * 8, i * fontHeight, window->GetSize().x - j * 8, fontHeight, colours[state.bgColour], surface); |
| 119 | } |
| 120 | } else { |
| 121 | int j = 0; |
| 122 | for(; j < static_cast<int>(buffer[bufferOffset + curPos.y].size()); j++){ |
| 123 | TerminalChar ch = buffer[bufferOffset + curPos.y][j]; |
| 124 | rgba_colour_t fg = colours[ch.s.fgColour]; |
| 125 | rgba_colour_t bg = colours[ch.s.bgColour]; |
| 126 | Lemon::Graphics::DrawRect(j * 8, curPos.y * fontHeight, 8, fontHeight, bg.r, bg.g, bg.b, surface); |
| 127 | Lemon::Graphics::DrawChar(ch.c, j * 8, curPos.y * fontHeight, fg.r, fg.g, fg.b, surface, terminalFont); |
| 128 | } |
| 129 | |
| 130 | Lemon::Graphics::DrawRect(j * 8, curPos.y * fontHeight, window->GetSize().x - j * 8, fontHeight, colours[state.bgColour], surface); |
| 131 | } |
| 132 | |
| 133 | Lemon::Graphics::DrawRect(curPos.x * 8, curPos.y * fontHeight + (fontHeight / 4 * 3), 8, fontHeight / 4, colours[0x7] /* Grey */, surface); |
| 134 | |
| 135 | paintAll = false; |
| 136 | } |
| 137 | |
| 138 | void DoAnsiSGR(){ |
| 139 | int r = -1; |