Module dbpf.files.fsh
Source
Franks PC Shapes (Textures)
See Also
- Franks PC Shapes (SC4D Encyclopedia)
- FSH Format (SC4D Encyclopedia)
License
MIT License
Members
-
FshGroupenum FshGroup: uint;-
baseAndOverlayTexturesbaseAndOverlayTexturesBase and Overlay Textures
-
buildingTexturesbuildingTexturesBuilding Textures
-
bridgeTexturesbridgeTexturesBridge Textures
-
miscTexturesmiscTexturesMisc Textures
-
networkTexturesnetworkTexturesNetwork Textures
-
propAnimationSpritespropAnimationSpritesAnimation Sprites for Props
-
animationSpritesanimationSpritesAnimation Sprites
-
transitPieceMaskstransitPieceMasksTransit Piece Masks
-
terrainAndFoundationTexturesterrainAndFoundationTexturesTerrain & Foundation Textures
-
masksmasksMasks
-
effectTextureseffectTexturesEffect Textures
-
lotEditorArrowImageslotEditorArrowImagesLot Editor Arrow Images
-
userInterfaceImagesuserInterfaceImagesUser Interface Images
-
DirectoryIdenum DirectoryId: immutable(ubyte)[];-
buildingbuildingBuilding textures
-
genericgenericNetwork textures, Sim textures, Sim heads, Sim animations, Trees, props, Base textures, Misc. colors
-
_3dAnimation_3dAnimation3D Animation textures (e.g. the green rotating diamond in
loteditor.dat) -
dispatchdispatchDispatch marker textures
-
simThumbOrNetworkModelsimThumbOrNetworkModelSmall Sim texture, Network Transport Model textures (trains, etc.)
-
uiuiUI Editor textures
-
batbatBAT generator texture maps
-
Headerstruct Header;-
identifierstatic const immutable(ubyte)[] identifier;Always
SHPI. -
magicubyte[4] magic;Always
SHPI. -
sizeuint size; -
entryCountuint entryCount; -
directoryIduint directoryId;See Also
DirectoryId
-
EntryNameenum EntryName: immutable(ubyte)[];-
palettepaletteGlobal palette for 8-bit Indexed Bitmaps.
-
zerozeroBuildings, props, network intersections, and terrain textures.
-
railrailAlways used for a rail texture, whereas for street/road intersections it's always by instance.
-
tb2tb2First sprite animation entry in a directory.
-
tb3tb3Any sprite animation entries in a directory after TB2.
-
Directorystruct Directory;-
entryNamestr!4 entryName;Remarks
When searching for a global palette for 8-bit bitmaps, the directory entry name for the global palette will always '!pal'. Once the '!pal' directory entry has been found, the global palette can be extracted and used for any bitmaps that use 8-bit indexed color. If no global palette is found, FSH decoders should look for a local palette directly following the indexed bitmap. If no palette is found, then no palette will be created or associated with the bitmap.Most tools, like FSHTool, simply ignore missing palettes and save the bitmap with an empty palette with all indices set to black.
See Also
EntryName -
offsetuint offset;Offset of the entry in the FSH file, in bytes.
-
EntryHeaderstruct EntryHeader;See Also
FSH Entry Header (SC4D Encyclopedia)
-
recordIdubyte recordId;Record ID
Logically
ANDed by0x7ffor bitmap code or0x80to check if the entry is QFS compressed (unused by SC4). -
sizeint24 size;Size of an entry including this header.
Only used if the file contains an attachment or embedded mipmaps. It is zero otherwise.
Remarks
For single images this is usually:
width x height + 0x10h.For images with embedded mipmaps, this is the total size of the original image, plus all mipmaps, plus the header.
In either case, it may include additional data as a binary attachment with unknown format.
-
widthushort width; -
heightushort height; -
centerXushort centerX; -
centerYushort centerY; -
positionXushort positionX; -
positionYushort positionY;
-
Entryalias Entry = std.typecons.Tuple!(EntryHeader, "header", ubyte[], "data").Tuple;A tuple of an entry's header and its data.
datais either palette or bitmap data.Remarks
After an entry'sheaderis its bitmap, palette, or pixel color data.See Also
EntryHeader- Bitmap data (SC4D Encyclopedia)
- FSH Entry Header (SC4D Encyclopedia)
-
BitmapTypeenum BitmapType: ushort;FSH images can store their pixel data raw, or they can make use of Microsoft DXTC compressed formats.
See Also
Bitmap data (SC4D Encyclopedia)
-
indexedindexed8-bit indexed
Directly follows bitmap or uses global palette.
-
a8r8g8b8a8r8g8b832-bit A8R8G8B8
-
a0r8g8b8a0r8g8b824-bit A0R8G8B8
-
a1r5g5b5a1r5g5b516-bit A1R5G5B5
-
a0r5g6b5a0r5g6b516-bit A0R5G6B5
-
a4r4g4b4a4r4g4b416-bit A4R4G4B4
-
dxt3dxt3DXT3 4x4 packed, 4-bit alpha
4x4 grid compressed, half-byte per pixel
-
dxt1dxt1DXT1 4x4 packed, 1-bit alpha
4x4 grid compressed, half-byte per pixel
-
Paletteenum Palette: ushort;See Also
Palette codes (SC4D Encyclopedia)
-
Textenum Text: ushort;See Also
Text codes (SC4D Encyclopedia)
-
Fshalias Fsh = std.typecons.Tuple!(Header, "header", Directory[], "directories", Tuple!(EntryHeader, "header", ubyte[], "data")[], "entries").Tuple;A FSH document.
See Also
HeaderDirectoryEntry- Franks PC Shapes (SC4D Encyclopedia)
- FSH Format (SC4D Encyclopedia)
-
readFsh read(ubyte[]file); -
writeubyte[] write(Fshdocument);