|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> 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."
You can kind-of do this in SDL, but only if you use arrays of arrays instead of
multi-dimensional arrays. So, instead of
#declare A = array[3][2];
use
#declare A = array[3];
#for (I, 0, 2)
#declare A[I] = array[2];
#end
which may or may not be more trouble depending on how you're populating the
arrays. However, it is indexed in exactly the same way - A[I][J] - and you can
indeed reference A[I] as an array[2].
Bill
Post a reply to this message
|
 |