From 67d1ca90c48b0eba7c4e94418da1f400c4dd9a9b Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Sat, 23 Jul 2005 01:30:35 +0000 Subject: [PATCH] Moved the calls to the various layer-painting methods to their own independent method. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3660 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/MediaPanel.java | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/java/com/threerings/media/MediaPanel.java b/src/java/com/threerings/media/MediaPanel.java index b358b411f..ee9865860 100644 --- a/src/java/com/threerings/media/MediaPanel.java +++ b/src/java/com/threerings/media/MediaPanel.java @@ -481,23 +481,32 @@ public class MediaPanel extends JComponent // clip to this dirty region clipToDirtyRegion(gfx, clip); - // paint the behind the scenes stuff - paintBehind(gfx, clip); - - // paint back sprites and animations - paintBits(gfx, AnimationManager.BACK, clip); - - // paint the between the scenes stuff - paintBetween(gfx, clip); - - // paint front sprites and animations - paintBits(gfx, AnimationManager.FRONT, clip); - - // paint anything in front - paintInFront(gfx, clip); + // paint the region + paintDirtyRect(gfx, clip); } } + /** + * Paints all the layers of the specified dirty region. + */ + protected void paintDirtyRect (Graphics2D gfx, Rectangle rect) + { + // paint the behind the scenes stuff + paintBehind(gfx, rect); + + // paint back sprites and animations + paintBits(gfx, AnimationManager.BACK, rect); + + // paint the between the scenes stuff + paintBetween(gfx, rect); + + // paint front sprites and animations + paintBits(gfx, AnimationManager.FRONT, rect); + + // paint anything in front + paintInFront(gfx, rect); + } + /** * Called by the main rendering code to constrain this dirty rectangle * to the bounds of the media panel. If a derived class is using dirty