Original Post
I have created an algorithm for clearing a space in a buffer that is 80 * 32 chars wide. Here is the code for the algorithm: Right now it works as it is intended, but with one undesirable side effect: It clears the entire line, then writes the menu. So I have massive blank gaps on either side... Here:
Yes, those giant gaps to the left and right of the menu a box are what I am talking about, I cannot figure out what part I need to change to fix them...
for(int y = 0; y != height+1; ++y)
{
if(y == 0 || y == height)
{
for(int x = 0; x < width; ++x)
{
cell = begin + (x +((80 - width) * y));
buffer[cell].Char.AsciiChar = '=';
TranslateColor(conti->bordercolor, color);
buffer[cell].Attributes = color;
}
}
else
{
cell2 = cell;
for(int x = 1; x < width; ++x)
{
buffer[cell2 + (x +((80 - width) * y))].Char.AsciiChar = ' ';
buffer[cell2 + (x +((80 - width) * y))].Attributes = WHITE;
}
buffer[cell + (y * (80 - width))].Char.AsciiChar = '=';
buffer[cell + (y * (80 - width))].Attributes = color;
buffer[cell + (y * 80 )].Char.AsciiChar = '=';
buffer[cell + (y * 80 )].Attributes = color;
}
}
}
Yes, those giant gaps to the left and right of the menu a box are what I am talking about, I cannot figure out what part I need to change to fix them...