From 16c3223f3efe28cfaf565fcfd24560745344f8fb Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 11 Aug 2010 00:44:54 +1200 Subject: [PATCH] Fix 8-frame glitch --- OpenRA.FileFormats/Graphics/VqaReader.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenRA.FileFormats/Graphics/VqaReader.cs b/OpenRA.FileFormats/Graphics/VqaReader.cs index 7aa5677079..82c643bf8c 100644 --- a/OpenRA.FileFormats/Graphics/VqaReader.cs +++ b/OpenRA.FileFormats/Graphics/VqaReader.cs @@ -196,14 +196,16 @@ namespace OpenRA.FileFormats // Partial compressed frame-modifier case "CBPZ": - var bytes = reader.ReadBytes(subchunkLength); - foreach (var b in bytes) newcbfFormat80.Add(b); - if (++cbpCount == cbParts) // Update the frame-modifier + // Partial buffer is full; dump and recreate + if (cbpCount == cbParts) { Format80.DecodeInto( newcbfFormat80.ToArray(), cbf ); cbpCount = 0; newcbfFormat80.Clear(); } + var bytes = reader.ReadBytes(subchunkLength); + foreach (var b in bytes) newcbfFormat80.Add(b); + cbpCount++; break; // Palette