Merge pull request #825 from lodefmode/master

Fixed random spotty backgrounds.
This commit is contained in:
Thomas Jentzsch 2021-09-12 22:05:57 +02:00 committed by GitHub
commit 755c4e57c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -82,7 +82,7 @@ class StreamReader : public Serializable
myColorBK[0] = 0; myColorBK[0] = 0;
} }
void swapField(bool index, int frame) { void swapField(bool index, bool odd) {
uInt8* offset = index ? myBuffer1 : myBuffer2; uInt8* offset = index ? myBuffer1 : myBuffer2;
myVersion = offset + VERSION_DATA_OFFSET; myVersion = offset + VERSION_DATA_OFFSET;
@ -93,8 +93,7 @@ class StreamReader : public Serializable
myColor = offset + COLOR_DATA_OFFSET; myColor = offset + COLOR_DATA_OFFSET;
myColorBK = offset + COLORBK_DATA_OFFSET; myColorBK = offset + COLORBK_DATA_OFFSET;
// myColorBK++; if (!odd)
if (!(frame & 1))
myColorBK++; myColorBK++;
} }
@ -885,7 +884,7 @@ bool MovieCart::init(const string& path)
if(!myStream.open(path)) if(!myStream.open(path))
return false; return false;
myStream.swapField(true, myFrameNumber); myStream.swapField(true, myOdd);
return true; return true;
} }
@ -1368,7 +1367,7 @@ void MovieCart::runStateMachine()
fill_addr_left_line(0); fill_addr_left_line(0);
fill_addr_end_lines(); fill_addr_end_lines();
myStream.swapField(myBufferIndex, myFrameNumber); myStream.swapField(myBufferIndex, myOdd);
myStream.blankPartialLines(myOdd); myStream.blankPartialLines(myOdd);
myBufferIndex = !myBufferIndex; myBufferIndex = !myBufferIndex;