Bläddra i källkod

* Small optimisation in import_text().

tags/v0.99.beta14
Sam Hocevar sam 18 år sedan
förälder
incheckning
930abfc743
1 ändrade filer med 5 tillägg och 8 borttagningar
  1. +5
    -8
      cucul/import.c

+ 5
- 8
cucul/import.c Visa fil

@@ -39,6 +39,8 @@ static cucul_canvas_t *import_ansi(void const *, unsigned int);
*
* \li \c "": attempt to autodetect the file format.
*
* \li \c "ansi": import ANSI files.
*
* \li \c "caca": import native libcaca files.
*
* \param data The memory area to be loaded into a canvas.
@@ -175,15 +177,10 @@ static cucul_canvas_t *import_text(void const *data, unsigned int size)
continue;
}

while(x >= width)
{
width++;
cucul_set_canvas_size(cv, width, height);
}

while(y >= height)
if(x >= width || y >= height)
{
height++;
width = x + 1;
height = y + 1;
cucul_set_canvas_size(cv, width, height);
}



Laddar…
Avbryt
Spara