mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
use a TArray for the screenshot buffer.
This commit is contained in:
parent
3e47edb677
commit
a6467d2c9a
1 changed files with 3 additions and 4 deletions
|
@ -283,11 +283,10 @@ void RenderToSavePic(FRenderViewpoint& vp, FileWriter* file, int width, int heig
|
|||
|
||||
|
||||
int numpixels = width * height;
|
||||
uint8_t* scr = (uint8_t*)M_Malloc(numpixels * 3);
|
||||
screen->CopyScreenToBuffer(width, height, scr);
|
||||
TArray<uint8_t> scr(numpixels * 3, true);
|
||||
screen->CopyScreenToBuffer(width, height, scr.Data());
|
||||
|
||||
DoWriteSavePic(file, scr, width, height, screen->FlipSavePic());
|
||||
M_Free(scr);
|
||||
DoWriteSavePic(file, scr.Data(), width, height, screen->FlipSavePic());
|
||||
|
||||
// Switch back the screen render buffers
|
||||
screen->SetViewportRects(nullptr);
|
||||
|
|
Loading…
Reference in a new issue