mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-16 22:08:28 +01:00
Fix oversize thumbnails
Broken since f52e04703731, 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:
parent
43c92f5c8f
commit
5739170f20
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user