Jump to content

Converting 8bit ddraw surface to 32-bit


MrParrot

Recommended Posts

I am currently implementing Bilinear filtering (and I will probably implement bicubic later) to cnc-ddraw's GDI render. First thing I must do is convert the 256 colors scheme used by C&C to 32-bits scheme. Currently, I tried to set the bmiHeader.biBitCount to 32 and use the line to convert a ddraw-surface to opengl texture:

((int*)upscaled)[i*dst_width+j] = ddraw->primary->palette->data_bgr[((unsigned char *)ddraw->primary->surface)[i*ddraw->primary->lPitch + j*ddraw->primary->lXPitch]];

But all that I get is a chunky blued output image.

 

Well, I was not going to post this message before revising things, but I pressed a bunch of keys by mistake on my keyboard and this topic was posted. Perhaps someone can give me some useful info.

Edited by MrParrot
incomplete post
Link to comment
Share on other sites

  • 6 years later...

Converting an 8-bit DirectDraw surface to a 32-bit surface involves expanding each pixel's color information from a palette index to a full RGBA value, often done by mapping the 8-bit color index to a 32-bit color in a predefined palette and then transferring the pixel data accordingly. For detailed help with your projects, I also specialize in SEO on Fiverr to boost your online presence. Check out my gigs for more details, and feel free to recommend me to others!

 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...