diff --git a/src/graphics.cpp b/src/graphics.cpp index 6209a27c..4831ee1a 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -862,7 +862,8 @@ void Graphics::screenshot(const char *filename) { if (!img) throw new Exception(Exception::SDLError, "%s", SDL_GetError()); - glReadPixels(0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, img->pixels); + glReadPixels(p->scOffset.x, p->scOffset.y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, + img->pixels); #else SDL_Surface *tmp, *img; tmp = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, 0, 0, 0, 0); @@ -875,7 +876,8 @@ void Graphics::screenshot(const char *filename) { throw Exception(Exception::SDLError, "%s", SDL_GetError()); } - glReadPixels(0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, tmp->pixels); + glReadPixels(p->scOffset.x, p->scOffset.y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, + tmp->pixels); for (int i = 0; i < h; i++) { memcpy((char *)img->pixels + 4 * w * i,