Save files whole or not at all, and keep a render's sounds alive
file_text_save writes a temporary file beside its target, checks every write and the close, then renames it over the target. A full disk or quota error no longer leaves a truncated save reported as a success (which then deleted the autosave). Documents, autosaves, settings and PNGs all save through it. A recording copies each trigger sound once, so a library reloaded mid-render leaves its audio mix nothing freed to read. A recording's finish reports whether its output was made, which animation_record now returns in place of whether the path existed. A PNG sequence format without a placeholder numbers each frame after its name instead of writing one file over and over, and pixel buffers are sized in integers (a float count could run short).
This commit is contained in:
1 parent
71b0ef683b
commit
068d189e6a
11 files changed
+98
-46
No files matched your search
+1
-2
@@ -29,7 +29,6 @@ void Framebuffer::set()
|
||||
|
||||
gl.FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
|
||||
|
||||
|
||||
gl.BindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
@@ -43,7 +42,7 @@ void Framebuffer::size_set(Vec2 size)
|
||||
|
||||
std::vector<uint8_t> Framebuffer::pixels_get() const
|
||||
{
|
||||
auto count = size.x * size.y * IMAGE_CHANNELS;
|
||||
auto count = (std::size_t)size.x * (std::size_t)size.y * IMAGE_CHANNELS;
|
||||
std::vector<uint8_t> pixels(count);
|
||||
|
||||
gl.ReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
|
||||
Reference in new issue
Block a user