OpenTTD Source  20241108-master-g80f628063a
sprite_file.cpp File Reference

Implementation of logic specific to the SpriteFile class. More...

#include "../stdafx.h"
#include "sprite_file_type.hpp"

Go to the source code of this file.

Functions

static uint8_t GetGRFContainerVersion (SpriteFile &file)
 Get the container version of the currently opened GRF file. More...
 

Variables

const uint8_t _grf_cont_v2_sig [8] = {'G', 'R', 'F', 0x82, 0x0D, 0x0A, 0x1A, 0x0A}
 Signature of a container version 2 GRF.
 

Detailed Description

Implementation of logic specific to the SpriteFile class.

Definition in file sprite_file.cpp.

Function Documentation

◆ GetGRFContainerVersion()

static uint8_t GetGRFContainerVersion ( SpriteFile file)
static

Get the container version of the currently opened GRF file.

Returns
Container version of the GRF file or 0 if the file is corrupt/no GRF file.

Definition at line 20 of file sprite_file.cpp.

References _grf_cont_v2_sig, RandomAccessFile::GetPos(), RandomAccessFile::ReadByte(), RandomAccessFile::ReadWord(), and RandomAccessFile::SeekTo().

Referenced by SpriteFile::SpriteFile().