goldsrc

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MaterialTypeCount = 9 + 1

Variables

This section is empty.

Functions

func IsValidTextureName

func IsValidTextureName(str string) bool

func NewTitlesFromModRoot

func NewTitlesFromModRoot(mod *os.Root) (map[string]Title, error)

func NewTitlesFromReader

func NewTitlesFromReader(r io.Reader) (map[string]Title, error)

Types

type MaterialType

type MaterialType rune
const (
	MaterialTypeInvalid MaterialType = 0

	MaterialTypeComputer MaterialType = 'P'
	MaterialTypeDirt     MaterialType = 'D'
	MaterialTypeGlass    MaterialType = 'Y'
	MaterialTypeGrate    MaterialType = 'G'
	MaterialTypeLiquid   MaterialType = 'S' // "slosh"
	MaterialTypeMetal    MaterialType = 'M'
	MaterialTypeTile     MaterialType = 'T'
	MaterialTypeVents    MaterialType = 'V'
	MaterialTypeWood     MaterialType = 'W'
)

func (MaterialType) String

func (t MaterialType) String() string

type Materials

type Materials map[string]MaterialType // texture name => material type

materials.txt parser.

func LoadMaterials

func LoadMaterials(r io.Reader) (Materials, error)

func LoadMaterialsFromFile

func LoadMaterialsFromFile(path string) (Materials, error)

func (Materials) IsEmpty

func (m Materials) IsEmpty() bool

type MaterialsRemapper

type MaterialsRemapper struct {
	// contains filtered or unexported fields
}

func NewMaterialsRemapper

func NewMaterialsRemapper(source Materials) MaterialsRemapper

func (*MaterialsRemapper) PrintAvailable

func (r *MaterialsRemapper) PrintAvailable(w io.Writer)

func (*MaterialsRemapper) ReMap

func (r *MaterialsRemapper) ReMap(
	stderr io.Writer,
	from []wad.MIPTexture,
	replacements Materials,
) (map[wad.TextureName]wad.TextureName, error)

type ParseError

type ParseError struct {
	// contains filtered or unexported fields
}

func (ParseError) Error

func (e ParseError) Error() string

type Title

type Title struct {
	Name    string
	Message string

	// I won't bother parsing position/colors for now. Don't need them.
	Position       string      // $position "0.0 0.0"
	Effect         TitleEffect // $effect 0/1/2
	TextColor      string      // $color "255 255 255"
	HighlightColor string      // $color2 "255 255 255"
	FadeIn         float32     // $fadein
	FadeOut        float32     // $fadeout
	FXTime         float32     // $fxtime
	HoldTime       float32     // $holdtime
}

A single entry from titles.txt.

type TitleEffect

type TitleEffect int
const (
	TitleEffectFade TitleEffect = iota
	TitleEffectFlicker
	TitleEffectTypewriter
)

Directories

Path Synopsis
Package bsp implements an incomplete GoldSrc BSP parser.
Package bsp implements an incomplete GoldSrc BSP parser.
Package nod implements NPC navigation node graph files parsing.
Package nod implements NPC navigation node graph files parsing.
Package typed_map parses Quake .map files in the Valve 220 format as struct containers.
Package typed_map parses Quake .map files in the Valve 220 format as struct containers.
valve
Package valve contains vanilla Half-Life entities definitions.
Package valve contains vanilla Half-Life entities definitions.
Package sprite implements GoldSrc SPR files parsing.
Package sprite implements GoldSrc SPR files parsing.
Package wad implements GoldSrc WAD (texture files) parsing.
Package wad implements GoldSrc WAD (texture files) parsing.

Jump to

Keyboard shortcuts

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