d2ds1

package
v0.0.0-...-c7db75a Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package d2ds1 provides functionality for loading/processing DS1 files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DS1

type DS1 struct {
	Files                      []string            // FilePtr table of file string pointers
	Objects                    []Object            // Objects
	Tiles                      [][]TileRecord      // The tile data for the DS1
	SubstitutionGroups         []SubstitutionGroup // Substitution groups for the DS1
	Version                    int32               // The version of the DS1
	Width                      int32               // Width of map, in # of tiles
	Height                     int32               // Height of map, in # of tiles
	Act                        int32               // Act, from 1 to 5. This tells which act table to use for the Objects list
	SubstitutionType           int32               // SubstitutionType (layer type): 0 if no layer, else type 1 or type 2
	NumberOfWalls              int32               // WallNum number of wall & orientation layers used
	NumberOfFloors             int32               // number of floor layers used
	NumberOfShadowLayers       int32               // ShadowNum number of shadow layer used
	NumberOfSubstitutionLayers int32               // SubstitutionNum number of substitution layer used
	SubstitutionGroupsNum      int32               // SubstitutionGroupsNum number of substitution groups, datas between objects & NPC paths
}

DS1 represents the "stamp" data that is used to build up maps.

func LoadDS1

func LoadDS1(fileData []byte) (*DS1, error)

LoadDS1 loads the specified DS1 file

type FloorShadowRecord

type FloorShadowRecord struct {
	Prop1       byte
	Sequence    byte
	Unknown1    byte
	Style       byte
	Unknown2    byte
	Hidden      bool
	RandomIndex byte
	Animated    bool
	YAdjust     int
}

FloorShadowRecord represents a floor or shadow record in a DS1 file.

type Object

type Object struct {
	Type  int
	ID    int
	X     int
	Y     int
	Flags int
	Paths []d2path.Path
}

Object is a game world object

type SubstitutionGroup

type SubstitutionGroup struct {
	TileX         int32
	TileY         int32
	WidthInTiles  int32
	HeightInTiles int32
	Unknown       int32
}

SubstitutionGroup represents a substitution group in a DS1 file.

type SubstitutionRecord

type SubstitutionRecord struct {
	Unknown uint32
}

SubstitutionRecord represents a substitution record in a DS1 file.

type TileRecord

type TileRecord struct {
	Floors        []FloorShadowRecord  // Collection of floor records
	Walls         []WallRecord         // Collection of wall records
	Shadows       []FloorShadowRecord  // Collection of shadow records
	Substitutions []SubstitutionRecord // Collection of substitutions
}

TileRecord represents a tile record in a DS1 file.

type WallRecord

type WallRecord struct {
	Type        d2enum.TileType
	Zero        byte
	Prop1       byte
	Sequence    byte
	Unknown1    byte
	Style       byte
	Unknown2    byte
	Hidden      bool
	RandomIndex byte
	YAdjust     int
}

WallRecord represents a wall record.

Jump to

Keyboard shortcuts

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