Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package game.util
- {
- import com.poptropica.AppConfig;
- import flash.display.Stage;
- import com.poptropica.platformSpecific.mobile.IDeviceCheck;
- public class PerformanceUtils extends Object
- {
- public function PerformanceUtils()
- {
- super();
- }
- public static function determineQualityLevel() : int
- {
- var _loc2_:* = null;
- var _loc1_:* = 100;
- if(PlatformUtils.isMobileOS && !(deviceCheck == null))
- {
- _loc1_ = deviceCheck.getDeviceLevel();
- }
- return _loc1_;
- }
- public static function determineAndSetVectorQuality() : void
- {
- var _loc1_:* = null;
- if(qualityLevel < 50 && !(AppConfig.platformType == "tablet") && !(AppConfig.platformType == "desktop"))
- {
- _loc1_ = "low";
- }
- else if(qualityLevel < 60 || (PlatformUtils.isMobileOS))
- {
- _loc1_ = "medium";
- }
- else
- {
- _loc1_ = "high";
- }
- if(stage.quality != _loc1_)
- {
- stage.quality = _loc1_;
- }
- }
- public static function setMaxStageQuality() : void
- {
- var _loc1_:* = null;
- if(PlatformUtils.isMobileOS)
- {
- _loc1_ = "medium";
- }
- else
- {
- _loc1_ = "high";
- }
- if(stage.quality != _loc1_)
- {
- stage.quality = _loc1_;
- }
- }
- public static function determineAndSetDefaultBitmapQuality() : void
- {
- if(qualityLevel < 50)
- {
- defaultBitmapQuality = 0.5;
- }
- else if(qualityLevel < 60)
- {
- defaultBitmapQuality = 0.75;
- }
- else
- {
- defaultBitmapQuality = 1;
- }
- }
- public static const QUALITY_LOWEST:int = 0;
- public static const QUALITY_LOWER:int = 20;
- public static const QUALITY_LOW:int = 40;
- public static const QUALITY_MEDIUM:int = 50;
- public static const QUALITY_HIGH:int = 60;
- public static const QUALITY_HIGHER:int = 80;
- public static const QUALITY_HIGHEST:int = 100;
- public static var qualityLevel:int = 0;
- public static var defaultBitmapQuality:Number = 1;
- public static var stage:Stage;
- public static var deviceCheck:IDeviceCheck;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement