[Scummvm-devel] New way of handling GUIO
tarek-spam at zeusmail.bounceme.net
Mon Oct 24 07:06:55 CEST 2011
On Sun, Oct 23, 2011 at 05:56:46PM +0100, Eugene Sandulenko wrote:
> I just pushed new code for GUIO. It used to be a bitfield, but now is
> sequence of bytes. This gives me up to 255 options instead of 31.
This (as documented) breaks the detection of the monkey island talkie fanpatch.
I have 3 ideas for fixing this and none of them are good:
This leaks memory as clone2727 pointed out.
I cannot free the memory blindly because it is usually pointing at the static detection table.
I am from a java background and so am cursed with not having to deal with these problems and being totally ignorant of how they're addressed.
This sets a null pointer on gui options and works only because of the current detection table entries not containing anything critical.
It works fine because the guioptions are being used only after being wrapped into a Common::String which is well guarded against null pointers: it treats it as an empty string.
This works _now_ but won't work if the detection entries change which is going to happen.
This adds detection entries for the fanpatch to the detection table.
This is the least hacky and was rejected last time in favor of the speech detection.
I just need some ideas on how to get over the speech detection problem of guioptions being a string.
Thanks for your patience and understanding. I am a guy who wants to learn.
More information about the Scummvm-devel