From 5469c498f4144240e4bb2015c6f6aec7658bcadb Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 14 Jul 2010 14:48:07 -0500 Subject: [PATCH] 194936e: more general: stretch 4:3, not just 640x480 [Glenn Maynard] --- Themes/_fallback/Scripts/02 Actor.lua | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/Themes/_fallback/Scripts/02 Actor.lua b/Themes/_fallback/Scripts/02 Actor.lua index 68e3decaa2..5d0af89602 100644 --- a/Themes/_fallback/Scripts/02 Actor.lua +++ b/Themes/_fallback/Scripts/02 Actor.lua @@ -118,25 +118,13 @@ end 640x480 - most simfiles in distribution today are this big. 768x480 - 16:10 aspect ratio backgrounds 854x480 - pump it up pro - -This function will stretch any background up to 640x480]] +]] +-- "Most backgrounds are 640x480. Some are 768x480. Stretch the 4:3 ones." function Actor:scale_or_crop_background() - --local bgAspectRatio = self:GetWidth() / self:GetHeight(); - if self:GetWidth() <= 640 and self:GetHeight() <= 480 then - self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ) + if (self:GetWidth() * 3) / 4 == self:GetHeight() then + self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ); else - self:scaletocover( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ) - end -end --- Testing -function Actor:scale_or_crop_alternative() - if self:GetWidth() and self:GetHeight() then - local fRatio = self:GetWidth() / self:GetHeight() - if fRatio == 4/3 then - self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ) - else - self:scaletocover( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ) - end + self:scaletocover( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ); end end