Skip to content

SalineDepths/WADParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WADParser

This is a lightweight library to be used for loading .wad files. A .wad file contains a set of "lumps," which all have an 8 char long name (lumps with names shorter than that have null terminators appended automatically) and every lump contains an arbitrary set of data expressed as bytes. These bytes can represent anything, from strings, to audio files, to images, etc etc. While the LumpEntry class here does have a convenience constructor for converting strings to byte arrays, it is generally assumed that a program using this library knows how to use the bytes in a given lump.

To use this library, create an instance of the WADParserObject and call Open() with the path to your .wad file. Afterwards, the WADParserObject will contain a list of lumps that can be accessed and modified via the various member functions. While the list cannot be directly accessed, all getter functions return lumps by reference, allowing you to directly modify the name or data of a given lump. When you're ready to save out the file, Write() automatically handles the assembling of the new directory and saves to the given filepath. If a file already exists at that path, the writer will first destroy that file, then recreate it.

WADParserObject can also create a WAD file from scratch, provided you can provide it with lumps; just keep in mind that if doing so, you should call SetWadType with "PWAD" or "IWAD" before attempting to save. This is a required part of every WAD's header and is automatically loaded by Open, but will need to be provided manually for custom-built WADs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages