Advertisement
Guest User

Untitled

a guest
Nov 26th, 2011
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp
  2. index 72c84bb..d623f58 100644
  3. --- a/xbmc/Util.cpp
  4. +++ b/xbmc/Util.cpp
  5. @@ -935,7 +935,22 @@ void CUtil::TakeScreenshot(const CStdString &filename, bool sync)
  6. //make a new buffer and copy the read image to it with the Y axis inverted
  7. outpixels = new unsigned char[stride * height];
  8. for (int y = 0; y < height; y++)
  9. + {
  10. +#ifdef HAS_GLES
  11. + // we need to save in BGRA order so XOR Swap RGBA -> BGRA
  12. + unsigned char* swap_pixels = pixels;
  13. + for (int x = 0; x < width; x++, swap_pixels+=4)
  14. + {
  15. + if (swap_pixels[0] != swap_pixels[2])
  16. + {
  17. + swap_pixels[0] ^= swap_pixels[2];
  18. + swap_pixels[2] ^= swap_pixels[0];
  19. + swap_pixels[0] ^= swap_pixels[2];
  20. + }
  21. + }
  22. +#endif
  23. memcpy(outpixels + y * stride, pixels + (height - y - 1) * stride, stride);
  24. + }
  25.  
  26. delete [] pixels;
  27.  
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement