OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
14 extern const uint8_t
_grf_cont_v2_sig[8] = {
'G',
'R',
'F', 0x82, 0x0D, 0x0A, 0x1A, 0x0A};
22 size_t pos = file.
GetPos();
28 if (file.
ReadByte() != expected_sig_byte)
return 0;
35 file.
SeekTo(pos, SEEK_SET);
uint8_t ReadByte()
Read a byte from the file.
uint8_t container_version
Container format of the sprite file.
size_t content_begin
The begin of the content of the sprite file, i.e. after the container metadata.
size_t GetPos() const
Get position in the file.
RandomAccessFile with some extra information specific for sprite files.
uint16_t ReadWord()
Read a word (16 bits) from the file (in low endian format).
const uint8_t _grf_cont_v2_sig[8]
Signature of a container version 2 GRF.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
void SeekTo(size_t pos, int mode)
Seek in the current file.
SpriteFile(const std::string &filename, Subdirectory subdir, bool palette_remap)
Create the SpriteFile.
A file from which bytes, words and double words are read in (potentially) a random order.
static uint8_t GetGRFContainerVersion(SpriteFile &file)
Get the container version of the currently opened GRF file.