Documentation ¶
Index ¶
- Variables
- func BitExtract(num uint32, start int, end int) int
- func WriteBRLYT(data []byte) ([]byte, error)
- type BRLYTWriter
- func (b *BRLYTWriter) WriteBND(pan XMLPane) error
- func (b *BRLYTWriter) WriteChildren(children []Children) error
- func (b *BRLYTWriter) WriteFNL(data Root) error
- func (b *BRLYTWriter) WriteGRE() error
- func (b *BRLYTWriter) WriteGRP(data XMLGRP) error
- func (b *BRLYTWriter) WriteGRS() error
- func (b *BRLYTWriter) WriteGroupChildren(children []Children) error
- func (b *BRLYTWriter) WriteLYT(data Root) error
- func (b *BRLYTWriter) WriteMAT(data Root) error
- func (b *BRLYTWriter) WritePAE() error
- func (b *BRLYTWriter) WritePAS() error
- func (b *BRLYTWriter) WritePIC(pic XMLPIC) error
- func (b *BRLYTWriter) WritePane(pan XMLPane) error
- func (b *BRLYTWriter) WriteTXL(data Root) error
- func (b *BRLYTWriter) WriteTXT(txt XMLTXT) error
- func (b *BRLYTWriter) WriteWND(data XMLWND) error
- type ChanControlXML
- type Children
- type Color16
- type Color8
- type Coord2D
- type Coord3D
- type FNL
- type FNLNames
- type FNLTable
- type GRP
- type Header
- type LYT
- type LYTNode
- type MAT
- type MATAlphaCompareXML
- type MATBlendMode
- type MATChanControl
- type MATColor
- type MATCoordGen
- type MATEntries
- type MATIndirectOrderEntryXML
- type MATIndirectTextureOrderEntry
- type MATMaterials
- type MATNode
- type MATOffset
- type MATSRT
- type MATTevStageEntry
- type MATTevStageEntryXML
- type MATTexCoordGenEntry
- type MATTexture
- type MATTextureEntry
- type MATTextureSRTEntry
- type MatAlphaCompare
- type PIC
- type Pane
- type Root
- func (r *Root) HasChildren() bool
- func (r *Root) ParseBND(data []byte) (*XMLPane, error)
- func (r *Root) ParseChildren() ([]Children, error)
- func (r *Root) ParseFNL(data []byte, sectionSize uint32) error
- func (r *Root) ParseGRP(data []byte) (*XMLGRP, error)
- func (r *Root) ParseLYT(data []byte) error
- func (r *Root) ParseMAT(data []byte, sectionSize uint32) error
- func (r *Root) ParsePAN(data []byte) (*XMLPane, error)
- func (r *Root) ParsePIC(data []byte) (*XMLPIC, error)
- func (r *Root) ParseTXL(data []byte, sectionSize uint32) error
- func (r *Root) ParseTXT(data []byte, sectionSize uint32) (*XMLTXT, error)
- func (r *Root) ParseWND(data []byte) (*XMLWND, error)
- type STCoordinates
- type SectionHeader
- type SectionTypes
- type TPLNames
- type TPLOffSet
- type TXL
- type TXT
- type TevSwapModeTable
- type TevSwapModeTableXML
- type UVSet
- type Window
- type WindowMat
- type XMLGRP
- type XMLPIC
- type XMLPane
- type XMLTXT
- type XMLUVSet
- type XMLUVSets
- type XMLWND
- type XMLWindowMat
- type XMLWindowMats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidFileMagic = errors.New("file is not a BRLYT") ErrFileSizeMismatch = errors.New("file size is mismatched") ErrInvalidTXLHeader = errors.New("txl1 header magic is invalid") ErrMisMatchedTXT1StringSize = func(stringSize int, correctSize uint16) error { return fmt.Errorf("string Size (%d) does not match the size found (%d)", stringSize, correctSize) } )
Functions ¶
func WriteBRLYT ¶
Types ¶
type BRLYTWriter ¶
func (*BRLYTWriter) WriteBND ¶
func (b *BRLYTWriter) WriteBND(pan XMLPane) error
func (*BRLYTWriter) WriteChildren ¶
func (b *BRLYTWriter) WriteChildren(children []Children) error
func (*BRLYTWriter) WriteFNL ¶
func (b *BRLYTWriter) WriteFNL(data Root) error
func (*BRLYTWriter) WriteGRE ¶
func (b *BRLYTWriter) WriteGRE() error
func (*BRLYTWriter) WriteGRP ¶
func (b *BRLYTWriter) WriteGRP(data XMLGRP) error
func (*BRLYTWriter) WriteGRS ¶
func (b *BRLYTWriter) WriteGRS() error
func (*BRLYTWriter) WriteGroupChildren ¶
func (b *BRLYTWriter) WriteGroupChildren(children []Children) error
func (*BRLYTWriter) WriteLYT ¶
func (b *BRLYTWriter) WriteLYT(data Root) error
func (*BRLYTWriter) WriteMAT ¶
func (b *BRLYTWriter) WriteMAT(data Root) error
func (*BRLYTWriter) WritePAE ¶
func (b *BRLYTWriter) WritePAE() error
func (*BRLYTWriter) WritePAS ¶
func (b *BRLYTWriter) WritePAS() error
func (*BRLYTWriter) WritePIC ¶
func (b *BRLYTWriter) WritePIC(pic XMLPIC) error
func (*BRLYTWriter) WritePane ¶
func (b *BRLYTWriter) WritePane(pan XMLPane) error
func (*BRLYTWriter) WriteTXL ¶
func (b *BRLYTWriter) WriteTXL(data Root) error
func (*BRLYTWriter) WriteTXT ¶
func (b *BRLYTWriter) WriteTXT(txt XMLTXT) error
func (*BRLYTWriter) WriteWND ¶
func (b *BRLYTWriter) WriteWND(data XMLWND) error
type ChanControlXML ¶
type FNL ¶
type FNL struct { NumOfFonts uint16 // contains filtered or unexported fields }
FNL represents the header of the fnl1 section
type FNLTable ¶
type FNLTable struct { // OffSet is relative to the beginning of the fnl1 section Offset uint32 // contains filtered or unexported fields }
type Header ¶
type Header struct { Magic [4]byte BOM uint32 FileSize uint32 HeaderLen uint16 SectionCount uint16 }
Header represents the header of our BRLYT
type LYTNode ¶
type LYTNode struct { XMLName xml.Name `xml:"lyt1"` Centered uint16 `xml:"is_centered"` Width float32 `xml:"width"` Height float32 `xml:"height"` }
LYTNode specifies the values that LYT contains
type MATAlphaCompareXML ¶
type MATBlendMode ¶
type MATChanControl ¶
type MATCoordGen ¶
type MATEntries ¶
type MATEntries struct { Name string `xml:"name,attr"` ForeColor Color16 `xml:"foreColor"` BackColor Color16 `xml:"backColor"` ColorReg3 Color16 `xml:"colorReg3"` TevColor1 Color8 `xml:"tevColor1"` TevColor2 Color8 `xml:"tevColor2"` TevColor3 Color8 `xml:"tevColor3"` TevColor4 Color8 `xml:"tevColor4"` BitFlag uint32 `xml:"bitFlag"` Textures []MATTexture `xml:"texture"` SRT []MATSRT `xml:"textureSRT"` CoordGen []MATCoordGen `xml:"coordGen"` ChanControl *ChanControlXML `xml:"chanControl"` MatColor *Color8 `xml:"matColor"` TevSwapMode *TevSwapModeTableXML `xml:"tevSwapMode"` IndirectSRT []MATSRT `xml:"indirectSRT"` IndirectTextureOrder []MATIndirectOrderEntryXML `xml:"indirectTextureOrder"` TevStageEntry []MATTevStageEntryXML `xml:"tevStageEntry"` AlphaCompare *MATAlphaCompareXML `xml:"alphaCompare"` BlendMode *MATBlendMode `xml:"blendMode"` }
type MATMaterials ¶
type MATNode ¶
type MATNode struct {
Entries []MATEntries `xml:"entries"`
}
type MATTevStageEntry ¶
type MATTevStageEntryXML ¶
type MATTevStageEntryXML struct { TexCoor uint8 `xml:"texCoor"` Color uint8 `xml:"color"` TexMap uint16 `xml:"texMap"` RasSel uint8 `xml:"rasSel"` TexSel uint8 `xml:"texSel"` ColorA uint8 `xml:"colorA"` ColorB uint8 `xml:"colorB"` ColorC uint8 `xml:"colorC"` ColorD uint8 `xml:"colorD"` ColorOP uint8 `xml:"colorOP"` ColorBias uint8 `xml:"colorBias"` ColorScale uint8 `xml:"colorScale"` ColorClamp uint8 `xml:"colorClamp"` ColorRegID uint8 `xml:"colorRegID"` ColorConstantSel uint8 `xml:"colorConstantSel"` AlphaA uint8 `xml:"alphaA"` AlphaB uint8 `xml:"alphaB"` AlphaC uint8 `xml:"alphaC"` AlphaD uint8 `xml:"alphaD"` AlphaOP uint8 `xml:"alphaOP"` AlphaBias uint8 `xml:"alphaBias"` AlphaScale uint8 `xml:"alphaScale"` AlphaClamp uint8 `xml:"alphaClamp"` AlphaRegID uint8 `xml:"alphaRegID"` AlphaConstantSel uint8 `xml:"alphaConstantSel"` TexID uint8 `xml:"texID"` Bias uint8 `xml:"bias"` Matrix uint8 `xml:"matrix"` WrapS uint8 `xml:"wrapS"` WrapT uint8 `xml:"wrapT"` Format uint8 `xml:"format"` AddPrevious uint8 `xml:"addPrevious"` UTCLod uint8 `xml:"utcLod"` Alpha uint8 `xml:"alpha"` }
type MATTexCoordGenEntry ¶
type MATTexture ¶
type MATTextureEntry ¶
type MATTextureSRTEntry ¶
type MatAlphaCompare ¶
type PIC ¶
type PIC struct { Flag uint8 Origin uint8 Alpha uint8 PaneName [16]byte UserData [8]byte XTranslation float32 YTranslation float32 ZTranslation float32 XRotate float32 YRotate float32 ZRotate float32 XScale float32 YScale float32 Width float32 Height float32 TopLeftColor [4]uint8 TopRightColor [4]uint8 BottomLeftColor [4]uint8 BottomRightColor [4]uint8 MatIndex uint16 NumOfUVSets uint8 // contains filtered or unexported fields }
PIC defines the image pane in a brlyt
type Pane ¶
type Pane struct { Flag uint8 Origin uint8 Alpha uint8 PaneName [16]byte UserData [8]byte XTranslation float32 YTranslation float32 ZTranslation float32 XRotate float32 YRotate float32 ZRotate float32 XScale float32 YScale float32 Width float32 Height float32 // contains filtered or unexported fields }
Pane represents the structure of a pan1 section.
type Root ¶
type Root struct { XMLName xml.Name `xml:"root"` LYT LYTNode `xml:"lyt1"` TXL *TPLNames `xml:"txl1"` FNL *FNLNames `xml:"fnt1"` MAT MATNode `xml:"mat1"` RootPane XMLPane `xml:"pan1"` RootGroup XMLGRP `xml:"grp1"` // contains filtered or unexported fields }
func ParseBRLYT ¶
func (*Root) HasChildren ¶
func (*Root) ParseChildren ¶
type STCoordinates ¶
type SectionHeader ¶
type SectionHeader struct { Type SectionTypes Size uint32 }
type SectionTypes ¶
type SectionTypes [4]byte
SectionTypes are known parts of a BRLYT.
var ( SectionTypeLYT SectionTypes = [4]byte{'l', 'y', 't', '1'} SectionTypeTXL SectionTypes = [4]byte{'t', 'x', 'l', '1'} SectionTypeFNL SectionTypes = [4]byte{'f', 'n', 'l', '1'} SectionTypeMAT SectionTypes = [4]byte{'m', 'a', 't', '1'} SectionTypePAN SectionTypes = [4]byte{'p', 'a', 'n', '1'} SectionTypePAS SectionTypes = [4]byte{'p', 'a', 's', '1'} SectionTypePAE SectionTypes = [4]byte{'p', 'a', 'e', '1'} SectionTypeBND SectionTypes = [4]byte{'b', 'n', 'd', '1'} SectionTypePIC SectionTypes = [4]byte{'p', 'i', 'c', '1'} SectionTypeTXT SectionTypes = [4]byte{'t', 'x', 't', '1'} SectionTypeWND SectionTypes = [4]byte{'w', 'n', 'd', '1'} SectionTypeGRP SectionTypes = [4]byte{'g', 'r', 'p', '1'} SectionTypeGRS SectionTypes = [4]byte{'g', 'r', 's', '1'} SectionTypeGRE SectionTypes = [4]byte{'g', 'r', 'e', '1'} )
type TPLNames ¶
type TPLNames struct {
TPLName []string `xml:"tpl_name"`
}
TPLNames represents the structure of the txl1 section.
type TXT ¶
type TXT struct { Flag uint8 Origin uint8 Alpha uint8 PaneName [16]byte UserData [8]byte XTranslation float32 YTranslation float32 ZTranslation float32 XRotate float32 YRotate float32 ZRotate float32 XScale float32 YScale float32 Width float32 Height float32 StringLength uint16 MaxStringLength uint16 MatIndex uint16 FontIndex uint16 StringOrigin uint8 LineAlignment uint8 TextOffset uint32 TopColor [4]uint8 BottomColor [4]uint8 FontSizeX float32 FontSizeY float32 CharacterSize float32 LineSize float32 // contains filtered or unexported fields }
TXT represents the text data of the txt1 section
type TevSwapModeTableXML ¶
type Window ¶
type Window struct { Flag uint8 Origin uint8 Alpha uint8 PaneName [16]byte UserData [8]byte XTranslation float32 YTranslation float32 ZTranslation float32 XRotate float32 YRotate float32 ZRotate float32 XScale float32 YScale float32 Width float32 Height float32 Coordinate1 float32 Coordinate2 float32 Coordinate3 float32 Coordinate4 float32 FrameCount uint8 WindowOffset uint32 WindowFrameOffset uint32 TopLeftColor [4]uint8 TopRightColor [4]uint8 BottomLeftColor [4]uint8 BottomRightColor [4]uint8 MatIndex uint16 NumOfUVSets uint8 // contains filtered or unexported fields }
type XMLPIC ¶
type XMLPIC struct { Name string `xml:"name,attr"` UserData string `xml:"user_data,attr"` Visible uint8 `xml:"visible"` Widescreen uint8 `xml:"widescreen_affected"` Flag uint8 `xml:"flag"` Origin Coord2D `xml:"origin"` Alpha uint8 `xml:"alpha"` Padding uint8 `xml:"padding"` Translate Coord3D `xml:"translate"` Rotate Coord3D `xml:"rotate"` Scale Coord2D `xml:"scale"` Width float32 `xml:"width"` Height float32 `xml:"height"` TopLeftColor Color8 `xml:"topLeftColor"` TopRightColor Color8 `xml:"topRightColor"` BottomLeftColor Color8 `xml:"bottomLeftColor"` BottomRightColor Color8 `xml:"bottomRightColor"` MatIndex uint16 `xml:"matIndex"` UVSets *XMLUVSets `xml:"uv_sets"` Children []Children `xml:"children"` }
type XMLPane ¶
type XMLPane struct { Name string `xml:"name,attr"` UserData string `xml:"user_data,attr"` Flag uint8 `xml:"flag"` Origin Coord2D `xml:"origin"` Alpha uint8 `xml:"alpha"` Padding uint8 `xml:"padding"` Translate Coord3D `xml:"translate"` Rotate Coord3D `xml:"rotate"` Scale Coord2D `xml:"scale"` Width float32 `xml:"width"` Height float32 `xml:"height"` Children []Children `xml:"children"` }
type XMLTXT ¶
type XMLTXT struct { Name string `xml:"name,attr"` UserData string `xml:"user_data,attr"` Visible uint8 `xml:"visible"` Widescreen uint8 `xml:"widescreen_affected"` Flag uint8 `xml:"flag"` Origin Coord2D `xml:"origin"` Alpha uint8 `xml:"alpha"` Padding uint8 `xml:"padding"` Translate Coord3D `xml:"translate"` Rotate Coord3D `xml:"rotate"` Scale Coord2D `xml:"scale"` Width float32 `xml:"width"` Height float32 `xml:"height"` StringLength uint16 `xml:"string_length"` MaxStringLength uint16 `xml:"max_string_length"` MatIndex uint16 `xml:"matIndex"` StringOrigin uint8 `xml:"string_origin"` LineAlignment uint8 `xml:"line_alignment"` XSize float32 `xml:"x_size"` YSize float32 `xml:"y_size"` CharSize float32 `xml:"charsize"` LineSize float32 `xml:"linesize"` TopColor Color8 `xml:"top_color"` BottomColor Color8 `xml:"bottom_color"` Text string `xml:"text"` Children []Children `xml:"children"` }
type XMLUVSet ¶
type XMLUVSet struct { CoordTL STCoordinates `xml:"coordTL"` CoordTR STCoordinates `xml:"coordTR"` CoordBL STCoordinates `xml:"coordBL"` CoordBR STCoordinates `xml:"coordBR"` }
type XMLWND ¶
type XMLWND struct { Name string `xml:"name,attr"` UserData string `xml:"user_data,attr"` Visible uint8 `xml:"visible"` Widescreen uint8 `xml:"widescreen_affected"` Flag uint8 `xml:"flag"` Origin Coord2D `xml:"origin"` Alpha uint8 `xml:"alpha"` Padding uint8 `xml:"padding"` Translate Coord3D `xml:"translate"` Rotate Coord3D `xml:"rotate"` Scale Coord2D `xml:"scale"` Width float32 `xml:"width"` Height float32 `xml:"height"` Coordinate1 float32 `xml:"coordinate_1"` Coordinate2 float32 `xml:"coordinate_2"` Coordinate3 float32 `xml:"coordinate_3"` Coordinate4 float32 `xml:"coordinate_4"` TopLeftColor Color8 `xml:"topLeftColor"` TopRightColor Color8 `xml:"topRightColor"` BottomLeftColor Color8 `xml:"bottomLeftColor"` BottomRightColor Color8 `xml:"bottomRightColor"` MatIndex uint16 `xml:"matIndex"` UVSets *XMLUVSets `xml:"uv_sets"` Materials *XMLWindowMats `xml:"materials"` Children []Children `xml:"children"` }
type XMLWindowMat ¶
type XMLWindowMats ¶
type XMLWindowMats struct {
Mats []XMLWindowMat `xml:"mats"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.