Jump to content
  • Advertisement

Archived

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

nobodynews

Blitting Bitmap Problem

This topic is 6339 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

I'm reading LaMothe's Tricks of the Windows Game Programming Gurus, but some of his samples won't play correctly. The program is supposed to display three identical creatures, except in size, walking around. What it shows on my computer is static in their place, walking around. If you have the book, the programs are: demo7_13, demo7_14, are the only ones that do it, and I don't know why. How can I expect to understand code when it doesn't even work right on my computer? Any help will be much appreciated. Edited by - nobodynews on January 27, 2001 7:28:44 PM

Share this post


Link to post
Share on other sites
Advertisement
Make sure you order a new cd for the book, the first one did have that problem... It''s all free.

The problem you''re having is that the code doesn''t work for bitmaps not divisable by four. The width (in BYTES!) of a scanline of the bitmap must be divisable by four. If that is not the case it''s padded with zero''s ''til it is... That''s why it looks like garbage on screen. To solve this you can create some "pad eating" code, or simply make all the sprite bitmaps 80x80 (easy!). You can also use DDSCAPS_SYSTEMMEMORY whilst filling out the DDSCAPS2 structure, instead of using DDSCAPS_VIDEOMEMORY (not recommended ''cause you all hardware acceleration by doing this). Hope this helps!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!