コード例 #1
0
ファイル: TTFFontManager.cpp プロジェクト: OldSnapo/gemrb
unsigned long TTFFontManager::read(FT_Stream		  stream,
								   unsigned long   offset,
								   unsigned char*  buffer,
								   unsigned long   count )
{
	DataStream* dstream = (DataStream*)stream->descriptor.pointer;
	dstream->Seek(offset, GEM_STREAM_START);
	return dstream->Read(buffer, count);
}
コード例 #2
0
	static   int  ghl_ogg_seek_func  (void *datasource, ogg_int64_t offset, int whence) 
	{
		DataStream* ds = reinterpret_cast<DataStream*>(datasource);
		if (!ds) return 0;
		FileSeekType fst;
		if (whence==SEEK_SET) fst=F_SEEK_BEGIN;
		else if (whence==SEEK_CUR) fst=F_SEEK_CURRENT;
		else if (whence==SEEK_END) fst=F_SEEK_END;
		else return 0;
		return ds->Seek(static_cast<Int32>(offset),fst);
	}