use the correct bytes per pixel count

This commit is contained in:
Bill Currie 2003-09-04 16:26:14 +00:00
parent d0aaa5263b
commit ff43d61f81

View file

@ -117,9 +117,15 @@ Mod_LoadExternalTextures (model_t *mod)
if (f) { if (f) {
targa = LoadTGA (f); targa = LoadTGA (f);
Qclose (f); Qclose (f);
if (targa->format < 4) {
tx->gl_texturenum = tx->gl_texturenum =
GL_LoadTexture (tx->name, targa->width, targa->height, GL_LoadTexture (tx->name, targa->width, targa->height,
targa->data, true, false, 3); targa->data, true, false, 3);
} else {
tx->gl_texturenum =
GL_LoadTexture (tx->name, targa->width, targa->height,
targa->data, true, false, 4);
}
} }
} }
} }