Inside3D!
     

LIT file fix

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Programming Tutorials
View previous topic :: View next topic  
Author Message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Sun Jan 10, 2010 10:58 pm    Post subject: LIT file fix Reply with quote

You know the story: you're playing a mod, the mod has a start.bsp, you have a start.lit in your ID1 folder, you get the wrong lighting.

I fixed this ages ago in DirectQ so I was quite surprised to recently learn that something similar wasn't universal.

I can't give exact code because everyone codes LIT file support differently, but the general approach is:
  • Run COM_FOpenFile to open your LIT file (let's assume it opens OK for now); the return value is the length of the file.
  • Subtract 8 from the length (for the header).
  • Divide the result by 3 (because it's 3 component lighting) - it should divide evenly by 3, if it doesn't it's another way of validating the LIT file.
  • The final result should be equal to l->filelen, if it's not then you have the wrong LIT file and abort loading it.

_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Mon Jan 11, 2010 12:15 am    Post subject: Reply with quote

why dont you engine coders use colored lighting with out lit files like half-life again?
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Mon Jan 11, 2010 12:43 am    Post subject: Reply with quote

Something to do with Q1BSP not supporting it I think. Wink

Extending Q1BSP to support it was tried before and didn't work. LIT files were preferred at the time because they were optional (you didn't need an engine that supported them) and they didn't pollute the original BSP.

Maybe things have changed since then? If so there's a thread to shout about it on.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines


Last edited by mh on Mon Jan 11, 2010 1:09 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Mon Jan 11, 2010 1:06 am    Post subject: Reply with quote

ohhh ic alright -.-
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Programming Tutorials All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group