idx

package
v0.0.0-...-16767da Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

package idx parses the Idx/WarHammer.idx file. It groups the sprites in Anim/WarHammer.ani into playable animations.

Index

Constants

View Source
const (
	NumGroups = 512 // Experimentally determined
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Detail

type Detail struct {
	FirstSprite uint16 // Relative offset from the group's SpriteIdx
	LastSprite  uint16 // Relative offset from the group's SpriteIdx
	Unknown1    uint16 // Could also be LastSprite? Something else? AtRestSprite?
	Unknown2    uint16 // Number of resting sprites, if we're AtRestSprite?

	Padding [12]byte // Set to zero in the cases I've looked at so far.

}

type Group

type Group struct {
	Spec    Spec
	Records []Record
	Details []Detail // Records and details are correlated by index
}

type Idx

type Idx struct {
	Filename string
	Groups   []Group
}

func Load

func Load(filename string) (*Idx, error)

type Record

type Record struct {
	// A guess, but each group of 8 records with increasing compass points share
	// this value.
	ActionID uint16

	Compass byte // It's odd to only have one byte. Maybe Unknown1 belongs to this too?

	Unknown1  byte   // ??? Only see values 0x33 and 0x00 for librarian.
	Offset    uint32 // Where the Detail for this Record is to be found.
	NumFrames uint32 // A guess, but seems to fit. Number of frames for this action + compass.
}

type Spec

type Spec struct {
	Offset    uint32 // Where the Records for this Spec are to be found
	Count     uint32 // Number of Records for this Spec
	SpriteIdx uint32 // Index of the first sprite in
}

type Spec links a set of animations to a starting sprite in WarHammer.ani

Jump to

Keyboard shortcuts

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