mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
allocate space for the texture correctly
This commit is contained in:
parent
88c2735d9c
commit
a01456f851
1 changed files with 4 additions and 3 deletions
|
@ -87,16 +87,17 @@ LoadPCX (QFile *f, int convert, byte *pal)
|
|||
dataByte = (byte *) &pcx[1];
|
||||
|
||||
count = (pcx->xmax + 1) * (pcx->ymax + 1);
|
||||
tex = Hunk_TempAlloc (field_offset (tex_t, data[count]));
|
||||
tex->width = pcx->xmax + 1;
|
||||
tex->height = pcx->ymax + 1;
|
||||
if (convert) {
|
||||
tex = Hunk_TempAlloc (field_offset (tex_t, data[count * 4]));
|
||||
tex->format = tex_rgba;
|
||||
tex->palette = 0;
|
||||
} else {
|
||||
tex = Hunk_TempAlloc (field_offset (tex_t, data[count]));
|
||||
tex->format = tex_palette;
|
||||
tex->palette = pal;
|
||||
}
|
||||
tex->width = pcx->xmax + 1;
|
||||
tex->height = pcx->ymax + 1;
|
||||
pix = tex->data;
|
||||
|
||||
while (count) {
|
||||
|
|
Loading…
Reference in a new issue