Advertisement
Guest User

Poptropica Graphics Quality

a guest
Apr 1st, 2015
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package game.util
  2. {
  3.    import com.poptropica.AppConfig;
  4.    import flash.display.Stage;
  5.    import com.poptropica.platformSpecific.mobile.IDeviceCheck;
  6.    
  7.    public class PerformanceUtils extends Object
  8.    {
  9.      
  10.       public function PerformanceUtils()
  11.       {
  12.          super();
  13.       }
  14.      
  15.       public static function determineQualityLevel() : int
  16.       {
  17.          var _loc2_:* = null;
  18.          var _loc1_:* = 100;
  19.          if(PlatformUtils.isMobileOS && !(deviceCheck == null))
  20.          {
  21.             _loc1_ = deviceCheck.getDeviceLevel();
  22.          }
  23.          return _loc1_;
  24.       }
  25.      
  26.       public static function determineAndSetVectorQuality() : void
  27.       {
  28.          var _loc1_:* = null;
  29.          if(qualityLevel < 50 && !(AppConfig.platformType == "tablet") && !(AppConfig.platformType == "desktop"))
  30.          {
  31.             _loc1_ = "low";
  32.          }
  33.          else if(qualityLevel < 60 || (PlatformUtils.isMobileOS))
  34.          {
  35.             _loc1_ = "medium";
  36.          }
  37.          else
  38.          {
  39.             _loc1_ = "high";
  40.          }
  41.          
  42.          if(stage.quality != _loc1_)
  43.          {
  44.             stage.quality = _loc1_;
  45.          }
  46.       }
  47.      
  48.       public static function setMaxStageQuality() : void
  49.       {
  50.          var _loc1_:* = null;
  51.          if(PlatformUtils.isMobileOS)
  52.          {
  53.             _loc1_ = "medium";
  54.          }
  55.          else
  56.          {
  57.             _loc1_ = "high";
  58.          }
  59.          if(stage.quality != _loc1_)
  60.          {
  61.             stage.quality = _loc1_;
  62.          }
  63.       }
  64.      
  65.       public static function determineAndSetDefaultBitmapQuality() : void
  66.       {
  67.          if(qualityLevel < 50)
  68.          {
  69.             defaultBitmapQuality = 0.5;
  70.          }
  71.          else if(qualityLevel < 60)
  72.          {
  73.             defaultBitmapQuality = 0.75;
  74.          }
  75.          else
  76.          {
  77.             defaultBitmapQuality = 1;
  78.          }
  79.          
  80.       }
  81.      
  82.       public static const QUALITY_LOWEST:int = 0;
  83.      
  84.       public static const QUALITY_LOWER:int = 20;
  85.      
  86.       public static const QUALITY_LOW:int = 40;
  87.      
  88.       public static const QUALITY_MEDIUM:int = 50;
  89.      
  90.       public static const QUALITY_HIGH:int = 60;
  91.      
  92.       public static const QUALITY_HIGHER:int = 80;
  93.      
  94.       public static const QUALITY_HIGHEST:int = 100;
  95.      
  96.       public static var qualityLevel:int = 0;
  97.      
  98.       public static var defaultBitmapQuality:Number = 1;
  99.      
  100.       public static var stage:Stage;
  101.      
  102.       public static var deviceCheck:IDeviceCheck;
  103.    }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement