Skip to main content
gamedev.net
🔒 Locked

BSP texture files

Started by Endar 2 replies 1k views
Original Post
Endar
Endar
I'm writing a BSP file loader, and I've found that the names of the texture file have no extension. Are they all TGA files? Or do I have to do searching the directory myself for a particular file name myself?
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Jimmy Valavanis
Jimmy Valavanis
What version of bsp are you talking about?
Bsp version 29 (Quake1 & Hexen2) had it's texture data inside bsp file.
Bsp version 30 (Halflife) uses external WAD files (header signature WAD2 & WAD3)
Bsp version 38 (Quake2 & Heretic 2) uses custom texture format (*.wal for quake, *.m8 )
Bsp version 46 (Quake 3) stores textures inside *.pk3 files (theese are actually zip files) in zip path /TEXTURES/xxxxx/texturename.tga or /TEXTURES/xxxxx/texturename.jpg

By the way, any information about bsp version 47???? (RTCW)
Endar
Endar
Good question. Its most likely that I'm looking at the Quake 3 version.

The reason that I asked is that the texture names are stored without extensions, so, I find myself in a bit of a problem. How am I supposed to know which file format to try and use? Am I going to have to search through the files in the directory and file one with the identical name?
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Jimmy Valavanis
Jimmy Valavanis
You must search whitch texture exist and use it. I'm not pretty sure but
I think that TGA images are RGB(0, 0, 0) transparent but jpg are not.
Also TGA textures somethimes appears to be compressed.

Quake 3:
I was dealing with this particular problem recently and my conclusion was this:

1. IF YOU OPEN A PK3 COMPRESSED FILE
------------------------------------
You must make module that opens zip and reads files and search for TEXTURE\base_xxx\texturename[.ext] where ].ext] = '.jpg. or '.tga'

2. IF YOU OPEN A STANDALONE MAP
-------------------------------
You must search in directories.

If you want any further help I can give some sample source code that
demonstrates how I've dealed with this problem while making my QuakeViewer

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.