|
Re: .thu files [message #352185 is a reply to message #352180] |
Fri, 26 September 2008 10:12 |
|
saberhawk
Messages: 1068 Registered: January 2006 Location: ::1
Karma: 0
|
General (1 Star) |
|
|
They store the width/height/other info about each texture to speed up texture loading
|
|
|
|
Re: .thu files [message #352219 is a reply to message #352180] |
Fri, 26 September 2008 15:00 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Two very relevant quotes on the subject:
[quote author=vloktboky link=topic=6599.msg86642#msg86642 date=1156653869]
This is a simple application I made while reverse engineering the file format of the .THU files used in Renegade. It is not complete as I have not figured out what each element and section of the file represents. Hopefully someone out there can figure out other puzzle pieces and the format can be completed and well-documented for the betterment of others. I have included my email address with the readme.txt file if anyone would like to contact me and share their findings or ideas about the missing elements in the file format.
I have also included the source code for anyone interested. You will find the functionality of the THU parser is contained in a single class instance, making porting into your own applications easy. You are free to do with it as you wish.
http://www.black-cell.net/~vloktboky/THUParser.zip
[/quote]
[quote author=vloktboky link=topic=6599.msg87078#msg87078 date=1157235524]
The THU file is a propriatary file format used by Westwood in Renegade. They contain collected data of texture content that is contained within the MIX file of a map. This data includes the image resolution, DDS DXT compression format, etc.
I speculate that the reason why Westwood did this was to save time during the loading/rendering portion of the engine when you need to get these textures for drawing the different portions of the maps. For example, pretty much all of the Westwood maps contain the textures used on the terrain pieces (like the rock walls on Canyon, etc) inside the MIX files. Rather than having to open up the MIX file, extract the data, and load it up everytime you are exposed to a mesh object that uses that terrain file, they stored it in these external files. This would speed up the process a bit which I'm sure gave them a performance boost back then.
The problem is, the engine does not recreate these files once they have been created. So if you update the textures stored in the MIX files (or if you put a different image file with the same name in your Data folder) and it uses a different resolution, the game will not know that and will attempt to draw the texture using the resolution it stored in the THU file.
The above solution is a crude (roughly 60%) interpreter of the file format, giving you the ability to access and modify the data in the THU files. It also contains a simple application that will update the data in the THU files with the resolution specs of any same-named image files in your Data folder it finds.
[/quote]
|
|
|
|