Move the tex conversion to libQFimage.

This is for the conversion /to/ paletted textures. The conversion is
necessary for csqc support. In the process, the conversion has been sped up
by implementing a color cache for the conversion process. I haven't
measured the difference yet, but Mr Fixit does seem to load much faster for
the sw renderer than it did before the change (many months old memory).
This commit is contained in:
Bill Currie 2013-05-11 08:02:43 +09:00
parent d39adc6a64
commit 0cae54d25d
5 changed files with 190 additions and 61 deletions

View file

@ -104,7 +104,7 @@ load_image (const char *name)
switch (tex->format) {
case tex_palette:
for (i = 0, s = tex->data, d = image->data; i < pixels; i++) {
byte *v = tex->palette + *s++ * 3;
const byte *v = tex->palette + *s++ * 3;
*d++ = *v++;
*d++ = *v++;
*d++ = *v++;