Re: [Warzone-dev] Patch: removal of duplicate code

2007-02-21 Thread Gerard Krol

Per Inge Mathisen wrote:

On 2/17/07, Gerard Krol <[EMAIL PROTECTED]> wrote:

I went duplicate code hunting, and fixed these occurrences of
copy&paste. There are quite some more, but I leave those for another 
time.


I have been working on this, and committed parts of it, but it is a
real pain to check it for correctness.

Yeah, it is. Struggled with that myself too.

I see that the two functions
merged in src/display3d.c have differences, though, where one function
used buildingBrightness and another brightness, which are calculated
differently, while in the merged function, buildingBrightness only is
used.
Calculated differently? I just took another look at the code, and this 
does not seem to be the case. The value buildingBrightness is just 
abandoned at some point, and brightness is used.


It would be nice to know if such changes are intentional or not.
In principle the code should behave exactly as before. The only change I 
remember is that some value that has something to do with the muzzle 
flash that was different for the normal buildings and the defensive 
buildings. I supposed the value on the defensive buildings was updated 
at some time, and the value for the normal buildings was forgotten, so I 
made both normal and defensive buildings use the muzzle flash parameter 
from the defensive buildings.


- Gerard

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Patch: removal of duplicate code

2007-02-21 Thread Per Inge Mathisen

On 2/17/07, Gerard Krol <[EMAIL PROTECTED]> wrote:

I went duplicate code hunting, and fixed these occurrences of
copy&paste. There are quite some more, but I leave those for another time.


I have been working on this, and committed parts of it, but it is a
real pain to check it for correctness. I see that the two functions
merged in src/display3d.c have differences, though, where one function
used buildingBrightness and another brightness, which are calculated
differently, while in the merged function, buildingBrightness only is
used.

It would be nice to know if such changes are intentional or not.

 - Per

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev