Archived

This topic is now archived and is closed to further replies.

Sprite and blitting

This topic is 6281 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Trying to use Directx to code a demo I encountered this problem in 8bit mode, when i use the LPDIRECTDRAWSURFACE4::Blt(RECT,IDIRECTDRAWSURFACE4,RECT,?); function, with an offscreen surface type as source and a screen back buffer as destination The sprite i try to draw appear totally distorted Curious detail : with 60 as sprite width, the sprite is displayed normally, with n*60 (n=1,2,3,...,etc), the sprite is normal too, with any other number it''s distorted another curious detail : when creating the offscreen surface if i specified the flag VIDEOMEMORY, the sprite is always distorted, with SYSTEMMEMORY, the sprite is normal, but only with width = n*60 The problem is the same in 640x480, 800x600 and 1024x768 graphics modes,Have you an idea ? Thanks

Share this post


Link to post
Share on other sites
Blt() will try to stretch the image if the source and destination rectangles are not the same size. If the destination rectangle is an exact multiple of the size of the source rectangle, then the destination image will look ok because it has scaled smoothly. Any other size destination rectangles will result in an odd-looking scale as some pixels are doubled and other pixels are not. Blt() does not do any filtering on the scale.



Steve 'Sly' Williams
Tools Developer
Krome Studios

Share this post


Link to post
Share on other sites