Let's see how I could do it... I really really really don't want to deal with TEXTURE1 stuff as then I'd have to deal with patches and cross-linked crap so it will be TX_ only. That shouldn't be a problem once I figure out TEX2TX_.exe
- Scan the WAD for TX_Textures and read all of them into a database.
- Scan the WAD for any lumps called "SIDEDEFS" and scan for textures.
- For each sidedef, read through the list for that texture names, if it's found, delete it from the list. When all lumps are scanned, the list will only contain unused textures.
- Open a new file and copy over every lump untill TX_START
- Go through and if the lump name is found in the list of textures, don't copy it over.
- Proceed untill TX_END is hit and copy the rest of the lumps.
- Write the lump directory. This is where I'm stuck.