[Scummvm-devel] kyra.dat
Johannes Schickel
lordhoto at scummvm.org
Sat Jul 25 16:57:46 CEST 2009
Max Horn wrote:
> My two cents: I wouldn't waste time trying to extend the file handling
> system in KYRA with a generic solution to this, since it's not a
> generic problem: One single file in Kyra is absolutely central and
> needs to be accessed again and again and again. That alone seems to
> warrant treating it differently...
>
> Here's what I'd do: Locate the right kyra.dat once at the start of the
> game. Then, open it, and keep it open. And then modify the place where
> it normally would be opened with a check "if (filename == "kyra.dat")
> return _kyraDatHandle;".
> A mild complication would crop up if your code expects to receive
> ownership of the stream object. Well, that could be resolved by
> returning a new SubReadStream wrapping the real stream.
>
> I recall that the kyra file code is rather advanced and complicated,
> but I would hope that it only opens the actual file in 1-2 central
> places, so only those would have to be changed with the above
> mentioned check...
>
> So far for the theory, now its your turn to tell us why the above
> won't work :)
>
Just FYI, I added a simple hack like that for the kyra.dat handling now
in branch-1-0-0. The truth is that not only kyra.dat is opened again and
again, some scripts in Kyra3 do a similar thing with sound files for a
continuous sound effect playback, they do play the same sound effect up
to 4 times, with only a short delay, so the sound effect will never end.
I don't know how that performs on the PS3, but it's easily to check.
Just startup Kyra3, go left, go down, go down again.
// Johannes
More information about the Scummvm-devel
mailing list