Documentation ¶
Overview ¶
Package d2dt1 provides functionality for loading/processing DT1 files. https://d2mods.info/forum/viewtopic.php?t=65163
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeTileGfxData ¶
DecodeTileGfxData decodes tile graphics data for a slice of dt1 blocks
Types ¶
type Block ¶
type Block struct { X int16 Y int16 GridX byte GridY byte EncodedData []byte Length int32 FileOffset int32 // contains filtered or unexported fields }
Block represents a DT1 block
type BlockDataFormat ¶
type BlockDataFormat int16
BlockDataFormat represents the format of the block data
const ( // BlockFormatRLE specifies the block format is RLE encoded BlockFormatRLE BlockDataFormat = 0 // BlockFormatIsometric specifies the block format isometrically encoded BlockFormatIsometric BlockDataFormat = 1 )
type DT1 ¶
type DT1 struct { Tiles []Tile // contains filtered or unexported fields }
DT1 represents a DT1 file.
type MaterialFlags ¶
type MaterialFlags struct { Other bool Water bool WoodObject bool InsideStone bool OutsideStone bool Dirt bool Sand bool Wood bool Lava bool Snow bool }
MaterialFlags represents the material flags. Lots of unknowns for now...
func NewMaterialFlags ¶
func NewMaterialFlags(data uint16) MaterialFlags
NewMaterialFlags represents the material flags nolint:gomnd // Binary values
func (*MaterialFlags) Encode ¶
func (m *MaterialFlags) Encode() uint16
Encode encodes MaterialFlags back to uint16
type SubTileFlags ¶
type SubTileFlags struct { BlockWalk bool BlockLOS bool BlockJump bool BlockPlayerWalk bool Unknown1 bool BlockLight bool Unknown2 bool Unknown3 bool }
SubTileFlags represent the sub-tile flags for a DT1
func NewSubTileFlags ¶
func NewSubTileFlags(data byte) SubTileFlags
NewSubTileFlags returns a list of new subtile flags
func (*SubTileFlags) Combine ¶
func (s *SubTileFlags) Combine(f SubTileFlags)
Combine combines a second set of flags into the current one
func (*SubTileFlags) DebugString ¶
func (s *SubTileFlags) DebugString() string
DebugString returns the debug string
func (*SubTileFlags) Encode ¶
func (s *SubTileFlags) Encode() byte
Encode encodes SubTileFlags back to byte
type Tile ¶
type Tile struct { Direction int32 RoofHeight int16 MaterialFlags MaterialFlags Height int32 Width int32 Type int32 Style int32 Sequence int32 RarityFrameIndex int32 SubTileFlags [25]SubTileFlags Blocks []Block // contains filtered or unexported fields }
Tile is a representation of a map tile