Fixed .lit file (colored lighting) support.

This commit is contained in:
Forest Hale 2000-06-29 22:18:13 +00:00
parent 98c7aeb439
commit 244ea57e1a

View file

@ -503,15 +503,18 @@ void Mod_LoadLighting (lump_t *l)
strcat(litfilename, ".lit");
loadmodel->lightdata = Hunk_AllocName ( l->filelen*3, litfilename);
in = loadmodel->lightdata + l->filelen*2; // place the file at the end, so it will not be overwritten until the very last write
out = loadmodel->lightdata;
memcpy (in, mod_base + l->fileofs, l->filelen);
for (i = 0;i < l->filelen;i++)
if (!loadmodel->lightdata) // LordHavoc: someone forgot this... preventing .lit from working
{
d = *in++;
*out++ = d;
*out++ = d;
*out++ = d;
in = loadmodel->lightdata + l->filelen*2; // place the file at the end, so it will not be overwritten until the very last write
out = loadmodel->lightdata;
memcpy (in, mod_base + l->fileofs, l->filelen);
for (i = 0;i < l->filelen;i++)
{
d = *in++;
*out++ = d;
*out++ = d;
*out++ = d;
}
}
}