Gui flackert jetzt beim neu zeichnen nicht mehr
This commit is contained in:
@@ -74,7 +74,6 @@ namespace WorldOfPeacecraft
|
||||
ChatPanel.Location = new Point (MapPanel.Width, 0);
|
||||
ChatPanel.Size = new Size (ChatWidth, MapPanel.Height);
|
||||
this.ResumeLayout();
|
||||
this.PerformLayout();
|
||||
ChatPanel.UpdateData ();
|
||||
this.Refresh();
|
||||
}));
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace WorldOfPeacecraft
|
||||
|
||||
public MapPanel (IBackend backend)
|
||||
{
|
||||
SetStyle (ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
|
||||
Backend = backend;
|
||||
this.Paint += DoPaint;
|
||||
this.PreviewKeyDown += board_KeyPress;
|
||||
BowAndArrow = Image.FromFile (ImagesFolder + "bow-and-arrow.png", false);
|
||||
Dragon1 = Image.FromFile (ImagesFolder + "dragon1.png");
|
||||
@@ -76,15 +76,13 @@ namespace WorldOfPeacecraft
|
||||
Backend.MoveTo (targetX, targetY);
|
||||
}
|
||||
|
||||
public void DoPaint (object source, PaintEventArgs args)
|
||||
protected override void OnPaint (PaintEventArgs e)
|
||||
{
|
||||
BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate (this.CreateGraphics (), this.DisplayRectangle);
|
||||
Graphics g = buffer.Graphics;
|
||||
Graphics g = e.Graphics;
|
||||
lock (Backend) {
|
||||
PaintMap (g);
|
||||
PaintEntities (g);
|
||||
}
|
||||
buffer.Render();
|
||||
}
|
||||
|
||||
public void PaintMap (Graphics g)
|
||||
|
||||
Reference in New Issue
Block a user