[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.121,1.122

Bertrand Augereau baugereau at ifrance.com
Thu Jun 5 05:31:07 CEST 2003


----- Original Message ----- 
From: "Max Horn" <max at quendi.de>
To: "Bertrand Augereau" <tramboi at users.sourceforge.net>
Cc: <scummvm-cvs-logs at lists.sourceforge.net>
Sent: Thursday, June 05, 2003 11:48 AM
Subject: Re: [Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.121,1.122


> [...]
>
> > + // Bertrand TODO : Put a std::sort with a inlined comparison
> > operator?
> > + // I suppose only STL containers are not allowed, not algorithms,
> > but I prefered leaving a good old qsort
> > + // (Which might be slower that the previous code but just fits on
> > one line)
>
> Currently, no Std C++ lib *AT ALL* is allowed. That covers containers,
> algorithms, iostreams, everything.

Too bad cause it *has* a stable sort ;)

> > + qsort (actors, numactors, sizeof (Actor*), sortByDrawOrder);
> > +
> This is problematic, and may cause regressions. qsort is not a stable
> sort (at least when, as usual, it is implemented via quick sort). Not
> sure if a function like "mergesort" is better suited.

You're right, mergesort is stable, but it is much less portable than qsort
(and the original code of course :) )

>
> Anyway, the usualy count of actor is 5-10. The old sort we had is not
> particular efficient, but usually perfectly sufficient (i.e. I doubt
> this change gave a measurable gain, but it may cause incorrect
> rendering order - I am pretty sure somebody once did a similar change,
> and I had to undo it to fix rendering issues this caused).

Ok, it was just for a readibility matter, in fact, not for performance
issues. I'm sorry for the inconvenience. I wasn't aware that the default
order of the actors was used to discriminate rendering order.

Bertrand

_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France





More information about the Scummvm-git-logs mailing list