[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[42249] scummvm/branches/gsoc2009-draci/engines/draci

Denis Kasak denis.kasak at gmail.com
Wed Jul 8 08:10:20 CEST 2009


On Wed, Jul 8, 2009 at 07:23, Paul Gilbert<paulfgilbert at gmail.com> wrote:
> On Wed, Jul 8, 2009 at 2:42 PM, Robert Špalek <rspalek at gmail.com> wrote:
>>
>> On Tue, Jul 7, 2009 at 5:34 PM, <dkasak13 at users.sourceforge.net> wrote:
>>>
>>> +               // Account for GPL jump that some commands set
>>> +               reader.seek(reader.pos() + _jump);
>>
>> not sure how efficient
>> the stream reader is, i.e. whether it tests the new position for inequality or whether it always refills its buffers.  maybe it would be nicer to test if (_jump != 0) { ... }
>
> Additionally, if we're talking about a standard stream reader here (i.e.
> derived from SeekableReadStream), then the seek method has an optional
> second parameter that can be used to specify that the offset is relative,
> rather than absolute. So a cleaner implementation would be:
>
> if (_jump != 0)
>      reader.seek(_jump, SEEK_CUR);

Ah, indeed. Well spotted, I'll make the commit.

-- 
Denis Kasak




More information about the Scummvm-devel mailing list