package nme.display;

import nme.display.DisplayObject;
import nme.display.PixelSnapping;

class Bitmap extends DisplayObject {
   public var bitmapData(default,nmeSetBitmapData) : BitmapData;
   public var pixelSnapping : PixelSnapping;
   public var smoothing : Bool;

   var mGraphics:Graphics;

   public function new(?inBitmapData : BitmapData, ?inPixelSnapping : PixelSnapping, ?inSmoothing : Bool) : Void {
         super(DisplayObject.nme_create_display_object(),"Bitmap");
         pixelSnapping = inPixelSnapping;
         smoothing = inSmoothing;
         nmeSetBitmapData(inBitmapData);
   }

   function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
   {
      var gfx = graphics;
      gfx.clear();
		bitmapData = inBitmapData;
      if (inBitmapData!=null)
      {
         gfx.beginBitmapFill(inBitmapData,false,smoothing);
         gfx.drawRect(0,0,inBitmapData.width,inBitmapData.height);
         gfx.endFill();
      }
      return inBitmapData;
   }

}


package nme.display;

import nme.display.DisplayObject;
import nme.display.PixelSnapping;

class Bitmap extends DisplayObject {
   public var bitmapData(default,nmeSetBitmapData) : BitmapData;
   public var pixelSnapping : PixelSnapping;
   public var smoothing(default,nmeSetSmoothing) : Bool;

   var mGraphics:Graphics;

   public function new(?inBitmapData : BitmapData, ?inPixelSnapping : PixelSnapping, ?inSmoothing : Bool) : Void {
         super(DisplayObject.nme_create_display_object(),"Bitmap");
         pixelSnapping = inPixelSnapping;
         smoothing = inSmoothing;
         nmeSetBitmapData(inBitmapData);
   }

   function nmeRebuid()
   {
      var gfx = graphics;
      gfx.clear();
      if (bitmapData!=null)
      {
         gfx.beginBitmapFill(bitmapData,false,smoothing);
         gfx.drawRect(0,0,bitmapData.width,bitmapData.height);
         gfx.endFill();
      }
   }

   function nmeSetSmoothing(inSmooth:Bool) : Bool
   {
      smoothing = inSmooth;
      nmeRebuid();
      return inSmooth;
   }

   function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
   {
	  bitmapData = inBitmapData;
     nmeRebuid();
     return inBitmapData;
   }

}


Allow smoothing to be set after creation
Allow smoothing to be set after creation

git-svn-id: 6cc2fa9b7d2830c930c171b991ffcd5e23f23d5e@689 1509560c-5e2a-0410-865c-31c25e1cfdef

haxenme/nme,madrazo/nme,haxenme/nme,haxenme/nme,thomasuster/NME,haxenme/nme,thomasuster/NME,madrazo/nme,thomasuster/NME,madrazo/nme,madrazo/nme,haxenme/nme,thomasuster/NME,madrazo/nme,thomasuster/NME,thomasuster/NME,madrazo/nme