Skip to content
Browse files

GetScreenshot: create the surface sprite directly

avoid calling createsprite so we dont do unnecessary pixel conversion
  • Loading branch information...
1 parent 0c63add commit b500324357d2ba2cc5edc9c44d7ab2d2bba4c32f @bradallred bradallred committed Jun 21, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 gemrb/plugins/SDLVideo/SDLVideo.cpp
View
3 gemrb/plugins/SDLVideo/SDLVideo.cpp
@@ -832,7 +832,8 @@ Sprite2D* SDLVideoDriver::GetScreenshot( Region r )
SDL_Rect src = {(Sint16)r.x, (Sint16)r.y, (Uint16)r.w, (Uint16)r.h};
void* pixels = malloc( Width * Height * 3 );
- SDLSurfaceSprite2D* screenshot = (SDLSurfaceSprite2D*)CreateSprite( Width, Height, 24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000, pixels);
+ SDLSurfaceSprite2D* screenshot = new SDLSurfaceSprite2D(Width, Height, 24, pixels,
+ 0x00ff0000, 0x0000ff00, 0x000000ff);
SDL_BlitSurface( backBuf, (r.w && r.h) ? &src : NULL, (SDL_Surface*)screenshot->GetSurface(), NULL);
return screenshot;

0 comments on commit b500324

Please sign in to comment.
Something went wrong with that request. Please try again.