public override void ResetSpans(int min_x, int max_x) { int max_len = max_x - min_x + 2; if (max_len > m_spans.Length) { m_spans = new ScanlineSpan[max_len]; m_covers = new byte[max_len]; } last_x = 0x7FFFFFF0; minX = min_x; last_span_index = 0; }
public override void ResetSpans(int min_x, int max_x) { int max_len = max_x - min_x + 3; if (max_len > m_spans.Length) { m_spans = new ScanlineSpan[max_len]; m_covers = new byte[max_len]; } last_x = 0x7FFFFFF0; m_cover_index = 0; //make it ready for next add last_span_index = 0; m_spans[last_span_index].len = 0; }
public override void AddCell(int x, int cover) { x -= minX; m_covers[x] = (byte)cover; if (x == last_x + 1) { m_spans[last_span_index].len++; } else { last_span_index++; m_spans[last_span_index] = new ScanlineSpan(x + minX, x); } last_x = x; }
public override void AddCell(int x, int cover) { x -= _minX; _covers[x] = (byte)cover; if (x == _last_x + 1) { _spans[_last_span_index].len++; } else { _last_span_index++; _spans[_last_span_index] = new ScanlineSpan(x + _minX, x); } _last_x = x; }
public override void AddCell(int x, int cover) { m_covers[m_cover_index] = (byte)cover; if (x == last_x + 1 && m_spans[last_span_index].len > 0) { //append to last cell m_spans[last_span_index].len++; } else { //start new last_span_index++; m_spans[last_span_index] = new ScanlineSpan((short)x, m_cover_index); } last_x = x; m_cover_index++; //make it ready for next add }
public override void AddCell(int x, int cover) { _covers[_cover_index] = (byte)cover; if (x == _last_x + 1 && _spans[_last_span_index].len > 0) { //append to last cell _spans[_last_span_index].len++; } else { //start new _last_span_index++; _spans[_last_span_index] = new ScanlineSpan((short)x, _cover_index); } _last_x = x; _cover_index++; //make it ready for next add }
public override void AddSpan(int x, int len, int cover) { x -= minX; for (int i = 0; i < len; i++) { m_covers[x + i] = (byte)cover; } if (x == last_x + 1) { m_spans[last_span_index].len += (short)len; } else { last_span_index++; m_spans[last_span_index] = new ScanlineSpan(x + minX, len, x); } last_x = x + (int)len - 1; }
public override void AddSpan(int x, int len, int cover) { int backupCover = cover; if (x == last_x + 1 && m_spans[last_span_index].len < 0 && cover == m_spans[last_span_index].cover_index) { //just append data to latest span *** m_spans[last_span_index].len -= (short)len; } else { m_covers[m_cover_index] = (byte)cover; last_span_index++; //--------------------------------------------------- //start new m_spans[last_span_index] = new ScanlineSpan((short)x, (short)(-len), m_cover_index); m_cover_index++; //make it ready for next add } last_x = x + len - 1; }
public override void AddSpan(int x, int len, int cover) { #if DEBUG int backupCover = cover; #endif if (x == _last_x + 1 && _spans[_last_span_index].len < 0 && cover == _spans[_last_span_index].cover_index) { //just append data to latest span *** _spans[_last_span_index].len -= (short)len; } else { _covers[_cover_index] = (byte)cover; _last_span_index++; //--------------------------------------------------- //start new _spans[_last_span_index] = new ScanlineSpan((short)x, (short)(-len), _cover_index); _cover_index++; //make it ready for next add } _last_x = x + len - 1; }