iam messing around with image memblocks but theres something strange happening.
if i do:
laag = 1
for y = 1 to height
for x = 1 to width
inc a : b = memblock byte(laag,first+a)
inc a : g = memblock byte(laag,first+a)
inc a : r = memblock byte(laag,first+a)
inc a : alpha = memblock byte(laag,first+a)
if r = 34 and g = 177 and b = 76 // groen = grass, nr 63
inc objnr : make object box objnr,1,1,1
position object objnr,x,y,laag
set object filter objnr,0,0
texture object objnr,2
endif
next x
next y
then everything goes fine, but if i do:
for laag = 1 to 2
for y = 1 to height
for x = 1 to width
inc a : b = memblock byte(laag,first+a)
inc a : g = memblock byte(laag,first+a)
inc a : r = memblock byte(laag,first+a)
inc a : alpha = memblock byte(laag,first+a)
if r = 34 and g = 177 and b = 76 // groen = grass, nr 63
inc objnr : make object box objnr,1,1,1
position object objnr,x,y,laag
set object filter objnr,0,0
texture object objnr,2
endif
next x
next y
next laag
then i getting a error: runtime error 5105 - memblock position outside range at line 46
so whats wrong with the for loop??
*happy coding on his 3D Construx Editor*