1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-29 18:45:23 +00:00
OpenDiablo2/d2common/d2fileformats/d2dt1/tile.go
Ziemas 0b7a433ed2
Fix up subtile flag stuff (#288)
* Switch to a 2d array for looking up subtile flags

Also fix up the walkableArea generation

* Check correct tiletype for walls

And fix the subtile tooltip text.
2020-02-02 17:56:58 -05:00

31 lines
640 B
Go

package d2dt1
type Tile struct {
Direction int32
RoofHeight int16
MaterialFlags MaterialFlags
Height int32
Width int32
Type int32
Style int32
Sequence int32
RarityFrameIndex int32
SubTileFlags [25]SubTileFlags
blockHeaderPointer int32
blockHeaderSize int32
Blocks []Block
}
var subtileLookup = [5][5]int{
{20, 21, 22, 23, 24},
{15, 16, 17, 18, 19},
{10, 11, 12, 13, 14},
{5, 6, 7, 8, 9},
{0, 1, 2, 3, 4},
}
func (t *Tile) GetSubTileFlags(x, y int) *SubTileFlags {
return &t.SubTileFlags[subtileLookup[y][x]]
}