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

Method Seek

trinity/Tr2TextureAnimation.cpp:65–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65ptrdiff_t Tr2TextureAnimation::MemoryReadStream::Seek( ptrdiff_t distance, SeekOrigin method )
66{
67 auto size = ptrdiff_t( m_data.size() );
68 ptrdiff_t position;
69 switch( method )
70 {
71 case SO_CURRENT:
72 position = m_offset + distance;
73 break;
74 case SO_END:
75 position = size - distance;
76 break;
77 default:
78 position = distance;
79 }
80 if( position >= 0 && position <= size )
81 {
82 m_offset = position;
83 }
84 return m_offset;
85}
86
87ptrdiff_t Tr2TextureAnimation::MemoryReadStream::Write( const void* source, size_t count )
88{

Callers 1

FileReadFunction · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected