various fallback script cleanup

This commit is contained in:
AJ Kelly
2012-03-24 00:13:25 -05:00
parent b69a985e6b
commit 9a26e009a2
4 changed files with 18 additions and 37 deletions
+6 -27
View File
@@ -1,15 +1,5 @@
--[[ command aliases ]]
-- (this probably belongs in Sprite.lua)
function Sprite:cropto(w,h)
self:CropTo(w,h)
end
-- (this probably belongs in Actor.lua)
function Actor:SetSize(w,h)
self:setsize(w,h)
end
-- shorthand! this is tedious to type and makes things ugly so let's make it shorter.
-- _screen.w, _screen.h, etc.
_screen = {
@@ -19,32 +9,21 @@ _screen = {
cy = SCREEN_CENTER_Y
}
-- Title & Action safe calculation, probably messy. Uses microsofts suggestion of 85% ( 7.5% per side )
function GetTitleSafeH( fPerc )
return math.floor( SCREEN_RIGHT * fPerc );
end
function GetTitleSafeV( fPerc )
return math.floor( SCREEN_BOTTOM * fPerc );
end
-- Title & Action area safe calculation, probably messy.
-- Uses Microsoft's suggestion of 85% of the screen (7.5% per side).
function GetTitleSafeH( fPerc ) return math.floor( SCREEN_RIGHT * fPerc ); end
function GetTitleSafeV( fPerc ) return math.floor( SCREEN_BOTTOM * fPerc ); end
SAFE_WIDTH = GetTitleSafeH(0.075);
SAFE_HEIGHT = GetTitleSafeV(0.075);
_safe = {
w = GetTitleSafeH(0.075);
h = GetTitleSafeV(0.075);
w = GetTitleSafeH(0.075);
h = GetTitleSafeV(0.075);
}
--[[ compatibility aliases ]]
--[[ Actor ]]
function Actor:hidden(bHide)
Warn("hidden is deprecated, use visible instead. (used on ".. self:GetName() ..")")
self:visible(not bHide)
end
--[[ ActorScroller: all of these got renamed, so alias the lowercase ones if
themes are going to look for them. ]]
ActorScroller.getsecondtodestination = ActorScroller.GetSecondsToDestination
+9
View File
@@ -371,6 +371,15 @@ function GetRealInverse()
return res/theme
end
-- command aliases:
function Actor:SetSize(w,h) self:setsize(w,h) end
-- deprecated aliases:
function Actor:hidden(bHide)
Warn("hidden is deprecated, use visible instead. (used on ".. self:GetName() ..")")
self:visible(not bHide)
end
-- (c) 2006-2011 Glenn Maynard, SSC
-- All rights reserved.
--
+3
View File
@@ -65,6 +65,9 @@ function Sprite.LinearFrames(NumFrames, Seconds)
return Frames
end
-- command aliases:
function Sprite:cropto(w,h) self:CropTo(w,h) end
-- (c) 2005 Glenn Maynard
-- All rights reserved.
--
-10
View File
@@ -334,16 +334,6 @@ function WideScale(AR4_3, AR16_9)
return scale( SCREEN_WIDTH, 640, 854, AR4_3, AR16_9 )
end
-- it turns out some people actually used this (mostly) worthless code:
AspectRatios = {
ThreeFour = 0.75, -- (576x760 at 1024x768)
OneOne = 1.0, -- 480x480 (uses Y)
FiveFour = 1.25, -- 600x480 (1280x1024 is a real use)
FourThree = 1.33333, --* 640x480
SixteenTen = 1.6, --* 720x480
SixteenNine = 1.77778, --* 853x480
EightThree = 2.66666, -- 1280x480
};
local function round(num, idp)
if idp and idp > 0 then