GLBasic forum

Main forum => Bug Reports => Topic started by: ampos on 2011-Oct-29

Title: LOADSPRITEMEM bug
Post by: ampos on 2011-Oct-29
The function LOADSPRITEMEM does not like values as absolute numbers, gives an error at compile runtime


Works:
Code (glbasic) Select
ok=LOADSPRITEMEM("myfile.jpg",w,h,pix[])

Error:
Code (glbasic) Select
ok=LOADSPRITEMEM("myfile.jpg",2000,1000,pix[])
Title: Re: LOADSPRITEMEM bug
Post by: MrTAToad on 2011-Oct-29
Thats because the second and third parameters are passed size of the sprite (width and height), and of course, a value can't be stored in an fixed value...
Title: Re: LOADSPRITEMEM bug
Post by: Kitty Hello on 2011-Oct-29
it's BYREF - you must pass a referene here that will tell you the size of the loaded image.