View Single Post
Old 05 November 2019, 22:36   #6
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,343
You can do it very easily by drawing directly to shapes (ShapesBitMap, MakeCookie), then transferring the image data to the sprite using GetaSprite. This copies the image data, so it's not entirely efficient, but if it's a relatively small amount of information the time taken should be minimal.

I haven't tried it, but to actually draw directly to the sprite image data, you could use CludgeBitmap, which sets up a bitmap object but doesn't allocate any memory for it. Instead, you give it a pointer to already-allocated memory, such as manually decoded image data, or the bitmap of a sprite.

Code:
myBitMap.l = Peek.l(ADDR Sprite 0)
CludgeBitmap 0, 16, 16, 2, myBitMap
should give you the image data pointer, then create bitmap object ID 0 (16x16, 4 colour) at that location, allowing you to draw to it at will. Bear in mind that that will update in realtime on the screen, so you might want to synchronise your drawing with VWait.
Daedalus is offline  
 
Page generated in 0.05075 seconds with 11 queries