MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ReadByte

Method ReadByte

src/random_access_file.cpp:107–118  ·  view source on GitHub ↗

* Read a byte from the file. * @return Read byte. */

Source from the content-addressed store, hash-verified

105 * @return Read byte.
106 */
107uint8_t RandomAccessFile::ReadByte()
108{
109 if (this->buffer == this->buffer_end) {
110 this->buffer = this->buffer_start;
111 size_t size = fread(this->buffer, 1, RandomAccessFile::BUFFER_SIZE, *this->file_handle);
112 this->pos += size;
113 this->buffer_end = this->buffer_start + size;
114
115 if (size == 0) return 0;
116 }
117 return *this->buffer++;
118}
119
120/**
121 * Read a word (16 bits) from the file (in low endian format).

Callers 15

ReadWordMethod · 0.95
DecodeSpecialSpriteFunction · 0.45
LoadNewGRFFileFromFileFunction · 0.45
LoadGrfFileFunction · 0.45
LoadGrfFileIndexedFunction · 0.45
LoadNewGRFSoundFunction · 0.45
SkipSpriteDataFunction · 0.45
ReadGRFSpriteOffsetsFunction · 0.45
LoadNextSpriteFunction · 0.45
BmpRead1Function · 0.45
BmpRead4Function · 0.45
BmpRead4RleFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected