<div dir="ltr">Thanks a lot, guys, for your help. Finally I managed to get correct RGB from the 16bit pixel using SDL_GetRGB. First I get a pixel and then retrieve RGB from it:<br> <br> Uint8 red, green, blue;<br> Uint32 pixel;<br>
<br> for(int y = 0; y < 480; y++) <br> {<br> for(int x = 0; x < 640; x++) <br> {<br> pixel = getpixel(surface, x, y);<br> SDL_GetRGB((Uint32)pixel, surface->format, &red, &green, &blue);<br>
}<br clear="all"> }<br> <br> But now I have another problem. There is a transformation of color:<br><br> PixelSrc = (ColorToReplace.R() << PF->Rshift) | (ColorToReplace.G() << PF->Gshift) | (ColorToReplace.B() << PF->Bshift);<br>
<br>Where ColorToReplace is (255,102,155)<br><br>But after that transformation it becomes (255, 252, 7). Could somebody tell me where is a mistake?<br><br>TIA<br><br>P. S. Sorry for not clever questions. I don't have a big C++ and SDL practice.<br>
<br>-- <br>Cheers,<br>Michael<br>
</div>