mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Upscale screenshots 2x
The plan is to have Steam screenshots always be 2x, but in the VVVVVV screenshots directory (for F6 keybind) save both 1x and 2x. Again, just for now, the 2x screenshot is being saved to a temporary location for testing and will get proper timestamps later.
This commit is contained in:
@@ -346,3 +346,40 @@ bool TakeScreenshot(SDL_Surface** surface)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UpscaleScreenshot2x(SDL_Surface* src, SDL_Surface** dest)
|
||||
{
|
||||
if (src == NULL)
|
||||
{
|
||||
SDL_assert(0 && "src is NULL!");
|
||||
return false;
|
||||
}
|
||||
if (dest == NULL)
|
||||
{
|
||||
SDL_assert(0 && "dest is NULL!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (*dest == NULL)
|
||||
{
|
||||
*dest = SDL_CreateRGBSurface(
|
||||
0, src->w * 2, src->h * 2, src->format->BitsPerPixel, 0, 0, 0, 0
|
||||
);
|
||||
if (*dest == NULL)
|
||||
{
|
||||
WHINE_ONCE_ARGS(
|
||||
("Could not create temporary surface: %s", SDL_GetError())
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int result = SDL_BlitScaled(src, NULL, *dest, NULL);
|
||||
if (result != 0)
|
||||
{
|
||||
WHINE_ONCE_ARGS(("Could not blit surface: %s", SDL_GetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user