lumps

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Impassible    = 0
	BlockMonsters = 1
	TwoSided      = 2
	UpperUnpegged = 3
	LowerUnpegged = 4
	Secret        = 5
	BlockSound    = 6
	NotOnMap      = 7
	AlreadyOnMap
)

Variables

This section is empty.

Functions

func FixName

func FixName(in string) string

func NewPatchNames

func NewPatchNames(f *os.File, info *LumpInfo) ([]string, error)

func Seek

func Seek(f *os.File, offset int64) error

func ToString

func ToString(s [8]byte) string

Types

type BBox

type BBox struct {
	Top    int16
	Bottom int16
	Left   int16
	Right  int16
}

func (*BBox) Intersect

func (b *BBox) Intersect(x int16, y int16) bool

func (*BBox) IntersectInside

func (b *BBox) IntersectInside(x int16, y int16) bool

type BlockMap

type BlockMap struct {
}

type Flat

type Flat struct {
	Data []byte
}

func NewFlat

func NewFlat(f *os.File, lumpInfo *LumpInfo) (*Flat, error)
type Header struct {
	Magic        [4]byte
	NumLumps     int32
	InfoTableOfs int32
}

type Image

type Image struct {
	Width  int
	Height int
	Pixels []byte
}

func NewImage

func NewImage(f *os.File, lumpInfo *LumpInfo, transparentPaletteIndex byte) (*Image, error)

type LineDef

type LineDef struct {
	VertexStart  int16
	VertexEnd    int16
	Flags        int16
	Function     int16
	Tag          int16
	SideDefRight int16
	SideDefLeft  int16
}

func NewLineDefs

func NewLineDefs(f *os.File, lumpInfo *LumpInfo) ([]*LineDef, error)

func (*LineDef) HasFlag

func (l *LineDef) HasFlag(flag int) bool

func (*LineDef) PrintBits

func (l *LineDef) PrintBits() string

type LumpInfo

type LumpInfo struct {
	Filepos int64
	Size    int32
	Name    string
}

func NewLumpInfo

func NewLumpInfo(pos int64, size int32, name string) *LumpInfo

func NewLumpInfos

func NewLumpInfos(f *os.File) ([]*LumpInfo, error)

type Node

type Node struct {
	X     int16
	Y     int16
	DX    int16
	DY    int16
	BBox  [2]BBox
	Child [2]uint16
}

func NewNodes

func NewNodes(f *os.File, lumpInfo *LumpInfo) ([]*Node, error)

func (*Node) Intersect

func (n *Node) Intersect(x int16, y int16) (uint16, bool)

func (*Node) IntersectInside

func (n *Node) IntersectInside(x int16, y int16) (uint16, bool)

func (*Node) IntersectSegment

func (n *Node) IntersectSegment(x1 int16, y1 int16, x2 int16, y2 int16) (uint16, bool)

func (*Node) PointOnSide

func (n *Node) PointOnSide(x int16, y int16) int

func (*Node) Print

func (n *Node) Print()

type Palette

type Palette struct {
	Table [256]RGB
}

type Patch

type Patch struct {
	XOffset     int16
	YOffset     int16
	PNameNumber int16
	StepDir     int16
	ColorMap    int16
}

type PictureHeader

type PictureHeader struct {
	Width      int16
	Height     int16
	LeftOffset int16
	TopOffset  int16
}

type PlayPal

type PlayPal struct {
	Palettes [14]Palette
}

func NewPlayPal

func NewPlayPal(f *os.File, lumpInfo *LumpInfo) (*PlayPal, error)

type RGB

type RGB struct {
	Red   uint8
	Green uint8
	Blue  uint8
}

type Reject

type Reject struct {
}

type Sector

type Sector struct {
	FloorHeight   int16
	CeilingHeight int16
	FloorPic      string
	CeilingPic    string
	LightLevel    int16
	SpecialSector int16
	Tag           int16
}

func NewSectors

func NewSectors(f *os.File, lumpInfo *LumpInfo) ([]*Sector, error)

type Seg

type Seg struct {
	VertexStart int16
	VertexEnd   int16
	BAM         int16 //Binary Angle Measurement
	LineDef     int16
	Direction   int16
	Offset      int16
}

func NewSegments

func NewSegments(f *os.File, lumpInfo *LumpInfo) ([]*Seg, error)

type SideDef

type SideDef struct {
	XOffset       int16
	YOffset       int16
	UpperTexture  string
	LowerTexture  string
	MiddleTexture string
	SectorRef     uint16
}

func NewSideDefs

func NewSideDefs(f *os.File, lumpInfo *LumpInfo) ([]*SideDef, error)

func (*SideDef) PrintTexture

func (s *SideDef) PrintTexture() string

type SubSector

type SubSector struct {
	NumSegments int16
	StartSeg    int16
}

func NewSubSectors

func NewSubSectors(f *os.File, lumpInfo *LumpInfo) ([]*SubSector, error)

type Texture

type Texture struct {
	Header  *TextureHeader
	Patches []*Patch
}

func NewTextures

func NewTextures(f *os.File, lumpInfo *LumpInfo) ([]*Texture, error)

type TextureHeader

type TextureHeader struct {
	TexName         string
	Masked          int32
	Width           int16
	Height          int16
	ColumnDirectory int32
	NumPatches      int16
}

type Thing

type Thing struct {
	X       int16
	Y       int16
	Angle   int16
	Type    int16
	Options int16
}

func NewThings

func NewThings(f *os.File, lumpInfo *LumpInfo) ([]*Thing, error)

type Vertex

type Vertex struct {
	XCoord int16
	YCoord int16
}

func NewVertexes

func NewVertexes(f *os.File, lumpInfo *LumpInfo) ([]*Vertex, error)

Jump to

Keyboard shortcuts

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