Documentation ¶
Overview ¶
Package sgreader provides functions for reading SG files which are used by City Builder games (Zeus, Caesar 3, Pharaoh etc) to store art assets.
Usage:
file := sgreader.ReadFile("C3.sg2")
Index ¶
- Constants
- type SgBitmap
- func (sgBitmap *SgBitmap) AddImage(child *SgImage)
- func (sgBitmap *SgBitmap) BitmapName() string
- func (sgBitmap *SgBitmap) CloseFile() error
- func (sgBitmap *SgBitmap) GetImage(id int) (*image.RGBA, error)
- func (sgBitmap *SgBitmap) Image(id int) *SgImage
- func (sgBitmap *SgBitmap) ImageCount() int
- func (sgBitmap *SgBitmap) OpenFile(isExtern bool) (*os.File, error)
- func (sgBitmap *SgBitmap) String() string
- type SgBitmapRecord
- type SgFile
- func (sgFile *SgFile) Basename() string
- func (sgFile *SgFile) BitmapCount() int
- func (sgFile *SgFile) GetBitmap(bitmapId int) *SgBitmap
- func (sgFile *SgFile) GetBitmapDescription(bitmapId int) string
- func (sgFile *SgFile) ImageCount(bitmapId int) int
- func (sgFile *SgFile) Load() error
- func (sgFile *SgFile) MaxBitmapRecords() int
- func (sgFile *SgFile) TotalImageCount() int
- type SgHeader
- type SgImage
- func (sgImage *SgImage) BitmapId() int
- func (sgImage *SgImage) FullDescription() string
- func (sgImage *SgImage) GetImage() (*image.RGBA, error)
- func (sgImage *SgImage) InvertOffset() int32
- func (sgImage *SgImage) SetInvertImage(invert *SgImage)
- func (sgImage *SgImage) SetParent(parent *SgBitmap)
- func (sgImage *SgImage) String() string
- type SgImageRecord
- type SgImageRecordNonAlpha
Constants ¶
const ( ISOMETRIC_TILE_WIDTH = 58 ISOMETRIC_TILE_HEIGHT = 30 ISOMETRIC_TILE_BYTES = 1800 ISOMETRIC_LARGE_TILE_WIDTH = 78 ISOMETRIC_LARGE_TILE_HEIGHT = 40 ISOMETRIC_LARGE_TILE_BYTES = 3200 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SgBitmap ¶
type SgBitmap struct {
// contains filtered or unexported fields
}
SgBitmap stores references to a series of images
func (*SgBitmap) BitmapName ¶
The name of the bitmap without the extension ".bmp"
func (*SgBitmap) ImageCount ¶
The number of images this bitmap refers
type SgBitmapRecord ¶
type SgFile ¶
type SgFile struct {
// contains filtered or unexported fields
}
SgFile holds data for the bitmaps and images stored in the data file
func (*SgFile) BitmapCount ¶
Get the number of bitmaps stored in the file
func (*SgFile) GetBitmapDescription ¶
Get the name of the bitmap and the number of images
func (*SgFile) ImageCount ¶
Get the number of images stored within a specific bitmap
func (*SgFile) MaxBitmapRecords ¶
Get the maximum number of bitmap records for this sg file
func (*SgFile) TotalImageCount ¶
Get the number of images stored in the file
type SgImage ¶
type SgImage struct {
// contains filtered or unexported fields
}
SgImage stores the metadata of the image
func (*SgImage) FullDescription ¶
Returns the full information of this image
func (*SgImage) InvertOffset ¶
Retrieves the invert offset
func (*SgImage) SetInvertImage ¶
Set the work record of the inverted image