private void DrawText(int lines, float y)
{
_visibleLines = lines;
int rows = (lines - idE.SmallCharacterWidth) / idE.SmallCharacterWidth; // rows of text to draw
int n, x = 0;
y = lines - (idE.SmallCharacterHeight * 3);
Vector4 color = idColor.Cyan;
// draw from the bottom up
if(_display != _currentLine)
{
// draw arrows to show the buffer is backscrolled
idE.RenderSystem.Color = idColor.Cyan;
for(x = 0; x < LineWidth; x += 4)
{
idE.RenderSystem.DrawSmallCharacter((x + 1) * idE.SmallCharacterWidth, (int) y, '^', _charSetShader);
}
y -= idE.SmallCharacterHeight;
rows--;
}
int row = _display;
if(x == 0)
{
row--;
}
Vector4 currentColor = idColor.White;
idE.RenderSystem.Color = currentColor;
for(int i = 0; i < rows; i++, y -= idE.SmallCharacterHeight, row--)
{
if((row < 0) || (row > _buffer.Count))
{
break;
}
if((_currentLine - row) >= TotalLines)
{
// past scrollback wrap point
continue;
}
string text = _buffer[row];
int length = text.Length;
for(n = 0, x = 0; n < length; n++, x++)
{
if(idHelper.IsColor(text, n) == true)
{
color = idHelper.ColorForIndex(text[n + 1]);
n += 1;
continue;
}
if(color != currentColor)
{
currentColor = color;
idE.RenderSystem.Color = color;
}
idE.RenderSystem.DrawSmallCharacter((x + 1) * idE.SmallCharacterWidth, (int) y, text[n], _charSetShader);
}
}
}