SR Textool is a complete rewrite of Scanti's SR3 Texture Utilities. It started out as simple Linux port, but I wasn't satisfied with the code quality, so I decided to make my own implementation. After some weeks of work I'm glad to finally have something that's good enough for a release. Please report any bugs and features you want to see.
Features
Prerequisites
Commands
Help
Every command has a help flag to print out its usage information. Use this if you want to know all the available arguments and how to specify them.
Extract textures
Extract all textures to the current directory.
Extract only "professorgenki_sm_n.tga" and "professorgenki_sm_dp.tga".
Extract everything to the folder "extracted" (needs to be created first).
Update or add textures
Textures get automatically added it they don't exist. There's no need to specify which action to use.
Update "professorgenki_sm_n.tga.dds" and add "new_texture.tga.dds"
Update everything in the current directory
Create a new cpeg file
Linux only: Update all textures matching "*.dds"
Note: New textures with an alpha channel require the "BM_F_ALPHA" flag to be set. This can be done using the modify command. Existing textures already have it and don't need to be modified.
Delete textures
Delete "new_texture.tga.dds"
Modify texture
Change name of "new_texture.tga" to "new_texture2.tga"
Set alpha flag. A complete list of flags can be found in the Peg file format thread.
List contents
Check file for errors
This command only prints errors. No output means the file is good.
Planned features
Credits
Source code
https://github.com/Yepoleb/srtextool
License
LGPL-3.0+. You can check TLDRLegal if you want a short summary of what that means.
Downloads
There are three download targets: Windows (win), Linux (lin) and source code (src). The Windows and Linux archives contain a 32 and 64 bit build. If you are unsure if your computer supports 64 bit, choose the 32 bit version.
Features
- Extract, add, update, delete and modify textures from cvbm_pc/cpeg_pc files
- Can show detailed information about each entry like size, format, mip levels and flags
- Supports checking files for errors
- Extract and update only selected files
- Create new PEG files
- Open source license to encourage contributions
Prerequisites
- Put the cpeg_pc, gpeg_pc and maybe dds files in a single folder. It should look like this:
- We need some way to call the srtextool binary. You can either copy srtextool.exe to that same folder or do it the proper way and add its install location to the PATH environment variable. Beginners should choose the first option, but regular users would probably benefit from having the tool available everywhere. You can find a tutorial here for example.
- Shift + right click in the Explorer window and select "Open command windows here"
- Type your commands in that window.
Commands
Help
Every command has a help flag to print out its usage information. Use this if you want to know all the available arguments and how to specify them.
Code:
srtextool --help
srtextool x --help
srtextool a --help
Extract textures
Extract all textures to the current directory.
Code:
srtextool x professorgenki.cpeg_pc
Extract only "professorgenki_sm_n.tga" and "professorgenki_sm_dp.tga".
Code:
srtextool x professorgenki.cpeg_pc professorgenki_sm_n.tga professorgenki_sm_dp.tga
Extract everything to the folder "extracted" (needs to be created first).
Code:
srtextool x professorgenki.cpeg_pc -o extracted
Update or add textures
Textures get automatically added it they don't exist. There's no need to specify which action to use.
Update "professorgenki_sm_n.tga.dds" and add "new_texture.tga.dds"
Code:
srtextool a professorgenki.cpeg_pc professorgenki_sm_n.tga.dds new_texture.tga.dds
Update everything in the current directory
Code:
srtextool a professorgenki.cpeg_pc -i .
Create a new cpeg file
Code:
srtextool a new.cpeg_pc new_texture.tga.dds
Linux only: Update all textures matching "*.dds"
Code:
srtextool a professorgenki.cpeg_pc *.dds
Note: New textures with an alpha channel require the "BM_F_ALPHA" flag to be set. This can be done using the modify command. Existing textures already have it and don't need to be modified.
Delete textures
Delete "new_texture.tga.dds"
Code:
srtextool d professorgenki.cpeg_pc new_texture.tga.dds
Modify texture
Change name of "new_texture.tga" to "new_texture2.tga"
Code:
srtextool m professorgenki.cpeg_pc new_texture.tga -n new_texture2.tga
Set alpha flag. A complete list of flags can be found in the Peg file format thread.
Code:
srtextool m professorgenki.cpeg_pc new_texture.tga -f 0x1
List contents
Code:
srtextool l professorgenki.cpeg_pc
Check file for errors
This command only prints errors. No output means the file is good.
Code:
srtextool c professorgenki.cpeg_pc
Planned features
- Creating new peg files directly, without a clean header file.
- Adding textures with an alpha channel
- More file error checks
- Scripts for drag and drop extraction/updating
Credits
- [V] Knobby for providing the headers of the Peg file format
- Scanti for writing the SR3 Texture Utilities, which were a great starting point
Source code
https://github.com/Yepoleb/srtextool
License
LGPL-3.0+. You can check TLDRLegal if you want a short summary of what that means.
Downloads
There are three download targets: Windows (win), Linux (lin) and source code (src). The Windows and Linux archives contain a 32 and 64 bit build. If you are unsure if your computer supports 64 bit, choose the 32 bit version.
Attachments
Last edited: