#8466 closed patch
KYRA: Restructured sequence player
Reported by: | eriktorbjorn | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | Engine: Kyra |
Version: | 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)
Change History (8)
by , 19 years ago
Attachment: | kyra-seqplayer.diff added |
---|
comment:1 by , 19 years ago
Owner: | set to |
---|
comment:2 by , 19 years ago
Owner: | removed |
---|
comment:3 by , 19 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 , 19 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 , 19 years ago
Status: | new → closed |
---|
comment:6 by , 19 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 , 6 years ago
Component: | → Engine: Kyra |
---|
Patch against an October 5 CVS snapshot