working on new text engine
This commit is contained in:
@@ -49,8 +49,8 @@ void Text::init()
|
||||
// Establece las coordenadas para cada caracter ascii de la cadena y su ancho
|
||||
for (int i = 32; i < 128; i++)
|
||||
{
|
||||
mOffset[i].x = ((i - 32) % 16) * mBoxWidth;
|
||||
mOffset[i].y = ((i - 32) / 16) * mBoxHeight;
|
||||
mOffset[i].x = ((i - 32) % 15) * mBoxWidth;
|
||||
mOffset[i].y = ((i - 32) / 15) * mBoxHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,10 +138,12 @@ void Text::initOffsetFromFile()
|
||||
std::getline(rfile, buffer);
|
||||
std::getline(rfile, buffer);
|
||||
mBoxWidth = std::stoi(buffer);
|
||||
//printf("mBoxWidth: %i\n", mBoxWidth);
|
||||
|
||||
std::getline(rfile, buffer);
|
||||
std::getline(rfile, buffer);
|
||||
mBoxHeight = std::stoi(buffer);
|
||||
//printf("mBoxHeight: %i\n", mBoxHeight);
|
||||
|
||||
// lee el resto de datos del fichero
|
||||
int index = 32;
|
||||
@@ -150,8 +152,10 @@ void Text::initOffsetFromFile()
|
||||
{
|
||||
// Almacena solo las lineas impares
|
||||
if (line_read % 2 == 1)
|
||||
{
|
||||
//printf("%i - %i - %s\n", line_read, index, buffer.c_str());
|
||||
mOffset[index++].w = std::stoi(buffer);
|
||||
|
||||
}
|
||||
//Then clear the buffer once you're done with it.
|
||||
buffer.clear();
|
||||
line_read++;
|
||||
|
||||
Reference in New Issue
Block a user