MCPcopy Create free account
hub / github.com/carbonengine/trinity / Read

Method Read

trinity/Tr2TextureAnimation.cpp:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49ptrdiff_t Tr2TextureAnimation::MemoryReadStream::Read( void* buffer, ptrdiff_t count )
50{
51 if( count <= 0 )
52 {
53 return 0;
54 }
55 auto size = ptrdiff_t( m_data.size() );
56 if( m_offset + count > size )
57 {
58 count = size - m_offset;
59 }
60 memcpy( buffer, m_data.data() + m_offset, count );
61 m_offset += count;
62 return count;
63}
64
65ptrdiff_t Tr2TextureAnimation::MemoryReadStream::Seek( ptrdiff_t distance, SeekOrigin method )
66{

Callers 1

ReadFileMethod · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected