Fix for .lit support. (fixes black wall bug, oops)

This commit is contained in:
Forest Hale 2000-06-30 09:33:43 +00:00
parent 27e89eb634
commit a02481c08c

View file

@ -480,6 +480,8 @@ void Mod_LoadTextures (lump_t *l)
} }
} }
extern byte *COM_LoadFile (char *path, int usehunk);
/* /*
================= =================
Mod_LoadLighting Mod_LoadLighting
@ -502,9 +504,10 @@ void Mod_LoadLighting (lump_t *l)
COM_StripExtension(litfilename, litfilename); COM_StripExtension(litfilename, litfilename);
strcat(litfilename, ".lit"); strcat(litfilename, ".lit");
loadmodel->lightdata = Hunk_AllocName ( l->filelen*3, litfilename); loadmodel->lightdata = (byte*) COM_LoadHunkFile (litfilename);
if (!loadmodel->lightdata) // LordHavoc: someone forgot this... preventing .lit from working if (!loadmodel->lightdata) // expand the white lighting data
{ {
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 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; out = loadmodel->lightdata;
memcpy (in, mod_base + l->fileofs, l->filelen); memcpy (in, mod_base + l->fileofs, l->filelen);