Page 1 of 1

Load sprite into an already existing sprite

Posted: Mon Aug 13, 2007 10:07 pm
by tinman
Hi,

I cannot see how this would be done with the current commands, but I'd be happy for someone to show me that I'm wrong.

I'd like to be able to do this:

Code: Select all

spr.l = CreateSprite(#PB_Any, w, h, flags)
; Or load sprite
; draw, etc
; Later...
LoadIntoSprite(spr, "foo.img", flags)
; draw, etc
And not have the overhead of PB freeing and then allocating memory for the sprite unless something had changed about it (width, height, flags, depth, etc). Perhaps even a flag to truncate the new sprite to fit into whatever size the old one was.