[Scummvm-devel] ScummEx - Status & Anyone 'porting' this to MSVC?

Phil Lello philip.lello at btinternet.com
Thu Apr 28 12:10:19 CEST 2005


Adrien Mercier wrote: 
> 
> Phil Lello a écrit :
> > Hi All,
> >  
> > I've just downloaded ScummEx from CVS, and I've found 
> several issues 
> > with variable initialisation, breaking the image display 
> and palette 
> > (if not more).
> >  
> > The problem is that the code relies on the compiler 
> initialising class 
> > pointers to NULL, whilst the M$ approach is to set pointers to 
> > 0xCDCDCDCD, which breaks ScummEx in several places.
> >  
> > I'll start changing my version to initialise pointers in the 
> > constructors; is anyone else already working on this for 
> CVS check-in?
> >  
> > On a more general note, is ScummEx being worked on much to 
> keep it in 
> > sync with new engines added to ScummVM, or to share code?
> >  
> > Regards,
> >  
> > Phil
> >  
> 
> Hi,
> Yes I know that ScummEX code is really broken, and I started 
> working on an improved version a few days ago. I will commit 
> my changes later this week. There will be several changes :
> - it will be possible to open several files at the same time (in tabs)
> - blocks will be loaded only when you expand their parent on the tree
> - will support wxWidgets 2.6.0
> - much cleaner code ;)
> What I would like to do is put the description of the Scumm 
> blocks in an XML file and load it at run time. That way it 
> would be much easier to add blocks, and we could even 
> generate documentation.. Of course the problem is that for 
> some blocks we need to do some checks : if (size == 18) {
> 	...
> } else if (size > 32) {
> 	...
> }
> Any ideas on how to handle that are welcome :)
> 
> I can only test ScummEX with gcc on Linux and OS X so any 
> fixes for MSVC compatibility will be appreciated. As for 
> supporting other engines, well if you're talking about newer 
> Scumm versions it's possible, but for other games I would 
> like it to work well with Scumm first :p
> 
> Bye,
> 
> -- 
> Adrien Mercier
> 

The good news is that things aren't as broken as I first though :-)

The problems with bad class pointers seem to all be based on the 
lookups against the_blockTable array in scummex.h, so the solution 
was to add the following line to the ScummEx constructor :

	memset(_blockTable, 0, sizeof(_blockTable));

I've only had a quick play around with the data files from 
Monkey Island 1/2 (Windows/CD), looking at the graphics, and most
of this works fine. The exception to this is drawing boxes, where 
the 1st block is always invalid on MI1, and code gets stuck with MI2
rooms. The latter may be a problem with wxWindows.

I'll re-test with MSVC once the changes are checked in....

I can test against Windows/CD versions of Monkey Island 1/2/3, and
Simon the Sorceror 2 (if expected to work).

I only came accross ScummVM / ScummEX (and wxWindows/SDL) a couple
of days ago, so I doubt I'll contribute much other than MSVC fixes
and Windows testing for the time being.

Phil





More information about the Scummvm-devel mailing list