Load sprite into an already existing sprite

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Load sprite into an already existing sprite

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)