CPCWiki forum

General Category => Programming => Topic started by: Typhon on 13:42, 06 May 25

Title: Drawing a portion of a CPCTelera sprite buffer
Post by: Typhon on 13:42, 06 May 25
Me again with another Question 

My new project uses a 9k screen software back buffer. Obviously this is not the horribly quickest sort of thing to draw (I'm using CPCTelera). I'm wondering if there is a way in said framework (I'm using the Development branch 1.5),of only drawing an arbitrary portion of said sprite buffer? (say a bit w by h bytes at x, y bytes with 0, 0 being the top left). I think getting the x/y bit isn't a problem, using the GetScreenPtr library function?, but it's limiting the draw to only w times h bytes that seems like there's no current way to do. 

I'm aware of Arnaud's Sprite Clipping extension but having tried that out, I don't think it's quite what I'm after. 
Title: Re: Drawing a portion of a CPCTelera sprite buffer
Post by: Arnaud on 19:53, 06 May 25
Hi @Typhon,
the GetScreenPtrfunction is only to have pointer to screen position, it doesn't works for a buffer.
For the buffer (or sprite) you can use the Macro cpctm_spriteBufferPtr.

I think the fonction cpct_drawSpriteClipped will do the job to copy partial back-buffer to screen.

Powered by SMFPacks Menu Editor Mod