public override void Paint2(object sender, PaintEventArgs e) { //LibSys.StatusBar.Trace("TileSet:Paint2() rect=" + e.ClipRectangle); try { //lock(tilesLock) { for (int vv = 0; vv < m_vCount; vv++) { for (int hh = 0; hh < m_hCount; hh++) { Tile tile = m_tiles[vv, hh]; //LibSys.StatusBar.Trace("TileSet:Paint2() - tile " + tile.ToString()); if (tile != null && tile.getFrameRectangle().IntersectsWith(e.ClipRectangle)) { tile.Tile_Paint2(sender, e); } } } } } catch (Exception eee) { #if DEBUG LibSys.StatusBar.Error("TileSet:Paint2(): " + eee); #endif } }
public void ArrangeBackdropRedraw(Tile tile) { double safeHeight = ((double)Project.CAMERA_HEIGHT_SAFE) * 1000.0d; if (m_cameraManager.Elev < safeHeight && (!Project.allowUnreasonableZoom && IsAllSubstitutes || IsEmpty)) { // we get here if the last tile arrived empty. and whole tile set is empty. #if DEBUG LibSys.StatusBar.Trace("TileSet:tileBackdropArrived() - all tiles empty - repositioning"); #endif m_cameraManager.Elev = safeHeight; return; } if (m_cameraManager.Elev >= 5000000.0d) // world map may span 180, redraw whole thing { Rectangle toDrawRect = m_pictureManager.PictureBox.Bounds; m_pictureManager.Invalidate(toDrawRect); } else { //LibSys.StatusBar.Trace("TileSet::tileBackdropArrived() - " + tile.ToString()); //Point topLeft = tile.pixelTopLeft(); //Point bottomRight = tile.pixelBottomRight(); //Size size = new Size(bottomRight.X - topLeft.X, bottomRight.Y - topLeft.Y); //Rectangle tileRect = new Rectangle(topLeft, size); Rectangle tileRect = tile.getFrameRectangle(); //new Rectangle(topLeft, size); //LibSys.StatusBar.Trace(" - tileRect " + tileRect); Rectangle toDrawRect = m_pictureManager.PictureBox.Bounds; //LibSys.StatusBar.Trace(" - pbRect " + toDrawRect); toDrawRect.Intersect(tileRect); //LibSys.StatusBar.Trace(" - " + tile.ToString() + " invalidating " + toDrawRect); m_pictureManager.Invalidate(toDrawRect); } }
public void ArrangeFeaturesRedraw(Tile tile) { //Point topLeft = tile.pixelTopLeft(); //Point bottomRight = tile.pixelBottomRight(); //Size size = new Size(bottomRight.X - topLeft.X, bottomRight.Y - topLeft.Y); Rectangle tileRect = tile.getFrameRectangle(); //new Rectangle(topLeft, size); //LibSys.StatusBar.Trace("tileFeaturesArrived() - tileRect " + tileRect); Rectangle toDrawRect = m_pictureManager.PictureBox.Bounds; //LibSys.StatusBar.Trace("tileFeaturesArrived() - pbRect " + toDrawRect); if (m_cameraManager.Elev < 5000000.0d) // world map may span 180, redraw whole thing { toDrawRect.Intersect(tileRect); } #if DEBUG LibSys.StatusBar.Trace("tileFeaturesArrived() - tile " + tile.ToString() + " invalidating " + toDrawRect); #endif m_pictureManager.Invalidate(toDrawRect); }
public void ArrangeFeaturesRedraw(Tile tile) { //Point topLeft = tile.pixelTopLeft(); //Point bottomRight = tile.pixelBottomRight(); //Size size = new Size(bottomRight.X - topLeft.X, bottomRight.Y - topLeft.Y); Rectangle tileRect = tile.getFrameRectangle(); //new Rectangle(topLeft, size); //LibSys.StatusBar.Trace("tileFeaturesArrived() - tileRect " + tileRect); Rectangle toDrawRect = m_pictureManager.PictureBox.Bounds; //LibSys.StatusBar.Trace("tileFeaturesArrived() - pbRect " + toDrawRect); if(m_cameraManager.Elev < 5000000.0d) // world map may span 180, redraw whole thing { toDrawRect.Intersect(tileRect); } #if DEBUG LibSys.StatusBar.Trace("tileFeaturesArrived() - tile " + tile.ToString() + " invalidating " + toDrawRect); #endif m_pictureManager.Invalidate(toDrawRect); }
public void ArrangeBackdropRedraw(Tile tile) { double safeHeight = ((double)Project.CAMERA_HEIGHT_SAFE) * 1000.0d; if(m_cameraManager.Elev < safeHeight && (!Project.allowUnreasonableZoom && IsAllSubstitutes || IsEmpty)) { // we get here if the last tile arrived empty. and whole tile set is empty. #if DEBUG LibSys.StatusBar.Trace("TileSet:tileBackdropArrived() - all tiles empty - repositioning"); #endif m_cameraManager.Elev = safeHeight; return; } if(m_cameraManager.Elev >= 5000000.0d) // world map may span 180, redraw whole thing { Rectangle toDrawRect = m_pictureManager.PictureBox.Bounds; m_pictureManager.Invalidate(toDrawRect); } else { //LibSys.StatusBar.Trace("TileSet::tileBackdropArrived() - " + tile.ToString()); //Point topLeft = tile.pixelTopLeft(); //Point bottomRight = tile.pixelBottomRight(); //Size size = new Size(bottomRight.X - topLeft.X, bottomRight.Y - topLeft.Y); //Rectangle tileRect = new Rectangle(topLeft, size); Rectangle tileRect = tile.getFrameRectangle(); //new Rectangle(topLeft, size); //LibSys.StatusBar.Trace(" - tileRect " + tileRect); Rectangle toDrawRect = m_pictureManager.PictureBox.Bounds; //LibSys.StatusBar.Trace(" - pbRect " + toDrawRect); toDrawRect.Intersect(tileRect); //LibSys.StatusBar.Trace(" - " + tile.ToString() + " invalidating " + toDrawRect); m_pictureManager.Invalidate(toDrawRect); } }