wad

package
v0.0.0-...-1d919a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeOneOffs = map[string][2]string{
	"SND_ON":   [2]string{"patch", "widgets"},
	"SND_OFF":  [2]string{"patch", "widgets"},
	"BLOCK1":   [2]string{"patch", "block"},
	"BLOCK2":   [2]string{"patch", "block"},
	"BLOCK3":   [2]string{"patch", "block"},
	"CACHEBAR": [2]string{"patch", "misc"},
	"INFO1":    [2]string{"patch", "info"},
	"INFO2":    [2]string{"patch", "info"},
	"INFO3":    [2]string{"patch", "info"},
	"INFO4":    [2]string{"patch", "info"},
	"INFO5":    [2]string{"patch", "info"},
	"INFO6":    [2]string{"patch", "info"},
	"INFO7":    [2]string{"patch", "info"},
	"INFO8":    [2]string{"patch", "info"},
	"INFO9":    [2]string{"patch", "info"},
	"DEADJOE":  [2]string{"patch", "boss-deaths"},
	"DEADROBO": [2]string{"patch", "boss-deaths"},
	"DEADSTEV": [2]string{"patch", "boss-deaths"},
	"DEADTOM":  [2]string{"patch", "boss-deaths"},
	"HSWITCH5": [2]string{"tpatch", "masked"},
	"HSWITCH8": [2]string{"tpatch", "masked"},
	"HSWTICH4": [2]string{"patch", "masked"},
	"HSWITCH6": [2]string{"patch", "masked"},
	"HSWITCH7": [2]string{"patch", "masked"},
	"HSWTCH9":  [2]string{"patch", "masked"},
	"ENTRANCE": [2]string{"wall", "wall"},
	"EXIT":     [2]string{"wall", "wall"},
	"PAL":      [2]string{"raw", "misc"},
	"LICENSE":  [2]string{"raw", "misc"},
	"IMFREE":   [2]string{"lbm", "misc"},
	"BOOTBLOD": [2]string{"lbm", "misc"},
	"BOOTNORM": [2]string{"lbm", "misc"},
	"SVENDOR":  [2]string{"lbm", "misc"},
	"DEADBOSS": [2]string{"lbm", "misc"},
	"MMBK":     [2]string{"pic", "misc"},
	"PAUSED":   [2]string{"pic", "misc"},
	"WAIT":     [2]string{"pic", "misc"},
	"TNUMB":    [2]string{"pic", "misc"},
	"BATTP":    [2]string{"pic", "misc"},
	"DOOR2":    [2]string{"wall", "doors"},
	"EDOOR":    [2]string{"wall", "doors"},
	"RAMDOOR1": [2]string{"wall", "doors"},
	"SDOOR4":   [2]string{"wall", "doors"},
	"SNADOOR":  [2]string{"wall", "doors"},
	"SNDOOR":   [2]string{"wall", "doors"},
	"SNKDOOR":  [2]string{"wall", "doors"},
	"TNADOOR":  [2]string{"wall", "doors"},
	"TNDOOR":   [2]string{"wall", "doors"},
	"TNKDOOR":  [2]string{"wall", "doors"},
	"TRIDOOR1": [2]string{"wall", "doors"},
	"SIDE8":    [2]string{"wall", "side"},
	"SIDE21":   [2]string{"wall", "side"},
	"LOCK1":    [2]string{"wall", "side"},
	"LOCK2":    [2]string{"wall", "side"},
	"LOCK3":    [2]string{"wall", "side"},
	"LOCK4":    [2]string{"wall", "side"},
	"SIDE13":   [2]string{"wall", "side"},
	"SIDE16":   [2]string{"wall", "side"},
	"SIDE17":   [2]string{"wall", "side"},
	"KEY1":     [2]string{"pic", "keys"},
	"KEY2":     [2]string{"pic", "keys"},
	"KEY3":     [2]string{"pic", "keys"},
	"KEY4":     [2]string{"pic", "keys"},
}

Functions

func DumpFlatDataToFile

func DumpFlatDataToFile(destFhnd io.WriteSeeker, lumpReader io.Reader, iwad lumps.ArchiveReader, width int, height int, transparent bool) (int64, error)

convert palette image data to PNG before writing

func DumpLBMDataToFile

func DumpLBMDataToFile(destFhnd io.WriteSeeker, lumpInfo lumps.ArchiveEntry, lumpReader io.Reader, iwad lumps.ArchiveReader) (int64, error)

convert expression of freedom from euclidian oppression to PNG

func DumpLpicDataToFile

func DumpLpicDataToFile(destFhnd io.WriteSeeker, lumpInfo lumps.ArchiveEntry, lumpReader io.Reader, iwad lumps.ArchiveReader) (int64, error)

convert floor and ceiling data to PNG

func DumpPatchDataToFile

func DumpPatchDataToFile(destFhnd io.WriteSeeker, lumpInfo lumps.ArchiveEntry, lumpReader io.Reader, iwad lumps.ArchiveReader) (int64, error)

convert patch data to PNG before writing

func DumpPicDataToFile

func DumpPicDataToFile(destFhnd io.WriteSeeker, lumpInfo lumps.ArchiveEntry, lumpReader io.Reader, iwad lumps.ArchiveReader) (int64, error)

convert VGA planar data to PNG

func DumpTransPatchDataToFile

func DumpTransPatchDataToFile(destFhnd io.WriteSeeker, lumpInfo lumps.ArchiveEntry, lumpReader io.Reader, iwad lumps.ArchiveReader) (int64, error)

convert translucent patch data to PNG before writing

func GetImageFromFlatData

func GetImageFromFlatData(lumpReader io.Reader, iwad lumps.ArchiveReader, width int, height int, transparent bool) (*image.RGBA, error)

func GetImageFromLpicData

func GetImageFromLpicData(lumpInfo lumps.ArchiveEntry, lumpReader io.Reader, iwad lumps.ArchiveReader) (*image.RGBA, error)

func GetImageFromPicData

func GetImageFromPicData(lumpInfo lumps.ArchiveEntry, lumpReader io.Reader, iwad lumps.ArchiveReader) (*image.RGBA, error)

func ROTTGuessFileTypeAndSubdir

func ROTTGuessFileTypeAndSubdir(entry *WADEntry) (string, string)

Types

type LBMHeader

type LBMHeader struct {
	Width   uint16
	Height  uint16
	Palette [256]RGB
}

type LumpHeader

type LumpHeader struct {
	FilePos uint32
	Size    uint32
	Name    [8]byte
}

func (*LumpHeader) NameString

func (l *LumpHeader) NameString() string

type Palette

type Palette struct {
	R, G, B uint8
}

type PatchHeader

type PatchHeader struct {
	OrigSize   int16
	Width      int16
	Height     int16
	LeftOffset int16
	TopOffset  int16
}

sprites (guns, actors, etc.)

type RGB

type RGB struct {
	R, G, B uint8
}

type RottLpicHeader

type RottLpicHeader struct {
	Width  uint16
	Height uint16
	OrgX   uint16
	OrgY   uint16
}

floors and ceilings

type RottPatchHeader

type RottPatchHeader struct {
	OrigSize     int16
	Width        int16
	Height       int16
	LeftOffset   int16
	TopOffset    int16
	Transparency int16
}

wall and sky textures

type RottPicHeader

type RottPicHeader struct {
	Width  uint8
	Height uint8
}

type WADEntry

type WADEntry struct {
	Number     int
	LumpName   string
	Reader     *WADReader
	LumpHeader *LumpHeader
}

func NewWADEntry

func NewWADEntry(name string, number int, header *LumpHeader, reader *WADReader) *WADEntry

func (*WADEntry) GuessFileTypeAndSubdir

func (w *WADEntry) GuessFileTypeAndSubdir() (string, string)

func (*WADEntry) Name

func (w *WADEntry) Name() string

func (*WADEntry) Open

func (w *WADEntry) Open() (io.Reader, error)

func (*WADEntry) Print

func (w *WADEntry) Print()

func (*WADEntry) Size

func (w *WADEntry) Size() int

type WADHeader

type WADHeader struct {
	Magic           [4]byte
	NumLumps        uint32 // NOTE: vanilla doom reads these as signed ints
	DirectoryOffset uint32
}

type WADIterator

type WADIterator struct {
	Reader *WADReader
	// contains filtered or unexported fields
}

func (*WADIterator) Next

func (w *WADIterator) Next() lumps.ArchiveEntry

type WADReader

type WADReader struct {
	Header          WADHeader
	BasePaletteData color.Palette
	LumpDirectory   []*LumpHeader
	// contains filtered or unexported fields
}

func NewIWAD

func NewIWAD(r io.ReadSeeker) (*WADReader, error)

func (*WADReader) GetEntry

func (i *WADReader) GetEntry(name string) (lumps.ArchiveEntry, error)

func (*WADReader) GetLump

func (i *WADReader) GetLump(name string) (*LumpHeader, int, error)

func (*WADReader) List

func (i *WADReader) List() lumps.ArchiveIterator

func (*WADReader) LumpData

func (i *WADReader) LumpData(l *LumpHeader) (io.Reader, error)

func (*WADReader) Type

func (i *WADReader) Type() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL