MrParrot Posted January 28, 2018 Share Posted January 28, 2018 (edited) 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 January 28, 2018 by MrParrot incomplete post Link to comment Share on other sites More sharing options...
dkeeton Posted January 28, 2018 Share Posted January 28, 2018 I noticed that qt can read directdraw surfaces. Here is the source for it. https://github.com/qt/qtimageformats/tree/5.10/src/plugins/imageformats/dds Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted January 28, 2018 Share Posted January 28, 2018 If you want a quick solution without coding anything, try this https://msdn.microsoft.com/en-us/library/windows/desktop/dd145089(v=vs.85).aspx It's very slow though, that's why I didn't include it with cnc-ddraw 2 Examples below (640x400 stretched to 960x600), default vs halftone Link to comment Share on other sites More sharing options...
ander1331 Posted July 30 Share Posted July 30 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now