Skip to content

Commit

Permalink
Fix monitor clear state being cleared without a redraw
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev committed Feb 21, 2018
1 parent d3ecd52 commit 15a3882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void renderMonitorAt( TileMonitor monitor, double posX, double posY, dou
BufferBuilder renderer = tessellator.getBuffer();

// Get terminal
boolean redraw = originTerminal.hasTerminalChanged();
boolean redraw = originTerminal.pollTerminalChanged();

// Draw the contents
GlStateManager.depthMask( false );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,28 @@ public class ClientTerminal implements ITerminal
private boolean m_colour;
private Terminal m_terminal;
private boolean m_terminalChanged;
private boolean m_terminalChangedLastFrame;

public ClientTerminal( boolean colour )
{
m_colour = colour;
m_terminal = null;
m_terminalChanged = false;
m_terminalChangedLastFrame = false;
}

public void update()
{
m_terminalChangedLastFrame = m_terminalChanged || (m_terminal != null && m_terminal.getChanged());
if( m_terminal != null )
{
m_terminalChanged |= m_terminal.getChanged();
m_terminal.clearChanged();
}
m_terminalChanged = false;
}

public boolean hasTerminalChanged()
public boolean pollTerminalChanged()
{
return m_terminalChangedLastFrame;
boolean changed = m_terminalChanged;
m_terminalChanged = false;
return changed;
}

// ITerminal implementation
Expand Down

0 comments on commit 15a3882

Please sign in to comment.