I wanted to use two changeable values to make an array. But the stuff just refuse to work:
imgStuff = LoadImage("pic.png")
imageMemory = CreateMemblockFromImage(imgStuff)
imageWidth = GetMemblockInt(imageMemory,0)
imageHeight = GetMemblockInt(imageMemory,4)
/***************************************
Build pixel planes
***************************************/
imgArray as integer[imageWidth,imageHeight] //ERROR!!!
// BUT THIS WORKS : imgArray as integer[15,10]
for Xfun = 0 to imageWidth-1
for Yfun = 0 to imageHeight-1
imgArray[Xfun,Yfun] = CreateObjectPlane(0.2,0.2)
SetObjectCullMode( imgArray[Xfun,Yfun], 0 )
SetObjectLightMode( imgArray[Xfun,Yfun], 0 )
setobjectColor(imgArray[Xfun,Yfun], GetMemblockbyte(imageMemory,(Yfun*15*4) + 12 + (Xfun*4)), GetMemblockbyte(imageMemory,(Yfun*15*4) + 12 + (Xfun*4)+1), GetMemblockbyte(imageMemory,(Yfun*15*4) + 12 + (Xfun*4)+2), 255)
SetObjectPosition( imgArray[Xfun,Yfun], xfun*0.2, -yfun*0.2, 5.0 )
SetObjectRotation( imgArray[Xfun,Yfun], 0.0, 0.0, 0.0)
next Yfun
next Xfun
This gave me:
main.agc:94: error: Unexpected token "imagewidth", Array dimension must be an integer literal or a constant
I later tried using those fancy 'constants' for imageHeight and imageWidth, but that screwed up in new ways:
main.agc:94: error: Unexpected token "getmemblockint", Array dimension must be an integer literal or a constant
I got so desperate that I even tried looking in the manual. I'm pretty much stuck.