Advertisement
YellowAfterlife

Untitled

Jul 28th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // { } -> { } means replacements, just in case.
  2. /// file: jeash/display/DisplayObject.hx
  3.  
  4. // line ~63 {
  5.     public var alpha:Float;
  6. // } -> {
  7.     public var jeashAlpha:Float;
  8.     public var alpha:Float;
  9. // }
  10. /* jeashAlpha is [going to be] 'combined' alpha, meaning that
  11.  * values of all parent objects are taken into account */
  12.  
  13. // line ~423, method jeashRender {
  14.             if (inMask != null) {
  15.                 Lib.jeashDrawToSurface(gfx.jeashSurface, inMask, m, (parent != null ? parent.alpha : 1) * alpha);
  16.             } else {
  17.                 Lib.jeashSetSurfaceTransform(gfx.jeashSurface, m);
  18.                 Lib.jeashSetSurfaceOpacity(gfx.jeashSurface, (parent != null ? parent.alpha : 1) * alpha);
  19.             }
  20. // } -> {
  21.             jeashAlpha = parent != null ? parent.jeashAlpha * alpha : alpha;
  22.             if (inMask != null) {
  23.                 Lib.jeashDrawToSurface(gfx.jeashSurface, inMask, m, jeashAlpha);
  24.             } else {
  25.                 Lib.jeashSetSurfaceTransform(gfx.jeashSurface, m);
  26.                 Lib.jeashSetSurfaceOpacity(gfx.jeashSurface, jeashAlpha);
  27.             }
  28. // }
  29. /* Instead of using single-level alpha inheritance, a 'combined'
  30.  * value is being calculated, and passed down the rendering pipeline,
  31.  * since DisplayObjectContainer objects render children after themselves */
  32.  
  33. /// file: jeash/display/Bitmap.hx
  34.  
  35. // line ~120, method jeashRender {
  36.         if (inMask != null) {
  37.             Lib.jeashDrawToSurface(jeashGraphics.jeashSurface, inMask, m, (parent != null ? parent.alpha : 1) * alpha);
  38.         } else {
  39.  
  40.             Lib.jeashSetSurfaceTransform(jeashGraphics.jeashSurface, m);
  41.             Lib.jeashSetSurfaceOpacity(jeashGraphics.jeashSurface, (parent != null ? parent.alpha : 1) * alpha);
  42.         }
  43. // } -> {
  44.         jeashAlpha = parent != null ? parent.jeashAlpha * alpha : alpha;
  45.         if (inMask != null) {
  46.             Lib.jeashDrawToSurface(jeashGraphics.jeashSurface, inMask, m, jeashAlpha);
  47.         } else {
  48.  
  49.             Lib.jeashSetSurfaceTransform(jeashGraphics.jeashSurface, m);
  50.             Lib.jeashSetSurfaceOpacity(jeashGraphics.jeashSurface, jeashAlpha);
  51.         }
  52. // }
  53. /* Pretty much duplicate of above. Could probably make an inline method */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement