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

Max Horn max at quendi.de
Thu Jun 5 02:49:01 CEST 2003


[...]

> +	// 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.


> +	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.

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).


Bye,

Max





More information about the Scummvm-git-logs mailing list