Fix excessive flagging (underlining)
This commit is contained in:
+7
-26
@@ -42,10 +42,6 @@ void ConditionalOverlayCell::apply( Framebuffer &fb, uint64_t confirmed_epoch, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
*(fb.get_mutable_cell( row, col )) = replacement;
|
*(fb.get_mutable_cell( row, col )) = replacement;
|
||||||
uint64_t now = timestamp();
|
|
||||||
if ( display_time >= now ) {
|
|
||||||
display_time = now;
|
|
||||||
}
|
|
||||||
if ( flag ) {
|
if ( flag ) {
|
||||||
fb.get_mutable_cell( row, col )->renditions.underlined = true;
|
fb.get_mutable_cell( row, col )->renditions.underlined = true;
|
||||||
}
|
}
|
||||||
@@ -364,6 +360,13 @@ void PredictionEngine::cull( const Framebuffer &fb )
|
|||||||
{
|
{
|
||||||
uint64_t now = timestamp();
|
uint64_t now = timestamp();
|
||||||
|
|
||||||
|
/* control flagging with hysteresis */
|
||||||
|
if ( send_interval > 80 ) {
|
||||||
|
flagging = true;
|
||||||
|
} else if ( send_interval < 50 ) {
|
||||||
|
flagging = false;
|
||||||
|
}
|
||||||
|
|
||||||
/* go through cell predictions */
|
/* go through cell predictions */
|
||||||
|
|
||||||
auto i = overlays.begin();
|
auto i = overlays.begin();
|
||||||
@@ -436,27 +439,12 @@ void PredictionEngine::cull( const Framebuffer &fb )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( j->display_time != uint64_t(-1) ) {
|
|
||||||
if ( now - j->display_time < 75 ) {
|
|
||||||
if ( flag_score > -10 ) {
|
|
||||||
flag_score--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no break */
|
/* no break */
|
||||||
case CorrectNoCredit:
|
case CorrectNoCredit:
|
||||||
j->reset();
|
j->reset();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Pending:
|
case Pending:
|
||||||
if ( j->display_time != uint64_t(-1) ) {
|
|
||||||
if ( now - j->display_time > 150 ) {
|
|
||||||
if ( flag_score < 10 ) {
|
|
||||||
flag_score++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -466,13 +454,6 @@ void PredictionEngine::cull( const Framebuffer &fb )
|
|||||||
i = inext;
|
i = inext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* control flagging with hysteresis */
|
|
||||||
if ( flag_score > 5 ) {
|
|
||||||
flagging = true;
|
|
||||||
} else if ( flag_score < -5 ) {
|
|
||||||
flagging = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* go through cursor predictions */
|
/* go through cursor predictions */
|
||||||
for ( auto it = cursors.begin(); it != cursors.end(); it++ ) {
|
for ( auto it = cursors.begin(); it != cursors.end(); it++ ) {
|
||||||
if ( it->start_clock( local_frame_acked, now, send_interval ) ) {
|
if ( it->start_clock( local_frame_acked, now, send_interval ) ) {
|
||||||
|
|||||||
+2
-6
@@ -60,8 +60,6 @@ namespace Overlay {
|
|||||||
Cell replacement;
|
Cell replacement;
|
||||||
bool unknown;
|
bool unknown;
|
||||||
|
|
||||||
mutable uint64_t display_time;
|
|
||||||
|
|
||||||
vector<Cell> original_contents; /* we don't give credit for correct predictions
|
vector<Cell> original_contents; /* we don't give credit for correct predictions
|
||||||
that match the original contents */
|
that match the original contents */
|
||||||
|
|
||||||
@@ -72,11 +70,10 @@ namespace Overlay {
|
|||||||
: ConditionalOverlay( s_exp, s_col, s_tentative ),
|
: ConditionalOverlay( s_exp, s_col, s_tentative ),
|
||||||
replacement( 0 ),
|
replacement( 0 ),
|
||||||
unknown( false ),
|
unknown( false ),
|
||||||
display_time( uint64_t(-1) ),
|
|
||||||
original_contents()
|
original_contents()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void reset( void ) { unknown = false; display_time = uint64_t(-1); original_contents.clear(); ConditionalOverlay::reset(); }
|
void reset( void ) { unknown = false; original_contents.clear(); ConditionalOverlay::reset(); }
|
||||||
void reset_with_orig( void ) {
|
void reset_with_orig( void ) {
|
||||||
if ( (!active) || unknown ) {
|
if ( (!active) || unknown ) {
|
||||||
reset();
|
reset();
|
||||||
@@ -140,7 +137,6 @@ namespace Overlay {
|
|||||||
|
|
||||||
void newline_carriage_return( const Framebuffer &fb );
|
void newline_carriage_return( const Framebuffer &fb );
|
||||||
|
|
||||||
int flag_score;
|
|
||||||
bool flagging;
|
bool flagging;
|
||||||
|
|
||||||
ConditionalCursorMove & cursor( void ) { assert( !cursors.empty() ); return cursors.back(); }
|
ConditionalCursorMove & cursor( void ) { assert( !cursors.empty() ); return cursors.back(); }
|
||||||
@@ -172,7 +168,7 @@ namespace Overlay {
|
|||||||
local_frame_sent( 0 ), local_frame_acked( 0 ),
|
local_frame_sent( 0 ), local_frame_acked( 0 ),
|
||||||
local_frame_late_acked( 0 ),
|
local_frame_late_acked( 0 ),
|
||||||
prediction_epoch( 1 ), confirmed_epoch( 0 ),
|
prediction_epoch( 1 ), confirmed_epoch( 0 ),
|
||||||
flag_score( 0 ), flagging( false ), last_scheduled_timeout( 0 ),
|
flagging( false ), last_scheduled_timeout( 0 ),
|
||||||
send_interval( 250 )
|
send_interval( 250 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user