Module dbpf.files.fsh
Source
Franks PC Shapes (Textures)
See Also
- Franks PC Shapes (SC4D Encyclopedia)
- FSH Format (SC4D Encyclopedia)
License
MIT License
Members
-
FshGroup
enum FshGroup: uint;
-
baseAndOverlayTextures
baseAndOverlayTextures
Base and Overlay Textures
-
buildingTextures
buildingTextures
Building Textures
-
bridgeTextures
bridgeTextures
Bridge Textures
-
miscTextures
miscTextures
Misc Textures
-
networkTextures
networkTextures
Network Textures
-
propAnimationSprites
propAnimationSprites
Animation Sprites for Props
-
animationSprites
animationSprites
Animation Sprites
-
transitPieceMasks
transitPieceMasks
Transit Piece Masks
-
terrainAndFoundationTextures
terrainAndFoundationTextures
Terrain & Foundation Textures
-
masks
masks
Masks
-
effectTextures
effectTextures
Effect Textures
-
lotEditorArrowImages
lotEditorArrowImages
Lot Editor Arrow Images
-
userInterfaceImages
userInterfaceImages
User Interface Images
-
DirectoryId
enum DirectoryId: immutable(ubyte)[];
-
building
building
Building textures
-
generic
generic
Network textures, Sim textures, Sim heads, Sim animations, Trees, props, Base textures, Misc. colors
-
_3dAnimation
_3dAnimation
3D Animation textures (e.g. the green rotating diamond in
loteditor.dat
) -
dispatch
dispatch
Dispatch marker textures
-
simThumbOrNetworkModel
simThumbOrNetworkModel
Small Sim texture, Network Transport Model textures (trains, etc.)
-
ui
ui
UI Editor textures
-
bat
bat
BAT generator texture maps
-
Header
struct Header;
-
identifier
static const immutable(ubyte)[] identifier;
Always
SHPI
. -
magic
ubyte[4] magic;
Always
SHPI
. -
size
uint size;
-
entryCount
uint entryCount;
-
directoryId
uint directoryId;
See Also
DirectoryId
-
EntryName
enum EntryName: immutable(ubyte)[];
-
palette
palette
Global palette for 8-bit Indexed Bitmaps.
-
zero
zero
Buildings, props, network intersections, and terrain textures.
-
rail
rail
Always used for a rail texture, whereas for street/road intersections it's always by instance.
-
tb2
tb2
First sprite animation entry in a directory.
-
tb3
tb3
Any sprite animation entries in a directory after TB2.
-
Directory
struct Directory;
-
entryName
str!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
-
offset
uint offset;
Offset of the entry in the FSH file, in bytes.
-
EntryHeader
struct EntryHeader;
See Also
FSH Entry Header (SC4D Encyclopedia)
-
recordId
ubyte recordId;
Record ID
Logically
AND
ed by0x7f
for bitmap code or0x80
to check if the entry is QFS compressed (unused by SC4). -
size
int24 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.
-
width
ushort width;
-
height
ushort height;
-
centerX
ushort centerX;
-
centerY
ushort centerY;
-
positionX
ushort positionX;
-
positionY
ushort positionY;
-
Entry
alias Entry = std.typecons.Tuple!(EntryHeader, "header", ubyte[], "data").Tuple;
A tuple of an entry's header and its data.
data
is either palette or bitmap data.Remarks
After an entry'sheader
is its bitmap, palette, or pixel color data.See Also
EntryHeader
- Bitmap data (SC4D Encyclopedia)
- FSH Entry Header (SC4D Encyclopedia)
-
BitmapType
enum 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)
-
indexed
indexed
8-bit indexed
Directly follows bitmap or uses global palette.
-
a8r8g8b8
a8r8g8b8
32-bit A8R8G8B8
-
a0r8g8b8
a0r8g8b8
24-bit A0R8G8B8
-
a1r5g5b5
a1r5g5b5
16-bit A1R5G5B5
-
a0r5g6b5
a0r5g6b5
16-bit A0R5G6B5
-
a4r4g4b4
a4r4g4b4
16-bit A4R4G4B4
-
dxt3
dxt3
DXT3 4x4 packed, 4-bit alpha
4x4 grid compressed, half-byte per pixel
-
dxt1
dxt1
DXT1 4x4 packed, 1-bit alpha
4x4 grid compressed, half-byte per pixel
-
Palette
enum Palette: ushort;
See Also
Palette codes (SC4D Encyclopedia)
-
Text
enum Text: ushort;
See Also
Text codes (SC4D Encyclopedia)
-
Fsh
alias Fsh = std.typecons.Tuple!(Header, "header", Directory[], "directories", Tuple!(EntryHeader, "header", ubyte[], "data")[], "entries").Tuple;
A FSH document.
See Also
Header
Directory
Entry
- Franks PC Shapes (SC4D Encyclopedia)
- FSH Format (SC4D Encyclopedia)
-
read
Fsh read(ubyte[]
file
); -
write
ubyte[] write(Fsh
document
);