mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-10 18:34:21 +02:00
Fix oversize thumbnails
Broken since f52e047037
, where Renderer::DumpFrame was removed in favour of constructing VideoBuffers directly from pixel data, but Renderer::video's exact width wasn't taken into account. This was chosen to be WINDOW.X, rather than the intuitive RES.X, in order to enable blitting the sim framebuffer onto the window framebuffer with a single memcpy.
This commit is contained in:
@@ -68,6 +68,7 @@ int main(int argc, char *argv[])
|
||||
ren->BlendText({ x+8, y+8 }, "Save file invalid", 0xC0C0F0_rgb .WithAlpha(255));
|
||||
}
|
||||
|
||||
if (auto data = VideoBuffer(ren->GetVideo()).ToPNG())
|
||||
auto &video = ren->GetVideo();
|
||||
if (auto data = VideoBuffer(video.data(), RES, video.Size().X).ToPNG())
|
||||
Platform::WriteFile(*data, outputFilename);
|
||||
}
|
||||
|
Reference in New Issue
Block a user