src/gldraw.cpp

changeset 511
c3787dbd6315
parent 510
ee90c55dfeef
child 512
adab82ab13a5
equal deleted inserted replaced
510:ee90c55dfeef 511:c3787dbd6315
1762 1762
1763 bool lastfilled = false; 1763 bool lastfilled = false;
1764 bool firstrun = true; 1764 bool firstrun = true;
1765 const uint32 white = 0xFFFFFFFF; 1765 const uint32 white = 0xFFFFFFFF;
1766 bool inward = true; 1766 bool inward = true;
1767 int run = 0;
1768 const int w = m_width, h = m_height; 1767 const int w = m_width, h = m_height;
1769 1768
1770 glClearColor (1.0, 1.0, 1.0, 1.0); 1769 glClearColor (1.0, 1.0, 1.0, 1.0);
1771 glDisable (GL_DITHER); 1770 glDisable (GL_DITHER);
1772 1771
1797 1796
1798 // Left and right edges 1797 // Left and right edges
1799 for (int i = 0; i < h && !filled; ++i) 1798 for (int i = 0; i < h && !filled; ++i)
1800 if (imgdata[i * w] != white || imgdata[ (i * w) + (w - 1)] != white) 1799 if (imgdata[i * w] != white || imgdata[ (i * w) + (w - 1)] != white)
1801 filled = true; 1800 filled = true;
1801
1802 delete[] cap;
1802 1803
1803 if (firstrun) 1804 if (firstrun)
1804 { // If this is the first run, we don't know enough to determine 1805 { // If this is the first run, we don't know enough to determine
1805 // whether the zoom was to fit, so we mark in our knowledge so 1806 // whether the zoom was to fit, so we mark in our knowledge so
1806 // far and start over. 1807 // far and start over.
1821 break; 1822 break;
1822 1823
1823 inward = !filled; 1824 inward = !filled;
1824 } 1825 }
1825 1826
1826 delete[] cap;
1827 lastfilled = filled; 1827 lastfilled = filled;
1828 ++run;
1829 } 1828 }
1830 1829
1831 setBackground(); 1830 setBackground();
1832 m_picking = false; 1831 m_picking = false;
1833 } 1832 }

mercurial