|
|
Hi all
I've been tinkering, and noticed that dynamic arrays are possible in SDL. I
wasn't previously aware of this, although naturally, others may have been.
Consider the following:
#macro ExpandArray(Array, N)
#local Size = dimension_size(Array, 1);
#local NewSize = Size + N;
#local NewArray = array[NewSize];
#for (I, 0, Size-1)
#ifdef (Array[I])
#local NewArray[I] = Array[I];
#end
#end
#declare Array = NewArray;
#end
Now this is all fine and good, and terribly useful. But I was wondering: is this
a perfectly cromulent thing to do, or am I abusing the SDL in some way?
Bill
Post a reply to this message
|
|