Jump to content
  • Advertisement

Archived

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

dlanicek

Help! Blitting problem with DirectDraw

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

Indeed it is a palette problem. See, the palette of one picture should be the same as the palette of another picture. If you, for example, load image a into memory, and use THAT palette. All the colors are indexed.
So, 40 might be the color green. But from another picture you load (image b) you have the color blue at place 40. If you use both of these bitmaps, and the palette of one picture. You will see the other picture with the palette of the former picture.

Hope that explains it.

------------------
Dance with me......

Share this post


Link to post
Share on other sites
Advertisement
So how do I check the palettes of both pictures? Or more importantly, how do I make sure the two images are using the exact same palette? I'm using Paint Shop Pro to create the images.

Share this post


Link to post
Share on other sites
You can use PSP to export a palette, and then load it into another bitmap. (I don't remember which menu it's on, but it shouldn't be hard to find the right command). Doing this is probably going to screw up your colors though. You'll have to mess around with them a bit to get them fixed.

Share this post


Link to post
Share on other sites
I'm creating a game with 8 bit color. I can get the background image to show up fine but when I try to blit an image onto the background, it looks all wrong. There are "random" colors where the image should be. If you look hard, you can kinda see the image thru the random colors. What am I missing? Is this a palette issue?

If it helps, I'm following examples from LaMothe's Tricks of the Windows Game Programming Gurus. The exact same problem shows up when I try to run his Prog7_13 on the CD-ROM.

Thanks for the help,
Dan

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
okay, here's how to do it well:

1. Create a big enough file in PSP to hold all your imagery - players, backgrounds, etc, with 24 bit colour.

2. Load all your game images one at a tim., Select all (ctrl a) then copy (ctrl c) the selection into the Big canvas (use Ctrl-E).

3. Reduce the big canvas to 8 bit colour (colour, reduce colour depth).

4. Save the palette. (colours, save palette)

5. Load the palette (colours, load palette) into all your seperate images.

Beware that you still only get 256 colours, so plan your imagery wisely.

--- wise guy ---

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!