Changed BackgroundEffects files to apply the playback rate to videos. Added GetUpdateRate to ActorFrame and Get/SetDecodeMovie to Sprite. Hope nobody is caught off guard by checkerboard no longer playing videos back at 4x rate.

This commit is contained in:
Kyzentun
2015-02-05 00:37:08 -07:00
parent 72aa6c6164
commit ad877b6dcb
29 changed files with 263 additions and 41 deletions
+7 -1
View File
@@ -2,7 +2,13 @@ local Color1 = color(Var "Color1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffuse,Color1;effectclock,"music");
OnCommand= function(self)
self:xy(_screen.cx, _screen.cy):diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+20 -4
View File
@@ -1,16 +1,32 @@
local Color1 = color(Var "Color1");
local a = LoadActor(Var "File1") .. {
OnCommand=cmd(cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color1;effectclock,"music");
OnCommand= function(self)
self:cropto(_screen.w/2, _screen.h/2):diffuse(Color1)
:effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
local t = Def.ActorFrame {
a .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=function(self)
self:x(scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
a .. { OnCommand=function(self)
self:x(scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
a .. { OnCommand=function(self)
self:x(scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
};
return t;
+23 -4
View File
@@ -2,12 +2,25 @@ local Color1 = color(Var "Color1");
local Color2 = color(Var "Color2");
local a1 = LoadActor(Var "File1") .. {
OnCommand=cmd(cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color1;effectclock,"music");
OnCommand= function(self)
self:cropto(SCREEN_WIDTH/2,SCREEN_HEIGHT/2):diffuse(Color1)
:effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
local a2 = LoadActor(Var "File2") .. {
OnCommand=cmd(cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color2;effectclock,"music");
OnCommand= function(self)
self:cropto(SCREEN_WIDTH/2,SCREEN_HEIGHT/2):diffuse(Color2):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
@@ -15,8 +28,14 @@ local a2 = LoadActor(Var "File2") .. {
local t = Def.ActorFrame {
a1 .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a2 .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a2 .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a1 .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a2 .. { OnCommand=function(self)
self:x(scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
a1 .. { OnCommand=function(self)
self:x(scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
};
return t;
+12 -4
View File
@@ -3,10 +3,18 @@ local Color2 = color(Var "Color2");
-- Alternating files being played back at once
local t = Def.ActorFrame {
LoadActor(Var "File1") .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM);cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color1;rate,0.25) };
LoadActor(Var "File2") .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM);cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color2;rate,0.25) };
LoadActor(Var "File2") .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM);cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color1;rate,0.25) };
LoadActor(Var "File1") .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM);cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color2;rate,0.25) };
LoadActor(Var "File1") .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM);cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color1) };
LoadActor(Var "File2") .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM);cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color2) };
LoadActor(Var "File2") .. {
OnCommand=function(self)
self:x(scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)):cropto(SCREEN_WIDTH/2,SCREEN_HEIGHT/2):diffuse(Color1)
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
LoadActor(Var "File1") .. {
OnCommand=function(self)
self:x(scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)):cropto(SCREEN_WIDTH/2,SCREEN_HEIGHT/2):diffuse(Color2)
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
};
return t
+14 -2
View File
@@ -4,14 +4,26 @@ local Color2 = color(Var "Color2");
local t = Def.ActorFrame {};
t[#t+1] = LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
if Var("File2") ~= nil then
t[#t+1] = LoadActor(Var("File2")) .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color2;effectclock,"music";linear,1;diffusealpha,0);
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color2):effectclock("music"):linear(1):diffusealpha(0)
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+14 -2
View File
@@ -4,14 +4,26 @@ local Color2 = color(Var "Color2");
local t = Def.ActorFrame {};
t[#t+1] = LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
if Var("File2") ~= nil then
t[#t+1] = LoadActor(Var("File2")) .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+19 -4
View File
@@ -1,16 +1,31 @@
local Color1 = color(Var "Color1");
local a = LoadActor(Var "File1") .. {
OnCommand=cmd(cropto,SCREEN_WIDTH/2,SCREEN_HEIGHT/2;diffuse,Color1;zoomx,self:GetZoomX()*-1;zoomy,self:GetZoomY()*-1;effectclock,"music");
OnCommand= function(self)
self:cropto(SCREEN_WIDTH/2,SCREEN_HEIGHT/2):diffuse(Color1):zoomx(self:GetZoomX()*-1):zoomy(self:GetZoomY()*-1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
local t = Def.ActorFrame {
a .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a .. { OnCommand=function(self)
self:x(scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
a .. { OnCommand=function(self)
self:x(scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
a .. { OnCommand=function(self)
self:x(scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
};
return t;
+11 -1
View File
@@ -9,11 +9,21 @@ local t = Def.ActorFrame {
self:scale_or_crop_background();
self:diffuse(Color1)
self:effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end;
};
LoadActor(Var "File1") .. {
OnCommand=cmd(blend,"BlendMode_Add";x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color2;effectclock,"music");
OnCommand=function(self)
self:blend("BlendMode_Add"):x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color2):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end;
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+8 -1
View File
@@ -6,7 +6,14 @@ local t = Def.ActorFrame {
self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y)
self:scale_or_crop_background()
self:diffuse(Color1)
if self.loop ~= nil then
-- The playback rate in the simfile is used to set the update rate
-- on the ActorFrame, but effectclock("music") causes the sprite to
-- ignore the passed in delta time and use the music time instead.
-- So this passes the update rate in to the texture. -Kyz
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
if self.loop then
self:loop(false)
-- make videos start at beginning to prevent sticking on last frame
self:position(0)
+4
View File
@@ -7,6 +7,10 @@ local t = Def.ActorFrame {
self:scale_or_crop_background();
self:diffuse(Color1)
self:effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end;
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
+7 -1
View File
@@ -3,7 +3,13 @@ local Color1 = color(Var "Color1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+7 -1
View File
@@ -3,7 +3,13 @@ local Color1 = color("0,0,1,1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+7 -1
View File
@@ -3,7 +3,13 @@ local Color1 = color("0,1,0,1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+7 -1
View File
@@ -3,7 +3,13 @@ local Color1 = color("1,0,0,1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+7 -1
View File
@@ -2,7 +2,13 @@ local Color1 = color(Var "Color1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;pause;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):pause():effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+4
View File
@@ -10,6 +10,10 @@ local t = Def.ActorFrame {
self:position(0)
end
self:effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end;
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
+7 -1
View File
@@ -3,7 +3,13 @@ local Color1 = color(Var "Color1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+14 -2
View File
@@ -3,13 +3,25 @@ local Color2 = color(Var "Color2");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
LoadActor(Var "File2") .. {
OnCommand=cmd(blend,"BlendMode_Add";x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color2;effectclock,"music");
OnCommand=function(self)
self:blend("BlendMode_Add"):x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scaletoclipped(SCREEN_WIDTH,SCREEN_HEIGHT):diffuse(Color2):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+16 -4
View File
@@ -4,14 +4,26 @@ local Color2 = color(Var "Color2");
local t = Def.ActorFrame {};
t[#t+1] = LoadActor(Var "File1") .. {
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;effectclock,"music");
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
OnCommand=function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color1):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
if Var("File2") ~= nil then
t[#t+1] = LoadActor(Var("File2")) .. {
OnCommand=cmd(blend,"BlendMode_Add";x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color2;effectclock,"music";linear,1;diffusealpha,0);
OnCommand=function(self)
self:blend("BlendMode_Add"):x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y):scale_or_crop_background():diffuse(Color2):effectclock("music"):linear(1):diffusealpha(0)
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
+10 -1
View File
@@ -4,9 +4,18 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes
from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt.
________________________________________________________________________________
2015/02/04
----------
* [ActorFrame] GetUpdateRate added. [kyzentun]
* [Background] Using the wrong transition name no longer crashes.
Playback rate is applied to videos.
Checkerboard and other BackgroundEffects that use the same file twice no
longer play videos back at multiplied speed. [kyzentun]
* [Sprite] Get/SetDecodeMovie added. [kyzentun]
2015/02/02
----------
* [ActorMultiVertex] ForceStateUpdate and SetDecodeMovie added. [kyzentun]
* [ActorMultiVertex] ForceStateUpdate and Get/SetDecodeMovie added. [kyzentun]
* [RageTexture] Get<thing>Width and Height functions added.
(<thing> means Source, Texture, or Image) [kyzentun]
* [Scripts] find_missing_strings_in_theme_translations function added to
+4
View File
@@ -454,6 +454,7 @@
<Function name='GetChildren'/>
<Function name='GetDrawFunction'/>
<Function name='GetNumChildren'/>
<Function name='GetUpdateRate'/>
<Function name='RemoveAllChildren'/>
<Function name='RemoveChild'/>
<Function name='RunCommandsOnChildren'/>
@@ -499,6 +500,7 @@
<Function name='GetCurrDrawMode'/>
<Function name='GetCurrFirstToDraw'/>
<Function name='GetCurrNumToDraw'/>
<Function name='GetDecodeMovie'/>
<Function name='GetDestDrawMode'/>
<Function name='GetDestFirstToDraw'/>
<Function name='GetDestNumToDraw'/>
@@ -592,6 +594,7 @@
<Function name='SetFromSteps'/>
</Class>
<Class base='Sprite' name='Banner'>
<Function name='GetDecodeMovie'/>
<Function name='GetPercentScrolling'/>
<Function name='GetScrolling'/>
<Function name='LoadBackgroundFromUnlockEntry'/>
@@ -604,6 +607,7 @@
<Function name='LoadFromSortOrder'/>
<Function name='LoadIconFromCharacter'/>
<Function name='ScaleToClipped'/>
<Function name='SetDecodeMovie'/>
<Function name='SetScrolling'/>
<Function name='scaletoclipped'/>
</Class>
+12
View File
@@ -1429,6 +1429,9 @@ save yourself some time, copy this for undocumented things:
<Function name='GetNumChildren' return='int' arguments=''>
Returns the number of children in the ActorFrame.
</Function>
<Function name='GetUpdateRate' return='float' arguments=''>
Gets the update function's rate.
</Function>
<Function name='playcommandonchildren' return='void' arguments='string sCommandName'>
Plays the <code>sCommandName</code> command on the ActorFrame's children.
</Function>
@@ -1561,6 +1564,9 @@ save yourself some time, copy this for undocumented things:
<Function name='GetState' return= 'int' arguments=''>
Returns the id of the current state.
</Function>
<Function name='GetDecodeMovie' return='bool' arguments=''>
Gets whether the AMV should call the decode function for its texture during updates.
</Function>
<Function name='SetDecodeMovie' return='' arguments='bool decode'>
Sets whether the AMV should call the decode function for its texture during updates.
</Function>
@@ -4753,6 +4759,9 @@ save yourself some time, copy this for undocumented things:
<Function name='GetAnimationLengthSeconds' return='float' arguments=''>
Returns the length of the animation in seconds.
</Function>
<Function name='GetDecodeMovie' return='bool' arguments=''>
Gets whether the Sprite should call the decode function for its texture during updates.
</Function>
<Function name='GetNumStates' return='int' arguments=''>
Return the number of states this Sprite has.
</Function>
@@ -4793,6 +4802,9 @@ save yourself some time, copy this for undocumented things:
<Function name='StopUsingCustomPosCoords' return='void' arguments=''>
Turns off the custom pos coords for the sprite.
</Function>
<Function name='SetDecodeMovie' return='' arguments='bool decode'>
Sets whether the Sprite should call the decode function for its texture during updates.
</Function>
<Function name='SetEffectMode' return='void' arguments='EffectMode mode'>
Set the <Link class='ENUM' function='EffectMode' /> to <code>mode</code>.
</Function>
+1
View File
@@ -609,6 +609,7 @@ public:
virtual float GetAnimationLengthSeconds() const { return 0; }
virtual void SetSecondsIntoAnimation( float ) {}
virtual void SetUpdateRate( float ) {}
virtual float GetUpdateRate() { return 1.0f; }
HiddenPtr<LuaClass> m_pLuaInstance;
+2
View File
@@ -625,6 +625,7 @@ public:
static int propagate( T* p, lua_State *L ) { p->SetPropagateCommands( BIArg(1) ); COMMON_RETURN_SELF; }
static int fov( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
static int SetUpdateRate( T* p, lua_State *L ) { p->SetUpdateRate( FArg(1) ); COMMON_RETURN_SELF; }
DEFINE_METHOD(GetUpdateRate, GetUpdateRate());
static int SetFOV( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
static int vanishpoint( T* p, lua_State *L ) { p->SetVanishPoint( FArg(1), FArg(2) ); COMMON_RETURN_SELF; }
static int GetChild( T* p, lua_State *L )
@@ -738,6 +739,7 @@ public:
ADD_METHOD( propagate ); // deprecated
ADD_METHOD( fov );
ADD_METHOD( SetUpdateRate );
ADD_METHOD( GetUpdateRate );
ADD_METHOD( SetFOV );
ADD_METHOD( vanishpoint );
ADD_METHOD( GetChild );
+1
View File
@@ -76,6 +76,7 @@ public:
virtual void HurryTweening( float factor );
void SetUpdateRate( float fUpdateRate ) { m_fUpdateRate = fUpdateRate; }
float GetUpdateRate() { return m_fUpdateRate; }
void SetFOV( float fFOV ) { m_fFOV = fFOV; }
void SetVanishPoint( float fX, float fY) { m_fVanishX = fX; m_fVanishY = fY; }
+2
View File
@@ -1114,6 +1114,7 @@ public:
p->UpdateAnimationState(true);
COMMON_RETURN_SELF;
}
DEFINE_METHOD(GetDecodeMovie, _decode_movie);
static int SetDecodeMovie(T* p, lua_State *L)
{
p->_decode_movie= BArg(1);
@@ -1182,6 +1183,7 @@ public:
ADD_METHOD(GetQuadState);
ADD_METHOD(SetQuadState);
ADD_METHOD(ForceStateUpdate);
ADD_METHOD(GetDecodeMovie);
ADD_METHOD(SetDecodeMovie);
// Copy from RageTexture
+10 -4
View File
@@ -765,10 +765,16 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( !change.m_sTransition.empty() )
{
map<RString,BackgroundTransition>::const_iterator lIter = mapNameToTransition.find( change.m_sTransition );
ASSERT( lIter != mapNameToTransition.end() );
const BackgroundTransition &bt = lIter->second;
m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves );
m_pFadingBGA->RunCommands( *bt.cmdRoot );
if(lIter == mapNameToTransition.end())
{
LuaHelpers::ReportScriptErrorFmt("'%s' is not the name of a BackgroundTransition file.", change.m_sTransition.c_str());
}
else
{
const BackgroundTransition &bt = lIter->second;
m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves );
m_pFadingBGA->RunCommands( *bt.cmdRoot );
}
}
}
}
+11 -1
View File
@@ -26,6 +26,7 @@ Sprite::Sprite()
m_bUsingCustomTexCoords = false;
m_bUsingCustomPosCoords = false;
m_bSkipNextUpdate = true;
m_DecodeMovie= true;
m_EffectMode = EffectMode_Normal;
m_fRememberedClipWidth = -1;
@@ -62,6 +63,7 @@ Sprite::Sprite( const Sprite &cpy ):
CPY( m_bUsingCustomTexCoords );
CPY( m_bUsingCustomPosCoords );
CPY( m_bSkipNextUpdate );
CPY( m_DecodeMovie );
CPY( m_EffectMode );
memcpy( m_CustomTexCoords, cpy.m_CustomTexCoords, sizeof(m_CustomTexCoords) );
memcpy( m_CustomPosCoords, cpy.m_CustomPosCoords, sizeof(m_CustomPosCoords) );
@@ -408,7 +410,7 @@ void Sprite::Update( float fDelta )
UpdateAnimationState();
// If the texture is a movie, decode frames.
if( !bSkipThisMovieUpdate )
if(!bSkipThisMovieUpdate && m_DecodeMovie)
m_pTexture->DecodeSeconds( max(0, fTimePassed) );
// update scrolling
@@ -1210,6 +1212,12 @@ public:
p->SetAllStateDelays(FArg(-1));
COMMON_RETURN_SELF;
}
DEFINE_METHOD(GetDecodeMovie, m_DecodeMovie);
static int SetDecodeMovie(T* p, lua_State *L)
{
p->m_DecodeMovie= BArg(1);
COMMON_RETURN_SELF;
}
LunaSprite()
{
@@ -1235,6 +1243,8 @@ public:
ADD_METHOD( SetEffectMode );
ADD_METHOD( GetNumStates );
ADD_METHOD( SetAllStateDelays );
ADD_METHOD(GetDecodeMovie);
ADD_METHOD(SetDecodeMovie);
}
};
+2
View File
@@ -90,6 +90,8 @@ public:
void SetAllStateDelays(float fDelay);
bool m_DecodeMovie;
protected:
void LoadFromTexture( RageTextureID ID );