Skip to content

Commit ba672c7

Browse files
committed
fixed return value interpretation
1 parent 32c16f6 commit ba672c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

LibDmd/Converter/Serum/Serum.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ public override void Convert(DmdFrame frame)
151151
ReadSerumFrame();
152152
_api.Convert(ref _serumFrame);
153153

154-
// 0 => no rotation
155-
// 1 - 0xFFFF => time in ms to next rotation
154+
// lower word: 0 => no rotation
155+
// lower word: 1 - 2048 => time in ms to next rotation
156156
// 0xFFFFFFFF => frame wasn't colorized
157-
if (rotation > 0 && (rotation & 0xffff) < 2048) {
157+
if (rotation > 0 && (rotation & 0xffff) <= 2048) {
158158
StartRotating();
159159
} else {
160160
StopRotating();
@@ -195,9 +195,9 @@ private void StopRotating()
195195
private bool UpdateRotations()
196196
{
197197
var rotation = Serum_Rotate();
198-
// 0 => no rotation
199-
// 1 - 0xFFFF => time in ms to next rotation
200-
if ((rotation & 0xffff) == 0 || (rotation & 0xffff) < 2048) {
198+
// lower word: 0 => no rotation
199+
// lower word: 1 - 2048 => time in ms to next rotation
200+
if ((rotation & 0xffff) == 0 || (rotation & 0xffff) > 2048) {
201201
StopRotating();
202202
return false;
203203
}

0 commit comments

Comments
 (0)