various theme changes, mostly from midi

removes duplicate round() function in productivityhelpers
This commit is contained in:
AJ Kelly
2010-08-14 19:22:44 -05:00
parent 5175499e08
commit ccd2b4ae6d
6 changed files with 54 additions and 52 deletions
+3 -3
View File
@@ -32,11 +32,11 @@ function ScreenSelectMusic:setupmusicstagemods()
local song, steps = SONGMAN:GetExtraStageInfo( bExtra2, style )
local po, so
if bExtra2 then
po = THEME:GetMetric("SongManager","ExtraStagePlayerModifiers");
so = THEME:GetMetric("SongManager","ExtraStageStageModifiers");
else
po = THEME:GetMetric("SongManager","OMESPlayerModifiers");
so = THEME:GetMetric("SongManager","OMESStageModifiers");
else
po = THEME:GetMetric("SongManager","ExtraStagePlayerModifiers");
so = THEME:GetMetric("SongManager","ExtraStageStageModifiers");
end
local difficulty = steps:GetDifficulty()
local Reverse = PlayerNumber:Reverse()
@@ -11,8 +11,8 @@ end
function IsHome()
local sPayMode = GAMESTATE:GetCoinMode();
local bIsArcade = (sPayMode == 'CoinMode_Home');
return bIsArcade;
local bIsHome = (sPayMode == 'CoinMode_Home');
return bIsHome;
end
function IsFreePlay()
@@ -51,30 +51,6 @@ Health = {
uglyfying my code just to handle rare cases). -shake
--]]
function Actor:Real()
-- normal
local theme = THEME:GetMetric("Common","ScreenHeight")
local res = PREFSMAN:GetPreference("DisplayHeight")
-- scale back down to real pixels.
self:basezoom(theme/res)
-- don't make this ugly
self:SetTextureFiltering(false)
end
-- Scale things back up after they have already been scaled down.
function Actor:RealInverse()
-- normal
local theme = THEME:GetMetric("Common","ScreenHeight")
local res = PREFSMAN:GetPreference("DisplayHeight")
-- scale back up to theme resolution
self:basezoom(res/theme)
self:SetTextureFiltering(true)
end
-- useful
function GetReal()
local theme = THEME:GetMetric("Common","ScreenHeight")
@@ -88,6 +64,20 @@ function GetRealInverse()
return res/theme
end
function Actor:Real()
-- scale back down to real pixels.
self:basezoom(GetReal())
-- don't make this ugly
self:SetTextureFiltering(false)
end
-- Scale things back up after they have already been scaled down.
function Actor:RealInverse()
-- scale back up to theme resolution
self:basezoom(GetRealInverse())
self:SetTextureFiltering(true)
end
--[[ Actor commands ]]
function Actor:CenterX()
self:x(SCREEN_CENTER_X)
@@ -204,10 +194,5 @@ function pname(pn)
return ToEnumShortString(pn)
end
-- from http://ardoris.wordpress.com/2008/11/07/rounding-to-a-certain-number-of-decimal-places-in-lua/
function round(what, precision)
return math.floor(what*math.pow(10,precision)+0.5) / math.pow(10,precision)
end
--[[ end helper functions ]]
-- this code is in the public domain.