Hi Robert,
yes, I agree that is quite a lot of code and also that each block seems to 
repeat over and over, but even though I could have somehow refactored the code 
I still think that the method would not be as readable as the original and 
would not be considerable shorter because of the many checks that should be 
added. Also, considering the time I could spend on this, I tried to keep the 
changes with respect to the original code as minimal as possible.

Moreover, I thought that when one would decide to add complete support for 
layered textures then each block would, presumably, differ a lot with respect 
to the others and also with the code that currently looks similar (the simple 
"file texture" case), so one would have to 'roll back' to the proposed initial 
implementation and then start adding things afterwards.

These were the reasons for me to opt for the cumbersome repeating blocks, even 
the comments were intentionally duplicated because they still make sense when 
the layered texture contains exactly 1 texture.

For sure the proposed solution is not the optimal implementation, I saw it more 
like a 'workaround' and as a starting point for someone that could be willing 
to keep adding support for layered textures... anyway there's no hurry to merge 
this until eventually a more complete support will be added from scratch.

If I manage to find more time I will also consider to refactor the code myself 
and come back with a new solution, just cannot plan it now :)

Cheers,
Alessandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72838#72838





_______________________________________________
osg-submissions mailing list
osg-submissions@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to