I will agree with everyone - certainly when I first saw that #while (1), my
first reaction was "WHAT.... THE .... ....."
I think that most of the #breaks are just poor coding practice meant to exit the
smaller loops early, not the outer while.
It's certainly interesting to learn more about this "short circuiting" and other
aspects of flow control code. To my knowledge, no one has ever posted any SDL
code that illustrates the detailed behaviour of POV-Ray's SDL condition
One thing that I did run across that is being used in this code, but isn't
natively supported by SDL is the referencing of a 1D "slice" of a 2D array.
"Although it is permissible to reference an entire array as a whole, you may not
reference just one dimension of a multi-dimensional array."
So I made a macro as a workaround for that, in case anyone has any need to do
such a thing. Basically, it just takes the array and whatever element of the
first dimension that you want to use and copies that into a smaller "2D" array,
which can then get passed as an argument to a macro.
#macro Reference2DSubarray (Array, Index)
#local Size = dimension_size (Array, 2);
#local Temp = array[Size];
#for (i, 0, Size-1)
//#debug concat ("i = ", str (i, 0, 0), "\n")
#local Temp[i] = Array[Index][i];
I'll see if I can do any debugging or high-level perusal of the code and make
any progress - otherwise it might be another lost cause since I have yet to
determine what it actually DOES.
Post a reply to this message