res

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package res loads and decodes Ragnarok client resources such as GRF, GND, GAT, RSW, RSM, sprites, palettes, tables, and message strings.

Index

Constants

View Source
const (
	GATTypeNone     uint32 = 1 << 0
	GATTypeWalkable uint32 = 1 << 1
	GATTypeWater    uint32 = 1 << 2
	GATTypeSnipable uint32 = 1 << 3
)
View Source
const (
	GR2TextureEncodingRaw  int32 = 1
	GR2TextureEncodingS3TC int32 = 2
	GR2TextureEncodingBink int32 = 3
)
View Source
const (
	SPRFramePalette = 0
	SPRFrameRGBA    = 1
)

Variables

View Source
var (
	ErrGRFUnsupportedEncryption = errors.New("grf entry uses unsupported encryption")
	ErrGRFUnsupportedVersion    = errors.New("unsupported grf version")
	ErrGRFNotFound              = errors.New("grf entry not found")
)
View Source
var GR2IdentityTransform = GR2Transform{
	Rotation:   [4]float32{0, 0, 0, 1},
	ScaleShear: [9]float32{1, 0, 0, 0, 1, 0, 0, 0, 1},
}

Functions

func ApplyEffectTransparency

func ApplyEffectTransparency(img image.Image) *image.NRGBA

func ApplyEffectTransparencyWithBlackKey

func ApplyEffectTransparencyWithBlackKey(img image.Image, blackKey bool) *image.NRGBA

func BookResourcePath added in v0.10.0

func BookResourcePath(itemID uint16) string

func CardIllustrationTextureCandidates added in v0.10.0

func CardIllustrationTextureCandidates(resource string) []string

func DecodeImageData

func DecodeImageData(data []byte) (image.Image, error)

func EffectTextureCandidates

func EffectTextureCandidates(name string) []string

func FormatGroundItemLabel

func FormatGroundItemLabel(name string, amount int) string

func GATCellType

func GATCellType(raw uint32) uint32

func GR2AnimationResourceCandidates

func GR2AnimationResourceCandidates(boneType uint32, action GR2Action) []string

func GR2BoneTypeFromName

func GR2BoneTypeFromName(name string) (uint32, bool)

func GR2ModelResourceCandidates

func GR2ModelResourceCandidates(resourceName string) []string

func GroundTextureCandidates

func GroundTextureCandidates(name string) []string

func HasPlayerJobToken

func HasPlayerJobToken(job int) bool

func InterfaceTextureCandidates

func InterfaceTextureCandidates(resource string) []string

func IsDualWeaponPlayerJob

func IsDualWeaponPlayerJob(job int) bool

func IsGR2ResourceName

func IsGR2ResourceName(name string) bool

func ItemCollectionTextureCandidates

func ItemCollectionTextureCandidates(resource string) []string

func ItemIconTextureCandidates

func ItemIconTextureCandidates(resource string) []string

func ItemSpriteResourceCandidates

func ItemSpriteResourceCandidates(resource string, extension string) []string

func LoadImage

func LoadImage(manager *Manager, candidates []string) (image.Image, string, error)

func LoadImageExact

func LoadImageExact(manager *Manager, candidates []string) (image.Image, string, error)

func MercenaryWeaponOverlayResourceCandidates

func MercenaryWeaponOverlayResourceCandidates(resourceName string, weaponValue int, secondLayer bool, extension string) []string

func NPCCutinTextureCandidates added in v0.9.0

func NPCCutinTextureCandidates(resource string) []string

func NonPCSpriteResourceCandidates

func NonPCSpriteResourceCandidates(job int, resourceName string, extension string) []string

func NormalizePlayerHead

func NormalizePlayerHead(head int, job int) int

func NormalizePlayerWeaponShield

func NormalizePlayerWeaponShield(weapon, shield int) (int, int)

func PlayerAccessoryResourceCandidates

func PlayerAccessoryResourceCandidates(job int, head int, sex byte, viewID int, resourceName string, extension string) []string

func PlayerAdminBodyResourceCandidates

func PlayerAdminBodyResourceCandidates(sex byte, extension string) []string

func PlayerBodyPaletteResourceCandidates

func PlayerBodyPaletteResourceCandidates(job int, sex byte, palette int, extension string) []string

func PlayerBodyResourceCandidates

func PlayerBodyResourceCandidates(job int, sex byte, extension string) []string

func PlayerBodyResourcePath

func PlayerBodyResourcePath(job int, sex byte, extension string) string

func PlayerCartResourceCandidates

func PlayerCartResourceCandidates(cartNum int, extension string) []string

func PlayerFalconResourceCandidates

func PlayerFalconResourceCandidates(job int, extension string) []string

func PlayerHeadPaletteResourceCandidates

func PlayerHeadPaletteResourceCandidates(job int, head int, sex byte, palette int, extension string) []string

func PlayerHeadResourceCandidates

func PlayerHeadResourceCandidates(job int, head int, sex byte, extension string) []string

func PlayerIMFResourceCandidates

func PlayerIMFResourceCandidates(job int, sex byte) []string

func PlayerJobToken

func PlayerJobToken(job int) string

func PlayerSexLabel

func PlayerSexLabel(sex byte) string

func PlayerSexToken

func PlayerSexToken(sex byte) string

func PlayerShieldOverlayResourceCandidates

func PlayerShieldOverlayResourceCandidates(job int, sex byte, shield int, extension string) []string

func PlayerShieldToken

func PlayerShieldToken(shield int) string

func PlayerWeaponIsBow

func PlayerWeaponIsBow(manager *Manager, weaponValue int) bool

func PlayerWeaponOverlayResourceCandidates

func PlayerWeaponOverlayResourceCandidates(job int, sex byte, weaponValue int, secondLayer bool, extension string) []string

func PlayerWeaponOverlayResourceCandidatesForItem

func PlayerWeaponOverlayResourceCandidatesForItem(job int, sex byte, weaponItemID int, weaponViewID int, secondLayer bool, extension string) []string

func PlayerWeaponOverlaySupportsSecondLayer

func PlayerWeaponOverlaySupportsSecondLayer(weaponType int) bool

func PlayerWeaponOverlayToken

func PlayerWeaponOverlayToken(weaponType int) string

func PlayerWeaponOverlayTypeForJob

func PlayerWeaponOverlayTypeForJob(job int, weaponType int, dualWeapon bool) int

func PlayerWeaponViewID

func PlayerWeaponViewID(manager *Manager, weaponValue int) int

func RSMModelCandidates

func RSMModelCandidates(name string) []string

func SkillIconTextureCandidates

func SkillIconTextureCandidates(resource string, skillID int) []string

func WaterTextureCandidates

func WaterTextureCandidates(waterType, frame int) []string

Types

type ACT

type ACT struct {
	VersionMajor int
	VersionMinor int
	Actions      []ACTAction
	Sounds       []string
}

func ParseACT

func ParseACT(data []byte) (*ACT, error)

func (*ACT) ActionFor

func (a *ACT) ActionFor(action, direction int) (ACTAction, bool)

type ACTAction

type ACTAction struct {
	Animations []ACTAnimation
	DelayMS    float32
}

type ACTAnimation

type ACTAnimation struct {
	Layers []ACTLayer
	Sound  int
	Pos    []ACTPosition
}

type ACTLayer

type ACTLayer struct {
	X       int32
	Y       int32
	Index   int32
	Mirror  bool
	ScaleX  float32
	ScaleY  float32
	Color   [4]float32
	Angle   int32
	SPRType int32
	Width   int32
	Height  int32
}

type ACTPosition

type ACTPosition struct {
	X    int32
	Y    int32
	Attr int32
}

type BookContent added in v0.10.0

type BookContent struct {
	Background color.RGBA
	Lines      []string
}

func ParseBookContent added in v0.10.0

func ParseBookContent(data []byte) BookContent

type CameraViewPoint

type CameraViewPoint struct {
	MinDistance      int
	DistanceScope    int
	InitialDistance  int
	MinLongitude     int
	MaxLongitude     int
	InitialLongitude int
	MaxLatitude      int
	MinLatitude      int
	InitialLatitude  int
}

func (CameraViewPoint) LocksLongitude

func (v CameraViewPoint) LocksLongitude() bool

type ClientInfo

type ClientInfo struct {
	ServiceType string
	Connections []Connection
}

func ParseClientInfo

func ParseClientInfo(data []byte) (ClientInfo, error)

func ParseClientInfoFile

func ParseClientInfoFile(path string) (ClientInfo, error)

type Connection

type Connection struct {
	Display         string
	Description     string
	Address         string
	Port            int
	Version         int
	LangType        int
	RegistrationWeb string
	AdminList       []uint32
}

type FogParameter

type FogParameter struct {
	Near   float64
	Far    float64
	Color  color.RGBA
	Factor float64
}

type GAT

type GAT struct {
	VersionMajor byte
	VersionMinor byte
	Width        int
	Height       int
	Cells        []GATCell
}

func ParseGAT

func ParseGAT(data []byte) (*GAT, error)

func (*GAT) Cell

func (g *GAT) Cell(x, y int) (GATCell, bool)

func (*GAT) InBounds

func (g *GAT) InBounds(x, y int) bool

func (*GAT) SetCellRawType

func (g *GAT) SetCellRawType(x, y int, rawType uint32) bool

func (*GAT) Walkable

func (g *GAT) Walkable(x, y int) bool

type GATCell

type GATCell struct {
	Heights [4]float32
	RawType uint32
	Type    uint32
}

type GND

type GND struct {
	VersionMajor byte
	VersionMinor byte
	Width        int
	Height       int
	Zoom         float32
	Water        GNDWater
	Textures     []string
	Lightmaps    []GNDLightmap
	Surfaces     []GNDSurface
	Cells        []GNDCell
}

func ParseGND

func ParseGND(data []byte) (*GND, error)

func (*GND) Cell

func (g *GND) Cell(x, y int) (GNDCell, bool)

func (*GND) InBounds

func (g *GND) InBounds(x, y int) bool

func (*GND) Lightmap

func (g *GND) Lightmap(index int) (GNDLightmap, bool)

func (*GND) Surface

func (g *GND) Surface(index int) (GNDSurface, bool)

type GNDCell

type GNDCell struct {
	Heights [4]float32
	Top     int
	Front   int
	Right   int
}

type GNDLightmap

type GNDLightmap struct {
	Alpha [8][8]uint8
	Color [8][8]color.RGBA
}

type GNDSurface

type GNDSurface struct {
	U          [4]float32
	V          [4]float32
	TextureID  int
	LightmapID int
	Color      color.RGBA
}

type GNDWater

type GNDWater struct {
	Present     bool
	Level       float32
	Type        int32
	WaveHeight  float32
	WaveSpeed   float32
	WavePitch   float32
	AnimSpeed   int32
	SplitWidth  int32
	SplitHeight int32
}

type GR2Action

type GR2Action int
const (
	GR2ActionStand GR2Action = iota
	GR2ActionMove
	GR2ActionAttack
	GR2ActionDead
	GR2ActionDamage
)

type GR2Animation

type GR2Animation struct {
	Name              string
	Duration          float32
	TimeStep          float32
	TrackGroupIndices []int
}

type GR2Bone

type GR2Bone struct {
	Name         string
	ParentIndex  int32
	Transform    GR2Transform
	InverseWorld [16]float32
}

type GR2Container

type GR2Container struct {
	Version       uint32
	Data          []byte
	SectorOffsets []int
	Sectors       []GR2SectorInfo
	TypeRef       GR2SectorRef
	RootRef       GR2SectorRef
}

func ParseGR2Container

func ParseGR2Container(data []byte) (*GR2Container, error)

func (*GR2Container) RefOffset

func (c *GR2Container) RefOffset(ref GR2SectorRef) (int, error)

type GR2Curve

type GR2Curve struct {
	Degree   int32
	Knots    []float32
	Controls []float32
}

type GR2File

type GR2File struct {
	Textures      []GR2Texture
	Materials     []GR2Material
	Skeletons     []GR2Skeleton
	VertexDatas   []GR2VertexData
	TriTopologies []GR2TriTopology
	Meshes        []GR2Mesh
	Models        []GR2Model
	TrackGroups   []GR2TrackGroup
	Animations    []GR2Animation
}

func ParseGR2

func ParseGR2(data []byte) (*GR2File, error)

func ParseGR2File

func ParseGR2File(container *GR2Container) (*GR2File, error)

type GR2Geometry

type GR2Geometry struct {
	Vertices  []GR2ModelVertex
	Indices   []uint32
	Batches   []GR2GeometryBatch
	BoneCount int
	Center    [3]float32
	Size      [3]float32
}

func BuildGR2Geometry

func BuildGR2Geometry(file *GR2File, modelIndex int) (*GR2Geometry, error)

type GR2GeometryBatch

type GR2GeometryBatch struct {
	TextureIndex int
	StartIndex   uint32
	IndexCount   uint32
}

type GR2Material

type GR2Material struct {
	Name         string
	TextureIndex *int
}

type GR2Mesh

type GR2Mesh struct {
	Name            string
	VertexDataIndex *int
	TopologyIndex   *int
	MaterialIndices []int
	BoneBindings    []string
}

type GR2Model

type GR2Model struct {
	Name             string
	SkeletonIndex    *int
	InitialPlacement GR2Transform
	MeshIndices      []int
}

type GR2ModelVertex

type GR2ModelVertex struct {
	Position    [3]float32
	Normal      [3]float32
	UV          [2]float32
	BoneIndices [4]byte
	BoneWeights [4]byte
}

type GR2SectorInfo

type GR2SectorInfo struct {
	CompressType  uint32
	DataOffset    uint32
	CompressedLen uint32
	DecompressLen uint32
	OodleStop0    uint32
	OodleStop1    uint32
	FixupOffset   uint32
	FixupCount    uint32
}

type GR2SectorRef

type GR2SectorRef struct {
	Sector   uint32
	Position uint32
}

type GR2Skeleton

type GR2Skeleton struct {
	Name  string
	Bones []GR2Bone
}

type GR2Texture

type GR2Texture struct {
	FromFileName  string
	Width         int32
	Height        int32
	Encoding      int32
	SubFormat     int32
	BytesPerPixel int32
	ComponentBits [4]int32
	Pixels        []byte
}

func (GR2Texture) HasAlpha

func (t GR2Texture) HasAlpha() bool

func (GR2Texture) Image

func (t GR2Texture) Image() (*image.RGBA, error)

func (GR2Texture) RGBA

func (t GR2Texture) RGBA() ([]byte, error)

type GR2TrackGroup

type GR2TrackGroup struct {
	Name             string
	TransformTracks  []GR2TransformTrack
	InitialPlacement GR2Transform
}

type GR2Transform

type GR2Transform struct {
	Flags      uint32
	Position   [3]float32
	Rotation   [4]float32
	ScaleShear [9]float32
}

type GR2TransformTrack

type GR2TransformTrack struct {
	Name        string
	Position    GR2Curve
	Orientation GR2Curve
	ScaleShear  GR2Curve
}

type GR2TriGroup

type GR2TriGroup struct {
	MaterialIndex int32
	TriFirst      int32
	TriCount      int32
}

type GR2TriTopology

type GR2TriTopology struct {
	Groups  []GR2TriGroup
	Indices []uint32
}

type GR2Vertex

type GR2Vertex struct {
	Position    [3]float32
	Normal      [3]float32
	UV          [2]float32
	BoneWeights [4]byte
	BoneIndices [4]byte
}

type GR2VertexData

type GR2VertexData struct {
	Vertices []GR2Vertex
}

type GRF

type GRF struct {
	// contains filtered or unexported fields
}

func OpenGRF

func OpenGRF(path string) (*GRF, error)

func (*GRF) Close

func (g *GRF) Close() error

func (*GRF) Count

func (g *GRF) Count() int

func (*GRF) Has

func (g *GRF) Has(name string) bool

func (*GRF) Names

func (g *GRF) Names() []string

func (*GRF) NamesWithSuffix

func (g *GRF) NamesWithSuffix(suffix string) []string

func (*GRF) Path

func (g *GRF) Path() string

func (*GRF) ReadFile

func (g *GRF) ReadFile(name string) ([]byte, error)

type GRFEntry

type GRFEntry struct {
	Name        string
	PackedSize  uint32
	AlignedSize uint32
	RealSize    uint32
	Type        byte
	Offset      uint64
}

type GRFPackStats

type GRFPackStats struct {
	Files int
	Bytes int64
}

func PackGRF

func PackGRF(outputPath, root string) (GRFPackStats, error)

type IMF

type IMF struct {
	Version  int32
	Checksum int32
	Layers   []IMFLayer
}

func ParseIMF

func ParseIMF(data []byte) (*IMF, error)

func (*IMF) LayerForPriority

func (i *IMF) LayerForPriority(priority, action, motion int) int

func (*IMF) Point

func (i *IMF) Point(layer, action, motion int) (int32, int32)

func (*IMF) Priority

func (i *IMF) Priority(layer, action, motion int) int32

type IMFAction

type IMFAction struct {
	Motions []IMFMotion
}

type IMFLayer

type IMFLayer struct {
	Actions []IMFAction
}

type IMFMotion

type IMFMotion struct {
	Priority int32
	X        int32
	Y        int32
}

type ItemMetadata

type ItemMetadata struct {
	UnidentifiedDisplayName string
	IdentifiedDisplayName   string
	UnidentifiedResource    string
	IdentifiedResource      string
	CardIllustration        string
	UnidentifiedDescription []string
	IdentifiedDescription   []string
	SlotCount               int
	ClassNum                int
	ClassNumSet             bool
	CardPrefixName          string
	CardPostfix             bool
}

type Manager

type Manager struct {
	Root       string
	ClientInfo ClientInfo
	FoundFiles []string
	Archives   []*GRF
	// contains filtered or unexported fields
}

func NewManager

func NewManager(root string) (*Manager, error)

func (*Manager) AccessoryResourceName

func (m *Manager) AccessoryResourceName(viewID int) (string, bool)

func (*Manager) CameraViewPoint

func (m *Manager) CameraViewPoint(mapName string) (CameraViewPoint, bool)

func (*Manager) Find

func (m *Manager) Find(name string) (string, bool)

func (*Manager) FindFirst

func (m *Manager) FindFirst(names []string) (string, bool)

func (*Manager) FogParameter

func (m *Manager) FogParameter(mapName string) (FogParameter, bool)

func (*Manager) HasBook added in v0.10.0

func (m *Manager) HasBook(itemID uint16) bool

func (*Manager) HasFileExact added in v0.10.0

func (m *Manager) HasFileExact(name string) bool

HasFileExact reports whether a resource exists at exactly name. Unlike ReadFile, it does not use the legacy suffix fallback for archive entries.

func (*Manager) IsIndoorMap

func (m *Manager) IsIndoorMap(mapName string) bool

func (*Manager) ItemCardIllustrationName added in v0.10.0

func (m *Manager) ItemCardIllustrationName(itemID int) (string, bool)

func (*Manager) ItemCardPostfix

func (m *Manager) ItemCardPostfix(itemID int) bool

func (*Manager) ItemCardPrefixName

func (m *Manager) ItemCardPrefixName(itemID int) (string, bool)

func (*Manager) ItemClassNum

func (m *Manager) ItemClassNum(itemID int) (int, bool)

func (*Manager) ItemDescription

func (m *Manager) ItemDescription(itemID int, identified bool) ([]string, bool)

func (*Manager) ItemDisplayName

func (m *Manager) ItemDisplayName(itemID int, identified bool) (string, bool)

func (*Manager) ItemResourceName

func (m *Manager) ItemResourceName(itemID int, identified bool) (string, bool)

func (*Manager) ItemSlotCount

func (m *Manager) ItemSlotCount(itemID int) (int, bool)

func (*Manager) LoadBook added in v0.10.0

func (m *Manager) LoadBook(itemID uint16) (BookContent, error)

func (*Manager) MsgString

func (m *Manager) MsgString(id int) (string, bool)

func (*Manager) NonPCResourceName

func (m *Manager) NonPCResourceName(job int) (string, bool)

func (*Manager) PetTalk

func (m *Manager) PetTalk(data uint32) (string, bool)

func (*Manager) PlayerWeaponViewID

func (m *Manager) PlayerWeaponViewID(weaponValue int) int

func (*Manager) ReadFile

func (m *Manager) ReadFile(name string) ([]byte, error)

func (*Manager) ReadFileExact

func (m *Manager) ReadFileExact(name string) ([]byte, error)

func (*Manager) ReadFirst

func (m *Manager) ReadFirst(names []string) (string, []byte, bool)

func (*Manager) SkillDescription

func (m *Manager) SkillDescription(skillID int) ([]string, bool)

func (*Manager) SkillDisplayName

func (m *Manager) SkillDisplayName(skillID int) (string, bool)

func (*Manager) SkillMaxLevel

func (m *Manager) SkillMaxLevel(skillID int) (int, bool)

func (*Manager) SkillResourceName

func (m *Manager) SkillResourceName(skillID int) (string, bool)

func (*Manager) SkillTreePositions added in v0.10.0

func (m *Manager) SkillTreePositions(job int) (map[int]int, bool)

SkillTreePositions returns the read-only client-defined grid position for each skill belonging to job. Positions are zero-based in seven columns.

func (*Manager) SongTalkLine

func (m *Manager) SongTalkLine(kind SongTalkKind) (string, bool)

type Palette

type Palette [256][4]byte

func ParsePAL

func ParsePAL(data []byte) (Palette, error)

type RSM

type RSM struct {
	Signature          string
	VersionMajor       byte
	VersionMinor       byte
	AnimLength         int32
	ShadeType          int32
	Alpha              float32
	FrameRatePerSecond float32
	Textures           []string
	MainNodeName       string
	Nodes              []RSMNode
	PositionKeyframes  []RSMPositionKeyframe
	VolumeBoxes        []RSMVolumeBox
}

func ParseRSM

func ParseRSM(data []byte) (*RSM, error)

type RSMFace

type RSMFace struct {
	VertexIndices        [3]uint16
	TextureVertexIndices [3]uint16
	TextureID            uint16
	TwoSide              int32
	SmoothGroup          int32
	SmoothGroupExtra     []int32
}

type RSMNode

type RSMNode struct {
	Name                  string
	ParentName            string
	TextureRefs           []RSMTextureRef
	Matrix                [9]float32
	Offset                RSMVector3
	Position              RSMVector3
	RotationAngle         float32
	RotationAxis          RSMVector3
	Scale                 RSMVector3
	Vertices              []RSMVector3
	TextureVertices       []RSMTextureVertex
	Faces                 []RSMFace
	ScaleKeyframes        []RSMScaleKeyframe
	RotationKeyframes     []RSMRotationKeyframe
	PositionKeyframes     []RSMPositionKeyframe
	TextureKeyframeGroups []RSMTextureKeyframeGroup
}

type RSMPositionKeyframe

type RSMPositionKeyframe struct {
	Frame int32
	Pos   RSMVector3
	Data  float32
	Int   int32
}

type RSMRotationKeyframe

type RSMRotationKeyframe struct {
	Frame      int32
	Quaternion [4]float32
}

type RSMScaleKeyframe

type RSMScaleKeyframe struct {
	Frame int32
	Scale RSMVector3
	Data  float32
}

type RSMTextureAnimation

type RSMTextureAnimation struct {
	Type   int32
	Frames []RSMTextureKeyframe
}

type RSMTextureKeyframe

type RSMTextureKeyframe struct {
	Frame  int32
	Offset float32
}

type RSMTextureKeyframeGroup

type RSMTextureKeyframeGroup struct {
	TextureID int32
	Animation []RSMTextureAnimation
}

type RSMTextureRef

type RSMTextureRef struct {
	Index int32
	Name  string
}

type RSMTextureVertex

type RSMTextureVertex struct {
	Color [4]float32
	U     float32
	V     float32
}

type RSMVector3

type RSMVector3 struct {
	X float32
	Y float32
	Z float32
}

type RSMVolumeBox

type RSMVolumeBox struct {
	Size     RSMVector3
	Position RSMVector3
	Rotation RSMVector3
	Flag     int32
}

type RSW

type RSW struct {
	VersionMajor byte
	VersionMinor byte
	BuildNumber  int32
	Files        RSWFiles
	Water        RSWWater
	Light        RSWLight
	Ground       RSWGround
	Models       []RSWModel
	Lights       []RSWObjectLight
	Sounds       []RSWSound
	Effects      []RSWEffect
}

func ParseRSW

func ParseRSW(data []byte) (*RSW, error)

type RSWEffect

type RSWEffect struct {
	Name     string
	Position RSWVector3
	ID       int32
	Delay    float32
	Param    [4]float32
}

type RSWFiles

type RSWFiles struct {
	INI string
	GND string
	GAT string
	SRC string
}

type RSWGround

type RSWGround struct {
	Top    int32
	Bottom int32
	Left   int32
	Right  int32
}

type RSWLight

type RSWLight struct {
	Longitude int32
	Latitude  int32
	Diffuse   [3]float32
	Ambient   [3]float32
	Opacity   float32
}

type RSWModel

type RSWModel struct {
	Name        string
	AnimType    int32
	AnimSpeed   float32
	BlockType   int32
	UnknownByte byte
	UnknownInt  int32
	Filename    string
	NodeName    string
	Position    RSWVector3
	Rotation    RSWVector3
	Scale       RSWVector3
}

type RSWObjectLight

type RSWObjectLight struct {
	Name     string
	Position RSWVector3
	Color    color.RGBA
	Range    float32
}

type RSWSound

type RSWSound struct {
	Name     string
	File     string
	Position RSWVector3
	Volume   float32
	Width    int32
	Height   int32
	Range    float32
	Cycle    float32
}

type RSWVector3

type RSWVector3 struct {
	X float32
	Y float32
	Z float32
}

type RSWWater

type RSWWater struct {
	Level      float32
	Type       int32
	WaveHeight float32
	WaveSpeed  float32
	WavePitch  float32
	AnimSpeed  int32
}

type SPR

type SPR struct {
	VersionMajor int
	VersionMinor int
	IndexedCount int
	RGBACount    int
	RGBAIndex    int
	Palette      Palette
	Frames       []SPRFrame
}

func ParseSPR

func ParseSPR(data []byte) (*SPR, error)

func (*SPR) FrameImage

func (s *SPR) FrameImage(index int, sprType int) (*image.NRGBA, bool)

func (*SPR) FrameImageWithPalette

func (s *SPR) FrameImageWithPalette(index int, sprType int, palette *Palette) (*image.NRGBA, bool)

type SPRFrame

type SPRFrame struct {
	Type   int
	Width  int
	Height int
	Data   []byte
}

type STR

type STR struct {
	FPS    int
	MaxKey int
	Layers []STRLayer
}

func ParseSTR

func ParseSTR(data []byte, texturePath string) (*STR, error)

type STRAnimation

type STRAnimation struct {
	Frame     int
	Type      uint32
	Pos       [2]float32
	UV        [8]float32
	XY        [8]float32
	AniFrame  float32
	AniType   uint32
	Delay     float32
	Angle     float32
	Color     [4]float32
	SrcAlpha  uint32
	DestAlpha uint32
	MTPreset  uint32
}

type STRLayer

type STRLayer struct {
	Textures   []string
	Animations []STRAnimation
}

type SongTalkKind

type SongTalkKind int
const (
	SongTalkScream SongTalkKind = iota
	SongTalkFrostJoke
)

Jump to

Keyboard shortcuts

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