Author Topic: LOADSPRITEMEM bug  (Read 1371 times)

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
LOADSPRITEMEM bug
« 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[])
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

MrTAToad

  • Guest
Re: LOADSPRITEMEM bug
« Reply #1 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...
« Last Edit: 2011-Oct-29 by MrTAToad »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: LOADSPRITEMEM bug
« Reply #2 on: 2011-Oct-29 »
it's BYREF - you must pass a referene here that will tell you the size of the loaded image.