Page 1 of 1
packing a sprite from memory
Posted: Thu Apr 14, 2005 1:28 am
by Hroudtwolf
LADYS & GENTLEMAN
How to pack a sprite from memory in a packfile without temporarily storing as bitmapfile.
I need it for my mapeditor for include all used sprites in a mapfile.
Posted: Thu Apr 14, 2005 5:44 am
by blueznl
unpack memory then catch image?
Re: packing a sprite from memory
Posted: Thu Apr 14, 2005 9:09 pm
by Ralf
Hroudtwolf wrote:LADYS & GENTLEMAN
How to pack a sprite from memory in a packfile without temporarily storing as bitmapfile.
I need it for my mapeditor for include all used sprites in a mapfile.
hi!
if i understand you right, you want pack your sprites and include it into your exe!? then at runtime you want to unpack your sprites to memory and catch them?
its no problem...
you have to know the size of each unpacked sprite, then you have to allocate memory and have to copy the unpacked sprite into the new allocatedmemory ! so your sprite is unpacked in memory and you know its memory adress! now you can use CatchSprite() and put the adress of the unpacked sprite... that should be all
but hey, this way dont make any sence for me! if you want it, to save some memory, then you could add your sprites (packed or unpacked) as resource! because resources are not loaded into memory as included stuff!
Posted: Fri Apr 15, 2005 12:26 am
by Hroudtwolf
hi!
if i understand you right, you want pack your sprites and include it into your exe!? then at runtime you want to unpack your sprites to memory and catch them?
Not that isn't the problem.
I want to create some sprites while the runtime of my mapeditor and then , I want to save this sprites directly from spritememory into a packfile.