[Scummvm-devel] Re: CVS: scummvm/scumm imuse_digi.cpp,1.84,1.85 imuse_digi.h,1.23,1.24 script_v8.cpp,2.207,2.208 sound.cpp,1.297,1.298 string.cpp,1.172,1.173

Max Horn max at quendi.de
Fri Dec 26 05:27:00 CET 2003


Am Freitag, 26.12.03 um 13:15 Uhr schrieb Pawel Kolodziejski:

> Update of /cvsroot/scummvm/scummvm/scumm
> In directory sc8-pr-cvs1:/tmp/cvs-serv7221/scumm
>
> Modified Files:
> 	imuse_digi.cpp imuse_digi.h script_v8.cpp sound.cpp string.cpp
> Log Message:
> passthrought v7+ sound voices by imuse digital
>
I don't object to the spirit of the change, but the way it was done 
seems quite evil to me. I really hope that this is just a temporary 
measure and proper code will be written soon.

In particular, this is quite revolting to me:

> Index: imuse_digi.cpp
>

[...]
>
> +void IMuseDigital::setVocVoice(byte *src, int32 size, int rate) {
> +	_voiceVocData = src;
> +	_voiceVocSize = size;
> +	_voiceVocRate = rate;
> +}
> +
> +void IMuseDigital::setBundleVoice(byte *src) {
> +	_voiceBundleData = src;
> +}
> +
Essentially, class member variables are abused here as optional 
parameters. Quite evil and also error prone. Why not make them what 
they truly are: additional, optional parameters to startSound. Then you 
can completely get rid of those added class member variables.


Regards,

Max





More information about the Scummvm-devel mailing list