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

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...