Opened 14 years ago

Closed 14 years ago

Last modified 12 months ago

#8466 closed patch

KYRA: Restructured sequence player

Reported by: eriktorbjorn Owned by:
Priority: normal Component: Engine: Kyra
Keywords: Cc:
Game:

Description

This patch restructures the sequence player to be more
like the other script interpreters: Each opcode gets
its own function, and the opcodes are decoded using an
array of function pointers. This should make it easier
to add alternative opcode tables, e.g. the one from the
CD version.

Of course, I may have inadvertently caused some
regressions, but the intro still seems to be working as
well as before at least.

Ticket imported from: #1314023. Ticket imported from: patches/571.

Attachments (1)

kyra-seqplayer.diff (24.7 KB ) - added by eriktorbjorn 14 years ago.
Patch against an October 5 CVS snapshot

Download all attachments as: .zip

Change History (8)

by eriktorbjorn, 14 years ago

Attachment: kyra-seqplayer.diff added

Patch against an October 5 CVS snapshot

comment:1 by eriktorbjorn, 14 years ago

Owner: set to cyxx

comment:2 by cyxx, 14 years ago

Owner: cyxx removed

comment:3 by cyxx, 14 years ago

The idea of cleanup the code is good...

My initial idea was to merge the tables of floppy and CD
versions, and thus wouldn't require a "dynamic opcodes table
". But I am not sure if this will be possible at all.

Concerning the patch in itself, is there any reason why you
didn't introduce a new class with all the opcodes and
members ? This will cleanup the KyraEngine class too.

Anyway, feel free to commit it if you want, I don't care at
all :)

comment:4 by eriktorbjorn, 14 years ago

> My initial idea was to merge the tables of floppy and CD
> versions, and thus wouldn't require a "dynamic opcodes
> table".

I think that'd be nice, too, but I didn't know if all the
sequences were hard-coded or not. And I know even less about
what happens in Kyra 2. Either way, I think it's more
readable this way.

> Concerning the patch in itself, is there any reason why you
> didn't introduce a new class with all the opcodes and
> members ? This will cleanup the KyraEngine class too.

Lack of time, mostly. :-)

Anyway, I'll commit it now and we can clean it up even
further later, ok?

comment:5 by eriktorbjorn, 14 years ago

Status: newclosed

comment:6 by cyxx, 14 years ago

I haven't spend much time studying kyra2, but from what I
have so far, it doesn't seem to have these "hardcoded
sequences".

As of the "cleanup later" thing, no problem.

comment:7 by digitall, 12 months ago

Component: Engine: Kyra
Note: See TracTickets for help on using tickets.