pl2Loader

package
v0.0.0-...-126e10b Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 11 Imported by: 0

README

PL2 Loader Service

The purpose of this Service Mesh service is to provide a single service that is responsible for loading PL2 palette transformation files.

The palette transformations are pre-computed indexes into the standard diablo2 palettes which are used as a pseudo gamma/alpha/hue shifts for the DC6, DCC, DT1, and DS1 graphics.

Dependencies

This service has a single dependency on the MPQ loader service

Integration with other services

This service exports an integration interface LoadsPl2Files with an alias Dependencncy which are intended to be used by other services for dependency resolution (see servicemesh.HasDependencies), and expose just the methods which other services should use.

type Dependency = LoadsPl2Files

type LoadsPl2Files = interface {
    Load(filepath string) (*pl2.PL2, error)
}

Other services should use the LoadsPl2Files or Dependency interfaces to resolve their dependency on this service.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency = LoadsPl2Files

type LoadsPl2Files

type LoadsPl2Files = interface {
	Load(filepath string) (*pl2.PL2, error)
	ExtractPaletteFromPl2(pathPL2 string) (color.Palette, error)
}

type Service

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

func (*Service) CacheBudget

func (s *Service) CacheBudget() int

CacheBudget implements cacheManager.HasCache

func (*Service) ConfigFileName

func (s *Service) ConfigFileName() string

func (*Service) DefaultConfig

func (s *Service) DefaultConfig() (cfg configFile.Config)

func (*Service) DependenciesResolved

func (s *Service) DependenciesResolved() bool

func (*Service) ExtractPaletteFromPl2

func (s *Service) ExtractPaletteFromPl2(pathPL2 string) (color.Palette, error)

func (*Service) FlushCache

func (s *Service) FlushCache(newCache *cache.Cache)

FlushCache implements cacheManager.HasCache

func (*Service) Init

func (s *Service) Init(mesh servicemesh.Mesh)

func (*Service) Load

func (s *Service) Load(filepath string) (*pl2.PL2, error)

func (*Service) LoadConfig

func (s *Service) LoadConfig(config *configFile.Config)

func (*Service) Logger

func (s *Service) Logger() *slog.Logger

func (*Service) Name

func (s *Service) Name() string

func (*Service) Ready

func (s *Service) Ready() bool

func (*Service) ResolveDependencies

func (s *Service) ResolveDependencies(services []servicemesh.Service)

func (*Service) SetLogger

func (s *Service) SetLogger(logger *slog.Logger)

Jump to

Keyboard shortcuts

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