[Scummvm-cvs-logs] CVS: scummvm/scumm/smush codec37.cpp,1.10,1.11

Marcus Comstedt marcus at mc.pp.se
Sun Mar 2 14:44:02 CET 2003


Max Horn <max at quendi.de> writes:

> Uh, that's pretty ugly and hard to maintain...

Considering how the _rest_ of the code looked, that didn't seem to be
a major concern in this file...  :-)


> I already see the typos
> sneaking in whenever we have to fix something here. Why not use clean
> simple nested look for the SCUMM_NEED_ALIGNMENT variants? Any
> reasonable compiler should automatically unroll them, shouldn't it? 
> I.e something lie
> 
> 
>    t = *src++;
> #if defined(SCUMM_NEED_ALIGNMENT)
>    for (int i = 0; i < 4; i++)
>      for (int j = 0; j < 4; j++)
>        (dst + pitch * i)[j] = t;
> #else
>   ...
> #endif

I think the whole file could use a cleanup.  There's the same code
cut'n'pasted four times all over the place.  Maybe a macro that's
instansiated four times to get the different variants instead?


  // Marcus






More information about the Scummvm-git-logs mailing list