Advertisement

getting sprites from cells

Started by November 10, 2000 02:17 PM
-1 comments, last by OoMMMoO 24 years, 2 months ago
Ive finally got loading a blitting bitmaps down but now I want to know how to load a certain section of a bitmap like one square of a template Lamothe teaches how to do with a 8bpp file but not a 24bpp and then convert it to 16bpp which is what I want to do. Im converting the bitmap from 24 to 16 like this for(int y=0;y{ for(int x=0;x{ UCHAR blue=(bitmap->buffer[y*screen_width*3+x*3+0]>>3, green=(bitmap->buffer[y*screen_width*3+x*3+1]>>3, ect... primary_buffer[x+(y*ddsd.lPitch>>1)]=RGB16(red,green,blue); } } unlock surface but that just reads the entire bitmap converting each pixel. How do I do that just reading a certain section of the bitmap

This topic is closed to new replies.

Advertisement