Skip to content

Commit

Permalink
fixed timings
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Feb 20, 2024
1 parent 42b93d6 commit 1d15c55
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/DMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,15 +1023,17 @@ void DMD::DumpDMDTxtThread()
.count());
memcpy(renderBuffer[2], m_updateBuffer[bufferPosition]->data, length);

if (m_updateBuffer[bufferPosition]->depth == 2 && passed[2] < DMDUTIL_MAX_TRANSITIONAL_FRAME_DURATION)
if (m_updateBuffer[bufferPosition]->depth == 2 &&
(passed[2] - passed[1]) < DMDUTIL_MAX_TRANSITIONAL_FRAME_DURATION)
{
int i = 0;
while (i < length &&
((bool)(renderBuffer[0][i] & 3) || (bool)(renderBuffer[2][i] & 3) == (bool)renderBuffer[1]))
((renderBuffer[0][i] == 2) ||
((renderBuffer[0][i] == 3) || (renderBuffer[2][i] > 1)) == (renderBuffer[1][i] > 0)))
{
i++;
}

printf("C: %d\n", i);
if (i == length)
{
// renderBuffer[1] is a transitional frame, delete it.
Expand All @@ -1055,7 +1057,9 @@ void DMD::DumpDMDTxtThread()
fprintf(f, "\n");
}
memcpy(renderBuffer[0], renderBuffer[1], length);
passed[0] = passed[1];
memcpy(renderBuffer[1], renderBuffer[2], length);
passed[1] = passed[2];
}
}
}
Expand Down

0 comments on commit 1d15c55

Please sign in to comment.