Eliminate early adjudication to get rid of different flicker
This commit is contained in:
+20
-21
@@ -36,18 +36,17 @@ void ConditionalOverlayCell::apply( Framebuffer &fb, uint64_t confirmed_epoch, i
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
fprintf( stderr, "APPLYING char %lc to (%d, %d)\n",
|
||||
replacement.debug_contents(), row, col );
|
||||
*/
|
||||
|
||||
if ( !(*(fb.get_cell( row, col )) == replacement) ) {
|
||||
if ( replacement.is_blank() && fb.get_cell( row, col )->is_blank() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
*(fb.get_mutable_cell( row, col )) = replacement;
|
||||
uint64_t now = timestamp();
|
||||
if ( display_time >= now ) {
|
||||
display_time = now;
|
||||
}
|
||||
if ( flag && (!replacement.is_blank()) ) {
|
||||
if ( flag ) {
|
||||
fb.get_mutable_cell( row, col )->renditions.underlined = true;
|
||||
}
|
||||
}
|
||||
@@ -66,6 +65,10 @@ Validity ConditionalOverlayCell::get_validity( const Framebuffer &fb, int row,
|
||||
return IncorrectOrExpired;
|
||||
}
|
||||
|
||||
if ( unknown ) {
|
||||
return CorrectNoCredit;
|
||||
}
|
||||
|
||||
const Cell ¤t = *( fb.get_cell( row, col ) );
|
||||
|
||||
/* see if it hasn't been updated yet */
|
||||
@@ -73,15 +76,15 @@ Validity ConditionalOverlayCell::get_validity( const Framebuffer &fb, int row,
|
||||
return Pending;
|
||||
}
|
||||
|
||||
assert( expiration_time != uint64_t(-1) );
|
||||
|
||||
if ( (late_ack >= expiration_frame)
|
||||
|| ( (sent_frame <= early_ack) && (expiration_time <= now) ) ) {
|
||||
/* special case deletion */
|
||||
if ( current.is_blank() && replacement.is_blank() ) {
|
||||
return CorrectNoCredit;
|
||||
}
|
||||
|
||||
if ( unknown ) {
|
||||
return CorrectNoCredit;
|
||||
}
|
||||
|
||||
if ( current.contents == replacement.contents ) {
|
||||
auto it = find_if( original_contents.begin(), original_contents.end(),
|
||||
[&]( const Cell &x ) { return replacement.contents == x.contents; } );
|
||||
@@ -90,14 +93,10 @@ Validity ConditionalOverlayCell::get_validity( const Framebuffer &fb, int row,
|
||||
} else {
|
||||
return CorrectNoCredit;
|
||||
}
|
||||
}
|
||||
|
||||
assert( expiration_time != uint64_t(-1) );
|
||||
|
||||
if ( (late_ack >= expiration_frame)
|
||||
|| ( (sent_frame <= early_ack) && (expiration_time <= now) ) ) {
|
||||
} else {
|
||||
return IncorrectOrExpired;
|
||||
}
|
||||
}
|
||||
|
||||
return Pending;
|
||||
}
|
||||
@@ -119,17 +118,17 @@ Validity ConditionalCursorMove::get_validity( const Framebuffer &fb, uint64_t se
|
||||
return Pending;
|
||||
}
|
||||
|
||||
if ( (fb.ds.get_cursor_col() == col)
|
||||
&& (fb.ds.get_cursor_row() == row) ) {
|
||||
return Correct;
|
||||
}
|
||||
|
||||
assert( expiration_time != uint64_t(-1) );
|
||||
|
||||
if ( (late_ack >= expiration_frame)
|
||||
|| ( (sent_frame <= early_ack) && (expiration_time <= now) ) ) {
|
||||
if ( (fb.ds.get_cursor_col() == col)
|
||||
&& (fb.ds.get_cursor_row() == row) ) {
|
||||
return Correct;
|
||||
} else {
|
||||
return IncorrectOrExpired;
|
||||
}
|
||||
}
|
||||
|
||||
return Pending;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user