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:
Tamás Bálint Misius 2024-12-16 16:06:02 +01:00
parent 43c92f5c8f
commit 5739170f20
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -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);
}