Merged changelog.

This commit is contained in:
Kyzentun
2014-12-08 16:08:49 -07:00
62 changed files with 552 additions and 468 deletions
+5
View File
@@ -26,6 +26,11 @@ ________________________________________________________________________________
GetType and GetPriority lua functions added to Profile. GetType and GetPriority lua functions added to Profile.
Bug that caused a crash when a profile dir was renamed to a non-number and Bug that caused a crash when a profile dir was renamed to a non-number and
a new profile was created fixed. [kyzentun] a new profile was created fixed. [kyzentun]
* [Everything] Actor and singleton functions that formerly returned nothing now
return the actor or singleton. Example (set zoom, x, y, and diffuse in one):
self:zoom(.5):xy(_screen.cx, _screen.h-60):diffuse(color("#dc322f"))
This also works for PlayerOptions and SongOptions API functions. Pass true
as an extra arg, and they can be chained.
2014/11/22 2014/11/22
---------- ----------
+8 -1
View File
@@ -3041,6 +3041,13 @@ save yourself some time, copy this for undocumented things:
</Class> </Class>
<Class name='PlayerOptions'> <Class name='PlayerOptions'>
<Description> <Description>
All these functions have an optional last argument: If the last argument is the boolean value true, then instead of returning the previous settings as normal, they will instead return the PlayerOptions object.<br />
This allows you to chain them like this:<br />
player_options:Twirl(5, 1, true):Roll(5, true):Dizzy(true):Twirl()<br />
<br />
Special note: Functions that take a bool as their arg must have true as the second arg to be used with chaining.<br />
"player_options:Backwards(true, true):Beat(5)" will chain, "player_options:Backwards(true):Beat(5)" will not chain.<br />
<br />
Most options fall into one of four types: float, int, bool, or enum.<br /> Most options fall into one of four types: float, int, bool, or enum.<br />
Float type options have this interface:<br /> Float type options have this interface:<br />
Option(value, approach_speed)<br /> Option(value, approach_speed)<br />
@@ -3160,7 +3167,7 @@ save yourself some time, copy this for undocumented things:
Changing the noteskin during a song is not supported.<br /> Changing the noteskin during a song is not supported.<br />
Example:<br /> Example:<br />
note_name= options:NoteSkin() -- Sets note_name to the player's current noteskin.<br /> note_name= options:NoteSkin() -- Sets note_name to the player's current noteskin.<br />
prev_note_name, succeeded= options:NoteSkin("cel") -- Sets prev_note_name to the noteskin the player had set, changes the current noteskin to "cel", sets succeeded to true if the the "cel" noteskin exists.<br /> prev_note_name, succeeded= options:NoteSkin("cel") -- Sets prev_note_name to the noteskin the player had set, changes the current noteskin to "cel", sets succeeded to true if the "cel" noteskin exists.<br />
</Function> </Function>
<Function name='Overhead' return='bool' arguments='bool'> <Function name='Overhead' return='bool' arguments='bool'>
If the player is using Overhead (0 tilt, 0 skew), returns true.<br /> If the player is using Overhead (0 tilt, 0 skew), returns true.<br />
+35 -7
View File
@@ -11,19 +11,19 @@ function Actor:ease(t, fEase)
-- fEase = -100 is equivalent to TweenType_Accelerate. -- fEase = -100 is equivalent to TweenType_Accelerate.
if fEase == -100 then if fEase == -100 then
self:accelerate(t) self:accelerate(t)
return return self
end end
-- fEase = 0 is equivalent to TweenType_Linear. -- fEase = 0 is equivalent to TweenType_Linear.
if fEase == 0 then if fEase == 0 then
self:linear(t) self:linear(t)
return return self
end end
-- fEase = +100 is equivalent to TweenType_Decelerate. -- fEase = +100 is equivalent to TweenType_Decelerate.
if fEase == 100 then if fEase == 100 then
self:decelerate(t) self:decelerate(t)
return return self
end end
self:tween( t, "TweenType_Bezier", self:tween( t, "TweenType_Bezier",
@@ -34,6 +34,7 @@ function Actor:ease(t, fEase)
1 1
} }
) )
return self
end end
-- Notes On Beziers -- -- Notes On Beziers --
-- They can be 1D ( Quadratic ) or 2D ( Bezier ) -- They can be 1D ( Quadratic ) or 2D ( Bezier )
@@ -52,6 +53,7 @@ local BounceBeginBezier =
} }
function Actor:bouncebegin(t) function Actor:bouncebegin(t)
self:tween( t, "TweenType_Bezier", BounceBeginBezier ) self:tween( t, "TweenType_Bezier", BounceBeginBezier )
return self
end end
local BounceEndBezier = local BounceEndBezier =
@@ -63,6 +65,7 @@ local BounceEndBezier =
} }
function Actor:bounceend(t) function Actor:bounceend(t)
self:tween( t, "TweenType_Bezier", BounceEndBezier ) self:tween( t, "TweenType_Bezier", BounceEndBezier )
return self
end end
local SmoothBezier = local SmoothBezier =
@@ -71,6 +74,7 @@ local SmoothBezier =
} }
function Actor:smooth(t) function Actor:smooth(t)
self:tween( t, "TweenType_Bezier", SmoothBezier ) self:tween( t, "TweenType_Bezier", SmoothBezier )
return self
end end
-- SSC Additions -- SSC Additions
local DropBezier = local DropBezier =
@@ -82,6 +86,7 @@ local DropBezier =
} }
function Actor:drop(t) function Actor:drop(t)
self:tween( t, "TweenType_Bezier", DropBezier ) self:tween( t, "TweenType_Bezier", DropBezier )
return self
end end
-- compound tweens "combine multiple interpolators to allow generating more -- compound tweens "combine multiple interpolators to allow generating more
@@ -119,6 +124,7 @@ function Actor:compound(length,...)
-- todo: handle using tween and 'TweenType_Bezier' -- todo: handle using tween and 'TweenType_Bezier'
end end
end end
return self
end end
-- Hide if b is true, but don't unhide if b is false. -- Hide if b is true, but don't unhide if b is false.
@@ -126,16 +132,19 @@ function Actor:hide_if(b)
if b then if b then
self:visible(false) self:visible(false)
end end
return self
end end
function Actor:player(p) function Actor:player(p)
self:visible( GAMESTATE:IsHumanPlayer(p) ) self:visible( GAMESTATE:IsHumanPlayer(p) )
return self
end end
function ActorFrame:propagatecommand(...) function ActorFrame:propagatecommand(...)
self:propagate(1) self:propagate(1)
self:playcommand(...) self:playcommand(...)
self:propagate(0) self:propagate(0)
return self
end end
-- Shortcut for alignment. -- Shortcut for alignment.
@@ -145,10 +154,12 @@ end
function Actor:align(h, v) function Actor:align(h, v)
self:halign( h ) self:halign( h )
self:valign( v ) self:valign( v )
return self
end end
function Actor:FullScreen() function Actor:FullScreen()
self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ) self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT )
return self
end end
bg_fit_functions= { bg_fit_functions= {
@@ -185,16 +196,18 @@ function Actor:scale_or_crop_background_no_move()
else else
self:scaletocover(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) self:scaletocover(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)
end end
return self
end end
function Actor:scale_or_crop_background() function Actor:scale_or_crop_background()
self:scale_or_crop_background_no_move() self:scale_or_crop_background_no_move()
self:xy(SCREEN_CENTER_X, SCREEN_CENTER_Y) self:xy(SCREEN_CENTER_X, SCREEN_CENTER_Y)
return self
end end
function Actor:CenterX() self:x(SCREEN_CENTER_X) end function Actor:CenterX() self:x(SCREEN_CENTER_X) return self end
function Actor:CenterY() self:y(SCREEN_CENTER_Y) end function Actor:CenterY() self:y(SCREEN_CENTER_Y) return self end
function Actor:Center() self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y) end function Actor:Center() self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y) return self end
function Actor:bezier(...) function Actor:bezier(...)
local a = {...} local a = {...}
@@ -205,6 +218,7 @@ function Actor:bezier(...)
b[#b+1] = a[i] b[#b+1] = a[i]
end end
self:tween(a[2], "TweenMode_Bezier", b) self:tween(a[2], "TweenMode_Bezier", b)
return self
end end
function Actor:Real() function Actor:Real()
@@ -212,6 +226,7 @@ function Actor:Real()
self:basezoom(GetReal()) self:basezoom(GetReal())
-- don't make this ugly -- don't make this ugly
self:SetTextureFiltering(false) self:SetTextureFiltering(false)
return self
end end
-- Scale things back up after they have already been scaled down. -- Scale things back up after they have already been scaled down.
@@ -219,6 +234,7 @@ function Actor:RealInverse()
-- scale back up to theme resolution -- scale back up to theme resolution
self:basezoom(GetRealInverse()) self:basezoom(GetRealInverse())
self:SetTextureFiltering(true) self:SetTextureFiltering(true)
return self
end end
-- MaskSource([clearzbuffer]) -- MaskSource([clearzbuffer])
@@ -229,12 +245,14 @@ function Actor:MaskSource(noclear)
end end
self:zwrite(true) self:zwrite(true)
self:blend('BlendMode_NoEffect') self:blend('BlendMode_NoEffect')
return self
end end
-- MaskDest() -- MaskDest()
-- Sets an actor up to be masked by anything with MaskSource(). -- Sets an actor up to be masked by anything with MaskSource().
function Actor:MaskDest() function Actor:MaskDest()
self:ztest(true) self:ztest(true)
return self
end end
-- Thump() -- Thump()
@@ -249,6 +267,7 @@ function Actor:thump(fEffectPeriod)
end end
-- The default effectmagnitude will make this effect look very bad. -- The default effectmagnitude will make this effect look very bad.
self:effectmagnitude(1,1.125,1) self:effectmagnitude(1,1.125,1)
return self
end end
-- Heartbeat() -- Heartbeat()
@@ -262,6 +281,7 @@ function Actor:heartbeat(fEffectPeriod)
self:effecttiming(0,0.125,0.125,0.75); self:effecttiming(0,0.125,0.125,0.75);
end end
self:effecmagnitude(1,1.125,1) self:effecmagnitude(1,1.125,1)
return self
end end
--[[ BitmapText commands ]] --[[ BitmapText commands ]]
@@ -271,24 +291,28 @@ end
-- Named because it works best with pixel fonts. -- Named because it works best with pixel fonts.
function BitmapText:PixelFont() function BitmapText:PixelFont()
self:SetTextureFiltering(false) self:SetTextureFiltering(false)
return self
end end
-- Stroke(color) -- Stroke(color)
-- Sets the text's stroke color. -- Sets the text's stroke color.
function BitmapText:Stroke(c) function BitmapText:Stroke(c)
self:strokecolor( c ) self:strokecolor( c )
return self
end end
-- NoStroke() -- NoStroke()
-- Removes any stroke. -- Removes any stroke.
function BitmapText:NoStroke() function BitmapText:NoStroke()
self:strokecolor( color("0,0,0,0") ) self:strokecolor( color("0,0,0,0") )
return self
end end
-- Set Text With Format (contributed by Daisuke Master) -- Set Text With Format (contributed by Daisuke Master)
-- this function is my hero - shake -- this function is my hero - shake
function BitmapText:settextf(...) function BitmapText:settextf(...)
self:settext(string.format(...)) self:settext(string.format(...))
return self
end end
-- DiffuseAndStroke(diffuse,stroke) -- DiffuseAndStroke(diffuse,stroke)
@@ -296,6 +320,7 @@ end
function BitmapText:DiffuseAndStroke(diffuseC,strokeC) function BitmapText:DiffuseAndStroke(diffuseC,strokeC)
self:diffuse(diffuseC) self:diffuse(diffuseC)
self:strokecolor(strokeC) self:strokecolor(strokeC)
return self
end; end;
--[[ end BitmapText commands ]] --[[ end BitmapText commands ]]
@@ -345,6 +370,7 @@ function Actor:LyricCommand(side)
self:sleep( Var "LyricDuration" * 0.25 ) self:sleep( Var "LyricDuration" * 0.25 )
self:linear(0.2) self:linear(0.2)
self:diffusealpha(0) self:diffusealpha(0)
return self
end end
-- formerly in 02 HelpDisplay.lua, although nothing uses it: -- formerly in 02 HelpDisplay.lua, although nothing uses it:
@@ -362,6 +388,7 @@ function HelpDisplay:setfromsongorcourse()
end end
self:settips( Artists, AltArtists ) self:settips( Artists, AltArtists )
return self
end end
-- Play the sound on the given player's side. Must set SupportPan = true -- Play the sound on the given player's side. Must set SupportPan = true
@@ -370,6 +397,7 @@ function ActorSound:playforplayer(pn)
local fBalance = SOUND:GetPlayerBalance(pn) local fBalance = SOUND:GetPlayerBalance(pn)
self:get():SetProperty("Pan", fBalance) self:get():SetProperty("Pan", fBalance)
self:play() self:play()
return self
end end
function PositionPerPlayer(player, p1X, p2X) function PositionPerPlayer(player, p1X, p2X)
@@ -392,7 +420,7 @@ function GetRealInverse()
end end
-- command aliases: -- command aliases:
function Actor:SetSize(w,h) self:setsize(w,h) end function Actor:SetSize(w,h) self:setsize(w,h) return self end
-- Simple draworder mappings -- Simple draworder mappings
DrawOrder = { DrawOrder = {
+8 -2
View File
@@ -9,6 +9,7 @@ function Sprite:LoadFromSongBanner(song)
else else
self:LoadBanner( THEME:GetPathG("Common","fallback banner") ) self:LoadBanner( THEME:GetPathG("Common","fallback banner") )
end end
return self
end end
function Sprite:LoadFromSongBackground(song) function Sprite:LoadFromSongBackground(song)
@@ -18,6 +19,7 @@ function Sprite:LoadFromSongBackground(song)
end end
self:LoadBackground( Path ) self:LoadBackground( Path )
return self
end end
function LoadSongBackground() function LoadSongBackground()
@@ -37,21 +39,25 @@ function Sprite:LoadFromCurrentSongBackground()
end end
end end
if not song then return end if not song then return self end
self:LoadFromSongBackground(song) self:LoadFromSongBackground(song)
return self
end end
function Sprite:position( f ) function Sprite:position( f )
self:GetTexture():position( f ) self:GetTexture():position( f )
return self
end end
function Sprite:loop( f ) function Sprite:loop( f )
self:GetTexture():loop( f ) self:GetTexture():loop( f )
return self
end end
function Sprite:rate( f ) function Sprite:rate( f )
self:GetTexture():rate( f ) self:GetTexture():rate( f )
return self
end end
function Sprite.LinearFrames(NumFrames, Seconds) function Sprite.LinearFrames(NumFrames, Seconds)
@@ -66,7 +72,7 @@ function Sprite.LinearFrames(NumFrames, Seconds)
end end
-- command aliases: -- command aliases:
function Sprite:cropto(w,h) self:CropTo(w,h) end function Sprite:cropto(w,h) self:CropTo(w,h) return self end
-- (c) 2005 Glenn Maynard -- (c) 2005 Glenn Maynard
-- All rights reserved. -- All rights reserved.
@@ -52,6 +52,7 @@ function ScreenSelectMusic:setupmusicstagemods()
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so ) GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
MESSAGEMAN:Broadcast( "SongOptionsChanged" ) MESSAGEMAN:Broadcast( "SongOptionsChanged" )
end end
return self
end end
function ScreenSelectMusic:setupcoursestagemods() function ScreenSelectMusic:setupcoursestagemods()
@@ -72,6 +73,7 @@ function ScreenSelectMusic:setupcoursestagemods()
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so ) GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
MESSAGEMAN:Broadcast( "SongOptionsChanged" ) MESSAGEMAN:Broadcast( "SongOptionsChanged" )
end end
return self
end end
-- (c) 2006-2007 Steve Checkoway -- (c) 2006-2007 Steve Checkoway
+133 -133
View File
@@ -1402,17 +1402,17 @@ Actor::TweenInfo &Actor::TweenInfo::operator=( const TweenInfo &rhs )
class LunaActor : public Luna<Actor> class LunaActor : public Luna<Actor>
{ {
public: public:
static int name( T* p, lua_State *L ) { p->SetName(SArg(1)); return 0; } static int name( T* p, lua_State *L ) { p->SetName(SArg(1)); COMMON_RETURN_SELF; }
static int sleep( T* p, lua_State *L ) static int sleep( T* p, lua_State *L )
{ {
float fTime = FArg(1); float fTime = FArg(1);
if (fTime < 0) if (fTime < 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Lua: sleep(%f): time must not be negative", fTime); LuaHelpers::ReportScriptErrorFmt("Lua: sleep(%f): time must not be negative", fTime);
return 0; COMMON_RETURN_SELF;
} }
p->Sleep(fTime); p->Sleep(fTime);
return 0; COMMON_RETURN_SELF;
} }
static int linear( T* p, lua_State *L ) static int linear( T* p, lua_State *L )
{ {
@@ -1420,10 +1420,10 @@ public:
if (fTime < 0) if (fTime < 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Lua: linear(%f): tween time must not be negative", fTime); LuaHelpers::ReportScriptErrorFmt("Lua: linear(%f): tween time must not be negative", fTime);
return 0; COMMON_RETURN_SELF;
} }
p->BeginTweening(fTime, TWEEN_LINEAR); p->BeginTweening(fTime, TWEEN_LINEAR);
return 0; COMMON_RETURN_SELF;
} }
static int accelerate( T* p, lua_State *L ) static int accelerate( T* p, lua_State *L )
{ {
@@ -1431,10 +1431,10 @@ public:
if (fTime < 0) if (fTime < 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Lua: accelerate(%f): tween time must not be negative", fTime); LuaHelpers::ReportScriptErrorFmt("Lua: accelerate(%f): tween time must not be negative", fTime);
return 0; COMMON_RETURN_SELF;
} }
p->BeginTweening(fTime, TWEEN_ACCELERATE); p->BeginTweening(fTime, TWEEN_ACCELERATE);
return 0; COMMON_RETURN_SELF;
} }
static int decelerate( T* p, lua_State *L ) static int decelerate( T* p, lua_State *L )
{ {
@@ -1442,10 +1442,10 @@ public:
if (fTime < 0) if (fTime < 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Lua: decelerate(%f): tween time must not be negative", fTime); LuaHelpers::ReportScriptErrorFmt("Lua: decelerate(%f): tween time must not be negative", fTime);
return 0; COMMON_RETURN_SELF;
} }
p->BeginTweening(fTime, TWEEN_DECELERATE); p->BeginTweening(fTime, TWEEN_DECELERATE);
return 0; COMMON_RETURN_SELF;
} }
static int spring( T* p, lua_State *L ) static int spring( T* p, lua_State *L )
{ {
@@ -1453,10 +1453,10 @@ public:
if (fTime < 0) if (fTime < 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Lua: spring(%f): tween time must not be negative", fTime); LuaHelpers::ReportScriptErrorFmt("Lua: spring(%f): tween time must not be negative", fTime);
return 0; COMMON_RETURN_SELF;
} }
p->BeginTweening(fTime, TWEEN_SPRING); p->BeginTweening(fTime, TWEEN_SPRING);
return 0; COMMON_RETURN_SELF;
} }
static int tween( T* p, lua_State *L ) static int tween( T* p, lua_State *L )
{ {
@@ -1464,113 +1464,113 @@ public:
if (fTime < 0) if (fTime < 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Lua: tween(%f): tween time must not be negative", fTime); LuaHelpers::ReportScriptErrorFmt("Lua: tween(%f): tween time must not be negative", fTime);
return 0; COMMON_RETURN_SELF;
} }
ITween *pTween = ITween::CreateFromStack( L, 2 ); ITween *pTween = ITween::CreateFromStack( L, 2 );
if(pTween != NULL) if(pTween != NULL)
{ {
p->BeginTweening(fTime, pTween); p->BeginTweening(fTime, pTween);
} }
return 0; COMMON_RETURN_SELF;
} }
static int stoptweening( T* p, lua_State * ) { p->StopTweening(); return 0; } static int stoptweening( T* p, lua_State *L ) { p->StopTweening(); COMMON_RETURN_SELF; }
static int finishtweening( T* p, lua_State * ) { p->FinishTweening(); return 0; } static int finishtweening( T* p, lua_State *L ) { p->FinishTweening(); COMMON_RETURN_SELF; }
static int hurrytweening( T* p, lua_State *L ) { p->HurryTweening(FArg(1)); return 0; } static int hurrytweening( T* p, lua_State *L ) { p->HurryTweening(FArg(1)); COMMON_RETURN_SELF; }
static int GetTweenTimeLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetTweenTimeLeft() ); return 1; } static int GetTweenTimeLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetTweenTimeLeft() ); return 1; }
static int x( T* p, lua_State *L ) { p->SetX(FArg(1)); return 0; } static int x( T* p, lua_State *L ) { p->SetX(FArg(1)); COMMON_RETURN_SELF; }
static int y( T* p, lua_State *L ) { p->SetY(FArg(1)); return 0; } static int y( T* p, lua_State *L ) { p->SetY(FArg(1)); COMMON_RETURN_SELF; }
static int z( T* p, lua_State *L ) { p->SetZ(FArg(1)); return 0; } static int z( T* p, lua_State *L ) { p->SetZ(FArg(1)); COMMON_RETURN_SELF; }
static int xy( T* p, lua_State *L ) { p->SetXY(FArg(1),FArg(2)); return 0; } static int xy( T* p, lua_State *L ) { p->SetXY(FArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int addx( T* p, lua_State *L ) { p->AddX(FArg(1)); return 0; } static int addx( T* p, lua_State *L ) { p->AddX(FArg(1)); COMMON_RETURN_SELF; }
static int addy( T* p, lua_State *L ) { p->AddY(FArg(1)); return 0; } static int addy( T* p, lua_State *L ) { p->AddY(FArg(1)); COMMON_RETURN_SELF; }
static int addz( T* p, lua_State *L ) { p->AddZ(FArg(1)); return 0; } static int addz( T* p, lua_State *L ) { p->AddZ(FArg(1)); COMMON_RETURN_SELF; }
static int zoom( T* p, lua_State *L ) { p->SetZoom(FArg(1)); return 0; } static int zoom( T* p, lua_State *L ) { p->SetZoom(FArg(1)); COMMON_RETURN_SELF; }
static int zoomx( T* p, lua_State *L ) { p->SetZoomX(FArg(1)); return 0; } static int zoomx( T* p, lua_State *L ) { p->SetZoomX(FArg(1)); COMMON_RETURN_SELF; }
static int zoomy( T* p, lua_State *L ) { p->SetZoomY(FArg(1)); return 0; } static int zoomy( T* p, lua_State *L ) { p->SetZoomY(FArg(1)); COMMON_RETURN_SELF; }
static int zoomz( T* p, lua_State *L ) { p->SetZoomZ(FArg(1)); return 0; } static int zoomz( T* p, lua_State *L ) { p->SetZoomZ(FArg(1)); COMMON_RETURN_SELF; }
static int zoomto( T* p, lua_State *L ) { p->ZoomTo(FArg(1), FArg(2)); return 0; } static int zoomto( T* p, lua_State *L ) { p->ZoomTo(FArg(1), FArg(2)); COMMON_RETURN_SELF; }
static int zoomtowidth( T* p, lua_State *L ) { p->ZoomToWidth(FArg(1)); return 0; } static int zoomtowidth( T* p, lua_State *L ) { p->ZoomToWidth(FArg(1)); COMMON_RETURN_SELF; }
static int zoomtoheight( T* p, lua_State *L ) { p->ZoomToHeight(FArg(1)); return 0; } static int zoomtoheight( T* p, lua_State *L ) { p->ZoomToHeight(FArg(1)); COMMON_RETURN_SELF; }
static int setsize( T* p, lua_State *L ) { p->SetWidth(FArg(1)); p->SetHeight(FArg(2)); return 0; } static int setsize( T* p, lua_State *L ) { p->SetWidth(FArg(1)); p->SetHeight(FArg(2)); COMMON_RETURN_SELF; }
static int SetWidth( T* p, lua_State *L ) { p->SetWidth(FArg(1)); return 0; } static int SetWidth( T* p, lua_State *L ) { p->SetWidth(FArg(1)); COMMON_RETURN_SELF; }
static int SetHeight( T* p, lua_State *L ) { p->SetHeight(FArg(1)); return 0; } static int SetHeight( T* p, lua_State *L ) { p->SetHeight(FArg(1)); COMMON_RETURN_SELF; }
static int basealpha( T* p, lua_State *L ) { p->SetBaseAlpha(FArg(1)); return 0; } static int basealpha( T* p, lua_State *L ) { p->SetBaseAlpha(FArg(1)); COMMON_RETURN_SELF; }
static int basezoom( T* p, lua_State *L ) { p->SetBaseZoom(FArg(1)); return 0; } static int basezoom( T* p, lua_State *L ) { p->SetBaseZoom(FArg(1)); COMMON_RETURN_SELF; }
static int basezoomx( T* p, lua_State *L ) { p->SetBaseZoomX(FArg(1)); return 0; } static int basezoomx( T* p, lua_State *L ) { p->SetBaseZoomX(FArg(1)); COMMON_RETURN_SELF; }
static int basezoomy( T* p, lua_State *L ) { p->SetBaseZoomY(FArg(1)); return 0; } static int basezoomy( T* p, lua_State *L ) { p->SetBaseZoomY(FArg(1)); COMMON_RETURN_SELF; }
static int basezoomz( T* p, lua_State *L ) { p->SetBaseZoomZ(FArg(1)); return 0; } static int basezoomz( T* p, lua_State *L ) { p->SetBaseZoomZ(FArg(1)); COMMON_RETURN_SELF; }
static int stretchto( T* p, lua_State *L ) { p->StretchTo( RectF(FArg(1),FArg(2),FArg(3),FArg(4)) ); return 0; } static int stretchto( T* p, lua_State *L ) { p->StretchTo( RectF(FArg(1),FArg(2),FArg(3),FArg(4)) ); COMMON_RETURN_SELF; }
static int cropleft( T* p, lua_State *L ) { p->SetCropLeft(FArg(1)); return 0; } static int cropleft( T* p, lua_State *L ) { p->SetCropLeft(FArg(1)); COMMON_RETURN_SELF; }
static int croptop( T* p, lua_State *L ) { p->SetCropTop(FArg(1)); return 0; } static int croptop( T* p, lua_State *L ) { p->SetCropTop(FArg(1)); COMMON_RETURN_SELF; }
static int cropright( T* p, lua_State *L ) { p->SetCropRight(FArg(1)); return 0; } static int cropright( T* p, lua_State *L ) { p->SetCropRight(FArg(1)); COMMON_RETURN_SELF; }
static int cropbottom( T* p, lua_State *L ) { p->SetCropBottom(FArg(1)); return 0; } static int cropbottom( T* p, lua_State *L ) { p->SetCropBottom(FArg(1)); COMMON_RETURN_SELF; }
static int fadeleft( T* p, lua_State *L ) { p->SetFadeLeft(FArg(1)); return 0; } static int fadeleft( T* p, lua_State *L ) { p->SetFadeLeft(FArg(1)); COMMON_RETURN_SELF; }
static int fadetop( T* p, lua_State *L ) { p->SetFadeTop(FArg(1)); return 0; } static int fadetop( T* p, lua_State *L ) { p->SetFadeTop(FArg(1)); COMMON_RETURN_SELF; }
static int faderight( T* p, lua_State *L ) { p->SetFadeRight(FArg(1)); return 0; } static int faderight( T* p, lua_State *L ) { p->SetFadeRight(FArg(1)); COMMON_RETURN_SELF; }
static int fadebottom( T* p, lua_State *L ) { p->SetFadeBottom(FArg(1)); return 0; } static int fadebottom( T* p, lua_State *L ) { p->SetFadeBottom(FArg(1)); COMMON_RETURN_SELF; }
static int diffuse( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuse( c ); return 0; } static int diffuse( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuse( c ); COMMON_RETURN_SELF; }
static int diffuseupperleft( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseUpperLeft( c ); return 0; } static int diffuseupperleft( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseUpperLeft( c ); COMMON_RETURN_SELF; }
static int diffuseupperright( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseUpperRight( c ); return 0; } static int diffuseupperright( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseUpperRight( c ); COMMON_RETURN_SELF; }
static int diffuselowerleft( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLowerLeft( c ); return 0; } static int diffuselowerleft( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLowerLeft( c ); COMMON_RETURN_SELF; }
static int diffuselowerright( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLowerRight( c ); return 0; } static int diffuselowerright( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLowerRight( c ); COMMON_RETURN_SELF; }
static int diffuseleftedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLeftEdge( c ); return 0; } static int diffuseleftedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLeftEdge( c ); COMMON_RETURN_SELF; }
static int diffuserightedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseRightEdge( c ); return 0; } static int diffuserightedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseRightEdge( c ); COMMON_RETURN_SELF; }
static int diffusetopedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseTopEdge( c ); return 0; } static int diffusetopedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseTopEdge( c ); COMMON_RETURN_SELF; }
static int diffusebottomedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseBottomEdge( c ); return 0; } static int diffusebottomedge( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseBottomEdge( c ); COMMON_RETURN_SELF; }
static int diffusealpha( T* p, lua_State *L ) { p->SetDiffuseAlpha(FArg(1)); return 0; } static int diffusealpha( T* p, lua_State *L ) { p->SetDiffuseAlpha(FArg(1)); COMMON_RETURN_SELF; }
static int diffusecolor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseColor( c ); return 0; } static int diffusecolor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseColor( c ); COMMON_RETURN_SELF; }
static int glow( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetGlow( c ); return 0; } static int glow( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetGlow( c ); COMMON_RETURN_SELF; }
static int aux( T* p, lua_State *L ) { p->SetAux( FArg(1) ); return 0; } static int aux( T* p, lua_State *L ) { p->SetAux( FArg(1) ); COMMON_RETURN_SELF; }
static int getaux( T* p, lua_State *L ) { lua_pushnumber( L, p->GetAux() ); return 1; } static int getaux( T* p, lua_State *L ) { lua_pushnumber( L, p->GetAux() ); return 1; }
static int rotationx( T* p, lua_State *L ) { p->SetRotationX(FArg(1)); return 0; } static int rotationx( T* p, lua_State *L ) { p->SetRotationX(FArg(1)); COMMON_RETURN_SELF; }
static int rotationy( T* p, lua_State *L ) { p->SetRotationY(FArg(1)); return 0; } static int rotationy( T* p, lua_State *L ) { p->SetRotationY(FArg(1)); COMMON_RETURN_SELF; }
static int rotationz( T* p, lua_State *L ) { p->SetRotationZ(FArg(1)); return 0; } static int rotationz( T* p, lua_State *L ) { p->SetRotationZ(FArg(1)); COMMON_RETURN_SELF; }
static int addrotationx( T* p, lua_State *L ) { p->AddRotationX(FArg(1)); return 0; } static int addrotationx( T* p, lua_State *L ) { p->AddRotationX(FArg(1)); COMMON_RETURN_SELF; }
static int addrotationy( T* p, lua_State *L ) { p->AddRotationY(FArg(1)); return 0; } static int addrotationy( T* p, lua_State *L ) { p->AddRotationY(FArg(1)); COMMON_RETURN_SELF; }
static int addrotationz( T* p, lua_State *L ) { p->AddRotationZ(FArg(1)); return 0; } static int addrotationz( T* p, lua_State *L ) { p->AddRotationZ(FArg(1)); COMMON_RETURN_SELF; }
static int getrotation( T* p, lua_State *L ) { lua_pushnumber(L, p->GetRotationX()); lua_pushnumber(L, p->GetRotationY()); lua_pushnumber(L, p->GetRotationZ()); return 3; } static int getrotation( T* p, lua_State *L ) { lua_pushnumber(L, p->GetRotationX()); lua_pushnumber(L, p->GetRotationY()); lua_pushnumber(L, p->GetRotationZ()); return 3; }
static int baserotationx( T* p, lua_State *L ) { p->SetBaseRotationX(FArg(1)); return 0; } static int baserotationx( T* p, lua_State *L ) { p->SetBaseRotationX(FArg(1)); COMMON_RETURN_SELF; }
static int baserotationy( T* p, lua_State *L ) { p->SetBaseRotationY(FArg(1)); return 0; } static int baserotationy( T* p, lua_State *L ) { p->SetBaseRotationY(FArg(1)); COMMON_RETURN_SELF; }
static int baserotationz( T* p, lua_State *L ) { p->SetBaseRotationZ(FArg(1)); return 0; } static int baserotationz( T* p, lua_State *L ) { p->SetBaseRotationZ(FArg(1)); COMMON_RETURN_SELF; }
static int skewx( T* p, lua_State *L ) { p->SetSkewX(FArg(1)); return 0; } static int skewx( T* p, lua_State *L ) { p->SetSkewX(FArg(1)); COMMON_RETURN_SELF; }
static int skewy( T* p, lua_State *L ) { p->SetSkewY(FArg(1)); return 0; } static int skewy( T* p, lua_State *L ) { p->SetSkewY(FArg(1)); COMMON_RETURN_SELF; }
static int heading( T* p, lua_State *L ) { p->AddRotationH(FArg(1)); return 0; } static int heading( T* p, lua_State *L ) { p->AddRotationH(FArg(1)); COMMON_RETURN_SELF; }
static int pitch( T* p, lua_State *L ) { p->AddRotationP(FArg(1)); return 0; } static int pitch( T* p, lua_State *L ) { p->AddRotationP(FArg(1)); COMMON_RETURN_SELF; }
static int roll( T* p, lua_State *L ) { p->AddRotationR(FArg(1)); return 0; } static int roll( T* p, lua_State *L ) { p->AddRotationR(FArg(1)); COMMON_RETURN_SELF; }
static int shadowlength( T* p, lua_State *L ) { p->SetShadowLength(FArg(1)); return 0; } static int shadowlength( T* p, lua_State *L ) { p->SetShadowLength(FArg(1)); COMMON_RETURN_SELF; }
static int shadowlengthx( T* p, lua_State *L ) { p->SetShadowLengthX(FArg(1)); return 0; } static int shadowlengthx( T* p, lua_State *L ) { p->SetShadowLengthX(FArg(1)); COMMON_RETURN_SELF; }
static int shadowlengthy( T* p, lua_State *L ) { p->SetShadowLengthY(FArg(1)); return 0; } static int shadowlengthy( T* p, lua_State *L ) { p->SetShadowLengthY(FArg(1)); COMMON_RETURN_SELF; }
static int shadowcolor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetShadowColor( c ); return 0; } static int shadowcolor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetShadowColor( c ); COMMON_RETURN_SELF; }
static int horizalign( T* p, lua_State *L ) { p->SetHorizAlign(Enum::Check<HorizAlign>(L, 1)); return 0; } static int horizalign( T* p, lua_State *L ) { p->SetHorizAlign(Enum::Check<HorizAlign>(L, 1)); COMMON_RETURN_SELF; }
static int vertalign( T* p, lua_State *L ) { p->SetVertAlign(Enum::Check<VertAlign>(L, 1)); return 0; } static int vertalign( T* p, lua_State *L ) { p->SetVertAlign(Enum::Check<VertAlign>(L, 1)); COMMON_RETURN_SELF; }
static int halign( T* p, lua_State *L ) { p->SetHorizAlign(FArg(1)); return 0; } static int halign( T* p, lua_State *L ) { p->SetHorizAlign(FArg(1)); COMMON_RETURN_SELF; }
static int valign( T* p, lua_State *L ) { p->SetVertAlign(FArg(1)); return 0; } static int valign( T* p, lua_State *L ) { p->SetVertAlign(FArg(1)); COMMON_RETURN_SELF; }
static int diffuseblink( T* p, lua_State * ) { p->SetEffectDiffuseBlink(1.0f, RageColor(0.5f,0.5f,0.5f,0.5f), RageColor(1,1,1,1)); return 0; } static int diffuseblink( T* p, lua_State *L ) { p->SetEffectDiffuseBlink(1.0f, RageColor(0.5f,0.5f,0.5f,0.5f), RageColor(1,1,1,1)); COMMON_RETURN_SELF; }
static int diffuseshift( T* p, lua_State * ) { p->SetEffectDiffuseShift(1.0f, RageColor(0,0,0,1), RageColor(1,1,1,1)); return 0; } static int diffuseshift( T* p, lua_State *L ) { p->SetEffectDiffuseShift(1.0f, RageColor(0,0,0,1), RageColor(1,1,1,1)); COMMON_RETURN_SELF; }
static int diffuseramp( T* p, lua_State * ) { p->SetEffectDiffuseRamp(1.0f, RageColor(0,0,0,1), RageColor(1,1,1,1)); return 0; } static int diffuseramp( T* p, lua_State *L ) { p->SetEffectDiffuseRamp(1.0f, RageColor(0,0,0,1), RageColor(1,1,1,1)); COMMON_RETURN_SELF; }
static int glowblink( T* p, lua_State * ) { p->SetEffectGlowBlink(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); return 0; } static int glowblink( T* p, lua_State *L ) { p->SetEffectGlowBlink(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); COMMON_RETURN_SELF; }
static int glowshift( T* p, lua_State * ) { p->SetEffectGlowShift(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); return 0; } static int glowshift( T* p, lua_State *L ) { p->SetEffectGlowShift(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); COMMON_RETURN_SELF; }
static int glowramp( T* p, lua_State * ) { p->SetEffectGlowRamp(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); return 0; } static int glowramp( T* p, lua_State *L ) { p->SetEffectGlowRamp(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); COMMON_RETURN_SELF; }
static int rainbow( T* p, lua_State * ) { p->SetEffectRainbow(2.0f); return 0; } static int rainbow( T* p, lua_State *L ) { p->SetEffectRainbow(2.0f); COMMON_RETURN_SELF; }
static int wag( T* p, lua_State * ) { p->SetEffectWag(2.0f, RageVector3(0,0,20)); return 0; } static int wag( T* p, lua_State *L ) { p->SetEffectWag(2.0f, RageVector3(0,0,20)); COMMON_RETURN_SELF; }
static int bounce( T* p, lua_State * ) { p->SetEffectBounce(2.0f, RageVector3(0,20,0)); return 0; } static int bounce( T* p, lua_State *L ) { p->SetEffectBounce(2.0f, RageVector3(0,20,0)); COMMON_RETURN_SELF; }
static int bob( T* p, lua_State * ) { p->SetEffectBob(2.0f, RageVector3(0,20,0)); return 0; } static int bob( T* p, lua_State *L ) { p->SetEffectBob(2.0f, RageVector3(0,20,0)); COMMON_RETURN_SELF; }
static int pulse( T* p, lua_State * ) { p->SetEffectPulse(2.0f, 0.5f, 1.0f); return 0; } static int pulse( T* p, lua_State *L ) { p->SetEffectPulse(2.0f, 0.5f, 1.0f); COMMON_RETURN_SELF; }
static int spin( T* p, lua_State * ) { p->SetEffectSpin(RageVector3(0,0,180)); return 0; } static int spin( T* p, lua_State *L ) { p->SetEffectSpin(RageVector3(0,0,180)); COMMON_RETURN_SELF; }
static int vibrate( T* p, lua_State * ) { p->SetEffectVibrate(RageVector3(10,10,10)); return 0; } static int vibrate( T* p, lua_State *L ) { p->SetEffectVibrate(RageVector3(10,10,10)); COMMON_RETURN_SELF; }
static int stopeffect( T* p, lua_State * ) { p->StopEffect(); return 0; } static int stopeffect( T* p, lua_State *L ) { p->StopEffect(); COMMON_RETURN_SELF; }
static int effectcolor1( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetEffectColor1( c ); return 0; } static int effectcolor1( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetEffectColor1( c ); COMMON_RETURN_SELF; }
static int effectcolor2( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetEffectColor2( c ); return 0; } static int effectcolor2( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetEffectColor2( c ); COMMON_RETURN_SELF; }
static int effectperiod( T* p, lua_State *L ) static int effectperiod( T* p, lua_State *L )
{ {
float fPeriod = FArg(1); float fPeriod = FArg(1);
if (fPeriod <= 0) if (fPeriod <= 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Effect period (%f) must be positive; ignoring", fPeriod); LuaHelpers::ReportScriptErrorFmt("Effect period (%f) must be positive; ignoring", fPeriod);
return 0; COMMON_RETURN_SELF;
} }
p->SetEffectPeriod(FArg(1)); p->SetEffectPeriod(FArg(1));
return 0; COMMON_RETURN_SELF;
} }
static int effecttiming( T* p, lua_State *L ) static int effecttiming( T* p, lua_State *L )
{ {
@@ -1579,42 +1579,42 @@ public:
{ {
LuaHelpers::ReportScriptErrorFmt("Effect timings (%f,%f,%f,%f) must not be negative; ignoring", LuaHelpers::ReportScriptErrorFmt("Effect timings (%f,%f,%f,%f) must not be negative; ignoring",
f1, f2, f3, f4); f1, f2, f3, f4);
return 0; COMMON_RETURN_SELF;
} }
if (f1 == 0 && f2 == 0 && f3 == 0 && f4 == 0) if (f1 == 0 && f2 == 0 && f3 == 0 && f4 == 0)
{ {
LuaHelpers::ReportScriptErrorFmt("Effect timings (0,0,0,0) must not all be zero; ignoring"); LuaHelpers::ReportScriptErrorFmt("Effect timings (0,0,0,0) must not all be zero; ignoring");
return 0; COMMON_RETURN_SELF;
} }
p->SetEffectTiming(FArg(1), FArg(2), FArg(3), FArg(4)); p->SetEffectTiming(FArg(1), FArg(2), FArg(3), FArg(4));
return 0; COMMON_RETURN_SELF;
} }
static int effectoffset( T* p, lua_State *L ) { p->SetEffectOffset(FArg(1)); return 0; } static int effectoffset( T* p, lua_State *L ) { p->SetEffectOffset(FArg(1)); COMMON_RETURN_SELF; }
static int effectclock( T* p, lua_State *L ) { p->SetEffectClockString(SArg(1)); return 0; } static int effectclock( T* p, lua_State *L ) { p->SetEffectClockString(SArg(1)); COMMON_RETURN_SELF; }
static int effectmagnitude( T* p, lua_State *L ) { p->SetEffectMagnitude( RageVector3(FArg(1),FArg(2),FArg(3)) ); return 0; } static int effectmagnitude( T* p, lua_State *L ) { p->SetEffectMagnitude( RageVector3(FArg(1),FArg(2),FArg(3)) ); COMMON_RETURN_SELF; }
static int geteffectmagnitude( T* p, lua_State *L ) { RageVector3 v = p->GetEffectMagnitude(); lua_pushnumber(L, v[0]); lua_pushnumber(L, v[1]); lua_pushnumber(L, v[2]); return 3; } static int geteffectmagnitude( T* p, lua_State *L ) { RageVector3 v = p->GetEffectMagnitude(); lua_pushnumber(L, v[0]); lua_pushnumber(L, v[1]); lua_pushnumber(L, v[2]); return 3; }
static int scaletocover( T* p, lua_State *L ) { p->ScaleToCover( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) ); return 0; } static int scaletocover( T* p, lua_State *L ) { p->ScaleToCover( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) ); COMMON_RETURN_SELF; }
static int scaletofit( T* p, lua_State *L ) { p->ScaleToFitInside( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) ); return 0; } static int scaletofit( T* p, lua_State *L ) { p->ScaleToFitInside( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) ); COMMON_RETURN_SELF; }
static int animate( T* p, lua_State *L ) { p->EnableAnimation(BIArg(1)); return 0; } static int animate( T* p, lua_State *L ) { p->EnableAnimation(BIArg(1)); COMMON_RETURN_SELF; }
static int play( T* p, lua_State * ) { p->EnableAnimation(true); return 0; } static int play( T* p, lua_State *L ) { p->EnableAnimation(true); COMMON_RETURN_SELF; }
static int pause( T* p, lua_State * ) { p->EnableAnimation(false); return 0; } static int pause( T* p, lua_State *L ) { p->EnableAnimation(false); COMMON_RETURN_SELF; }
static int setstate( T* p, lua_State *L ) { p->SetState(IArg(1)); return 0; } static int setstate( T* p, lua_State *L ) { p->SetState(IArg(1)); COMMON_RETURN_SELF; }
static int GetNumStates( T* p, lua_State *L ) { LuaHelpers::Push( L, p->GetNumStates() ); return 1; } static int GetNumStates( T* p, lua_State *L ) { LuaHelpers::Push( L, p->GetNumStates() ); return 1; }
static int texturetranslate( T* p, lua_State *L ) { p->SetTextureTranslate(FArg(1),FArg(2)); return 0; } static int texturetranslate( T* p, lua_State *L ) { p->SetTextureTranslate(FArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int texturewrapping( T* p, lua_State *L ) { p->SetTextureWrapping(BIArg(1)); return 0; } static int texturewrapping( T* p, lua_State *L ) { p->SetTextureWrapping(BIArg(1)); COMMON_RETURN_SELF; }
static int SetTextureFiltering( T* p, lua_State *L ) { p->SetTextureFiltering(BArg(1)); return 0; } static int SetTextureFiltering( T* p, lua_State *L ) { p->SetTextureFiltering(BArg(1)); COMMON_RETURN_SELF; }
static int blend( T* p, lua_State *L ) { p->SetBlendMode( Enum::Check<BlendMode>(L, 1) ); return 0; } static int blend( T* p, lua_State *L ) { p->SetBlendMode( Enum::Check<BlendMode>(L, 1) ); COMMON_RETURN_SELF; }
static int zbuffer( T* p, lua_State *L ) { p->SetUseZBuffer(BIArg(1)); return 0; } static int zbuffer( T* p, lua_State *L ) { p->SetUseZBuffer(BIArg(1)); COMMON_RETURN_SELF; }
static int ztest( T* p, lua_State *L ) { p->SetZTestMode((BIArg(1))?ZTEST_WRITE_ON_PASS:ZTEST_OFF); return 0; } static int ztest( T* p, lua_State *L ) { p->SetZTestMode((BIArg(1))?ZTEST_WRITE_ON_PASS:ZTEST_OFF); COMMON_RETURN_SELF; }
static int ztestmode( T* p, lua_State *L ) { p->SetZTestMode( Enum::Check<ZTestMode>(L, 1) ); return 0; } static int ztestmode( T* p, lua_State *L ) { p->SetZTestMode( Enum::Check<ZTestMode>(L, 1) ); COMMON_RETURN_SELF; }
static int zwrite( T* p, lua_State *L ) { p->SetZWrite(BIArg(1)); return 0; } static int zwrite( T* p, lua_State *L ) { p->SetZWrite(BIArg(1)); COMMON_RETURN_SELF; }
static int zbias( T* p, lua_State *L ) { p->SetZBias(FArg(1)); return 0; } static int zbias( T* p, lua_State *L ) { p->SetZBias(FArg(1)); COMMON_RETURN_SELF; }
static int clearzbuffer( T* p, lua_State *L ) { p->SetClearZBuffer(BIArg(1)); return 0; } static int clearzbuffer( T* p, lua_State *L ) { p->SetClearZBuffer(BIArg(1)); COMMON_RETURN_SELF; }
static int backfacecull( T* p, lua_State *L ) { p->SetCullMode((BIArg(1)) ? CULL_BACK : CULL_NONE); return 0; } static int backfacecull( T* p, lua_State *L ) { p->SetCullMode((BIArg(1)) ? CULL_BACK : CULL_NONE); COMMON_RETURN_SELF; }
static int cullmode( T* p, lua_State *L ) { p->SetCullMode( Enum::Check<CullMode>(L, 1)); return 0; } static int cullmode( T* p, lua_State *L ) { p->SetCullMode( Enum::Check<CullMode>(L, 1)); COMMON_RETURN_SELF; }
static int visible( T* p, lua_State *L ) { p->SetVisible(BIArg(1)); return 0; } static int visible( T* p, lua_State *L ) { p->SetVisible(BIArg(1)); COMMON_RETURN_SELF; }
static int hibernate( T* p, lua_State *L ) { p->SetHibernate(FArg(1)); return 0; } static int hibernate( T* p, lua_State *L ) { p->SetHibernate(FArg(1)); COMMON_RETURN_SELF; }
static int draworder( T* p, lua_State *L ) { p->SetDrawOrder(IArg(1)); return 0; } static int draworder( T* p, lua_State *L ) { p->SetDrawOrder(IArg(1)); COMMON_RETURN_SELF; }
static int playcommand( T* p, lua_State *L ) static int playcommand( T* p, lua_State *L )
{ {
if( !lua_istable(L, 2) && !lua_isnoneornil(L, 2) ) if( !lua_istable(L, 2) && !lua_isnoneornil(L, 2) )
@@ -1627,16 +1627,16 @@ public:
Message msg( SArg(1), ParamTable ); Message msg( SArg(1), ParamTable );
p->HandleMessage( msg ); p->HandleMessage( msg );
return 0; COMMON_RETURN_SELF;
} }
static int queuecommand( T* p, lua_State *L ) { p->QueueCommand(SArg(1)); return 0; } static int queuecommand( T* p, lua_State *L ) { p->QueueCommand(SArg(1)); COMMON_RETURN_SELF; }
static int queuemessage( T* p, lua_State *L ) { p->QueueMessage(SArg(1)); return 0; } static int queuemessage( T* p, lua_State *L ) { p->QueueMessage(SArg(1)); COMMON_RETURN_SELF; }
static int addcommand( T* p, lua_State *L ) static int addcommand( T* p, lua_State *L )
{ {
LuaReference *pRef = new LuaReference; LuaReference *pRef = new LuaReference;
pRef->SetFromStack( L ); pRef->SetFromStack( L );
p->AddCommand( SArg(1), apActorCommands(pRef) ); p->AddCommand( SArg(1), apActorCommands(pRef) );
return 0; COMMON_RETURN_SELF;
} }
static int GetCommand( T* p, lua_State *L ) static int GetCommand( T* p, lua_State *L )
{ {
@@ -1663,7 +1663,7 @@ public:
ParamTable.SetFromStack( L ); ParamTable.SetFromStack( L );
p->RunCommandsRecursively( ref, &ParamTable ); p->RunCommandsRecursively( ref, &ParamTable );
return 0; COMMON_RETURN_SELF;
} }
static int GetX( T* p, lua_State *L ) { lua_pushnumber( L, p->GetX() ); return 1; } static int GetX( T* p, lua_State *L ) { lua_pushnumber( L, p->GetX() ); return 1; }
@@ -1710,7 +1710,7 @@ public:
LUA->YieldLua(); LUA->YieldLua();
p->Draw(); p->Draw();
LUA->UnyieldLua(); LUA->UnyieldLua();
return 0; COMMON_RETURN_SELF;
} }
LunaActor() LunaActor()
+20 -20
View File
@@ -591,8 +591,8 @@ void ActorFrame::SetDrawByZPosition( bool b )
class LunaActorFrame : public Luna<ActorFrame> class LunaActorFrame : public Luna<ActorFrame>
{ {
public: public:
static int playcommandonchildren( T* p, lua_State *L ) { p->PlayCommandOnChildren(SArg(1)); return 0; } static int playcommandonchildren( T* p, lua_State *L ) { p->PlayCommandOnChildren(SArg(1)); COMMON_RETURN_SELF; }
static int playcommandonleaves( T* p, lua_State *L ) { p->PlayCommandOnLeaves(SArg(1)); return 0; } static int playcommandonleaves( T* p, lua_State *L ) { p->PlayCommandOnLeaves(SArg(1)); COMMON_RETURN_SELF; }
static int runcommandsonleaves( T* p, lua_State *L ) static int runcommandsonleaves( T* p, lua_State *L )
{ {
luaL_checktype( L, 1, LUA_TFUNCTION ); luaL_checktype( L, 1, LUA_TFUNCTION );
@@ -600,7 +600,7 @@ public:
cmds.SetFromStack( L ); cmds.SetFromStack( L );
p->RunCommandsOnLeaves( cmds ); p->RunCommandsOnLeaves( cmds );
return 0; COMMON_RETURN_SELF;
} }
static int RunCommandsOnChildren( T* p, lua_State *L ) static int RunCommandsOnChildren( T* p, lua_State *L )
{ {
@@ -614,13 +614,13 @@ public:
cmds.SetFromStack( L ); cmds.SetFromStack( L );
p->RunCommandsOnChildren( cmds, &ParamTable ); p->RunCommandsOnChildren( cmds, &ParamTable );
return 0; COMMON_RETURN_SELF;
} }
static int propagate( T* p, lua_State *L ) { p->SetPropagateCommands( BIArg(1) ); return 0; } 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) ); return 0; } 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) ); return 0; } static int SetUpdateRate( T* p, lua_State *L ) { p->SetUpdateRate( FArg(1) ); COMMON_RETURN_SELF; }
static int SetFOV( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); return 0; } 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) ); return 0; } 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 ) static int GetChild( T* p, lua_State *L )
{ {
p->PushChildTable(L, SArg(1)); p->PushChildTable(L, SArg(1));
@@ -641,7 +641,7 @@ public:
lua_pushnil( L ); lua_pushnil( L );
ref.SetFromStack( L ); ref.SetFromStack( L );
p->SetDrawFunction( ref ); p->SetDrawFunction( ref );
return 0; COMMON_RETURN_SELF;
} }
luaL_checktype( L, 1, LUA_TFUNCTION ); luaL_checktype( L, 1, LUA_TFUNCTION );
@@ -650,7 +650,7 @@ public:
lua_pushvalue( L, 1 ); lua_pushvalue( L, 1 );
ref.SetFromStack( L ); ref.SetFromStack( L );
p->SetDrawFunction( ref ); p->SetDrawFunction( ref );
return 0; COMMON_RETURN_SELF;
} }
static int GetDrawFunction( T* p, lua_State *L ) static int GetDrawFunction( T* p, lua_State *L )
{ {
@@ -665,7 +665,7 @@ public:
lua_pushnil( L ); lua_pushnil( L );
ref.SetFromStack( L ); ref.SetFromStack( L );
p->SetUpdateFunction( ref ); p->SetUpdateFunction( ref );
return 0; COMMON_RETURN_SELF;
} }
luaL_checktype( L, 1, LUA_TFUNCTION ); luaL_checktype( L, 1, LUA_TFUNCTION );
@@ -674,14 +674,14 @@ public:
lua_pushvalue( L, 1 ); lua_pushvalue( L, 1 );
ref.SetFromStack( L ); ref.SetFromStack( L );
p->SetUpdateFunction( ref ); p->SetUpdateFunction( ref );
return 0; COMMON_RETURN_SELF;
} }
static int SortByDrawOrder( T* p, lua_State *L ) { p->SortByDrawOrder(); return 0; } static int SortByDrawOrder( T* p, lua_State *L ) { p->SortByDrawOrder(); COMMON_RETURN_SELF; }
//static int CustomLighting( T* p, lua_State *L ) { p->SetCustomLighting(BArg(1)); return 0; } //static int CustomLighting( T* p, lua_State *L ) { p->SetCustomLighting(BArg(1)); COMMON_RETURN_SELF; }
static int SetAmbientLightColor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetAmbientLightColor( c ); return 0; } static int SetAmbientLightColor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetAmbientLightColor( c ); COMMON_RETURN_SELF; }
static int SetDiffuseLightColor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLightColor( c ); return 0; } static int SetDiffuseLightColor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetDiffuseLightColor( c ); COMMON_RETURN_SELF; }
static int SetSpecularLightColor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetSpecularLightColor( c ); return 0; } static int SetSpecularLightColor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetSpecularLightColor( c ); COMMON_RETURN_SELF; }
static int SetLightDirection( T* p, lua_State *L ) static int SetLightDirection( T* p, lua_State *L )
{ {
luaL_checktype( L, 1, LUA_TTABLE ); luaL_checktype( L, 1, LUA_TTABLE );
@@ -695,7 +695,7 @@ public:
} }
RageVector3 vTmp = RageVector3( coords[0], coords[1], coords[2] ); RageVector3 vTmp = RageVector3( coords[0], coords[1], coords[2] );
p->SetLightDirection( vTmp ); p->SetLightDirection( vTmp );
return 0; COMMON_RETURN_SELF;
} }
static int AddChildFromPath( T* p, lua_State *L ) static int AddChildFromPath( T* p, lua_State *L )
@@ -721,7 +721,7 @@ public:
lua_pushnil( L ); lua_pushnil( L );
return 1; return 1;
} }
static int RemoveAllChildren( T* p, lua_State *L ) { p->RemoveAllChildren( ); return 0; } static int RemoveAllChildren( T* p, lua_State *L ) { p->RemoveAllChildren( ); COMMON_RETURN_SELF; }
LunaActorFrame() LunaActorFrame()
{ {
+13 -8
View File
@@ -77,18 +77,23 @@ void ActorFrameTexture::DrawPrimitives()
class LunaActorFrameTexture : public Luna<ActorFrameTexture> class LunaActorFrameTexture : public Luna<ActorFrameTexture>
{ {
public: public:
static int Create( T* p, lua_State * ) { p->Create(); return 0; } static int Create( T* p, lua_State *L ) { p->Create(); COMMON_RETURN_SELF; }
static int EnableDepthBuffer( T* p, lua_State *L ) { p->EnableDepthBuffer(BArg(1)); return 0; } static int EnableDepthBuffer( T* p, lua_State *L ) { p->EnableDepthBuffer(BArg(1)); COMMON_RETURN_SELF; }
static int EnableAlphaBuffer( T* p, lua_State *L ) { p->EnableAlphaBuffer(BArg(1)); return 0; } static int EnableAlphaBuffer( T* p, lua_State *L ) { p->EnableAlphaBuffer(BArg(1)); COMMON_RETURN_SELF; }
static int EnableFloat( T* p, lua_State *L ) { p->EnableFloat(BArg(1)); return 0; } static int EnableFloat( T* p, lua_State *L ) { p->EnableFloat(BArg(1)); COMMON_RETURN_SELF; }
static int EnablePreserveTexture( T* p, lua_State *L ) { p->EnablePreserveTexture(BArg(1)); return 0; } static int EnablePreserveTexture( T* p, lua_State *L ) { p->EnablePreserveTexture(BArg(1)); COMMON_RETURN_SELF; }
static int SetTextureName( T* p, lua_State *L ) { p->SetTextureName(SArg(1)); return 0; } static int SetTextureName( T* p, lua_State *L ) { p->SetTextureName(SArg(1)); COMMON_RETURN_SELF; }
static int GetTexture( T* p, lua_State *L ) static int GetTexture( T* p, lua_State *L )
{ {
RageTexture *pTexture = p->GetTexture(); RageTexture *pTexture = p->GetTexture();
if( pTexture == NULL ) if( pTexture == NULL )
return 0; {
pTexture->PushSelf(L); lua_pushnil(L);
}
else
{
pTexture->PushSelf(L);
}
return 1; return 1;
} }
+5 -5
View File
@@ -149,7 +149,7 @@ public:
static int ClearTextures( T* p, lua_State *L ) static int ClearTextures( T* p, lua_State *L )
{ {
p->ClearTextures(); p->ClearTextures();
return 0; COMMON_RETURN_SELF;
} }
static int AddTexture( T* p, lua_State *L ) static int AddTexture( T* p, lua_State *L )
{ {
@@ -163,24 +163,24 @@ public:
int iIndex = IArg(1); int iIndex = IArg(1);
TextureMode tm = Enum::Check<TextureMode>(L, 2); TextureMode tm = Enum::Check<TextureMode>(L, 2);
p->SetTextureMode( iIndex, tm ); p->SetTextureMode( iIndex, tm );
return 0; COMMON_RETURN_SELF;
} }
static int SetTextureCoords( T* p, lua_State *L ) static int SetTextureCoords( T* p, lua_State *L )
{ {
p->SetTextureCoords( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) ); p->SetTextureCoords( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) );
return 0; COMMON_RETURN_SELF;
} }
static int SetSizeFromTexture( T* p, lua_State *L ) static int SetSizeFromTexture( T* p, lua_State *L )
{ {
RageTexture *pTexture = Luna<RageTexture>::check(L, 1); RageTexture *pTexture = Luna<RageTexture>::check(L, 1);
p->SetSizeFromTexture( pTexture ); p->SetSizeFromTexture( pTexture );
return 0; COMMON_RETURN_SELF;
} }
static int SetEffectMode( T* p, lua_State *L ) static int SetEffectMode( T* p, lua_State *L )
{ {
EffectMode em = Enum::Check<EffectMode>(L, 1); EffectMode em = Enum::Check<EffectMode>(L, 1);
p->SetEffectMode( em ); p->SetEffectMode( em );
return 0; COMMON_RETURN_SELF;
} }
LunaActorMultiTexture() LunaActorMultiTexture()
+14 -14
View File
@@ -407,7 +407,7 @@ public:
static int SetNumVertices( T* p, lua_State *L ) static int SetNumVertices( T* p, lua_State *L )
{ {
p->SetNumVertices( IArg(1) ); p->SetNumVertices( IArg(1) );
return 0; COMMON_RETURN_SELF;
} }
static int GetNumVertices( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumVertices() ); return 1; } static int GetNumVertices( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumVertices() ); return 1; }
@@ -478,7 +478,7 @@ public:
if( Index < 0 ) if( Index < 0 )
{ {
LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertex: index %d provided, cannot set Index < 1", Index+1 ); LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertex: index %d provided, cannot set Index < 1", Index+1 );
return 0; COMMON_RETURN_SELF;
} }
else if( Index == (int) p->GetNumVertices() ) else if( Index == (int) p->GetNumVertices() )
{ {
@@ -487,10 +487,10 @@ public:
else if( Index > (int) p->GetNumVertices() ) else if( Index > (int) p->GetNumVertices() )
{ {
LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertex: Cannot set vertex %d if there is no vertex %d, only %u vertices.", Index+1 , Index, (unsigned int)p->GetNumVertices() ); LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertex: Cannot set vertex %d if there is no vertex %d, only %u vertices.", Index+1 , Index, (unsigned int)p->GetNumVertices() );
return 0; COMMON_RETURN_SELF;
} }
SetVertexFromStack(p, L, Index, lua_gettop(L)); SetVertexFromStack(p, L, Index, lua_gettop(L));
return 0; COMMON_RETURN_SELF;
} }
static int SetVertices(T* p, lua_State* L) static int SetVertices(T* p, lua_State* L)
@@ -505,7 +505,7 @@ public:
if( First < 0 ) if( First < 0 )
{ {
LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertices: index %d provided, cannot set Index < 1", First+1 ); LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertices: index %d provided, cannot set Index < 1", First+1 );
return 0; COMMON_RETURN_SELF;
} }
} }
int Last = First + lua_objlen(L, StackIndex ); int Last = First + lua_objlen(L, StackIndex );
@@ -520,21 +520,21 @@ public:
SetVertexFromStack(p, L, n, lua_gettop(L)); SetVertexFromStack(p, L, n, lua_gettop(L));
lua_pop(L, 1); lua_pop(L, 1);
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetEffectMode( T* p, lua_State *L ) static int SetEffectMode( T* p, lua_State *L )
{ {
EffectMode em = Enum::Check<EffectMode>(L, 1); EffectMode em = Enum::Check<EffectMode>(L, 1);
p->SetEffectMode( em ); p->SetEffectMode( em );
return 0; COMMON_RETURN_SELF;
} }
static int SetTextureMode( T* p, lua_State *L ) static int SetTextureMode( T* p, lua_State *L )
{ {
TextureMode tm = Enum::Check<TextureMode>(L, 1); TextureMode tm = Enum::Check<TextureMode>(L, 1);
p->SetTextureMode( tm ); p->SetTextureMode( tm );
return 0; COMMON_RETURN_SELF;
} }
static int SetLineWidth( T* p, lua_State *L ) static int SetLineWidth( T* p, lua_State *L )
@@ -543,10 +543,10 @@ public:
if( Width < 0 ) if( Width < 0 )
{ {
LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetLineWidth: cannot set negative width." ); LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetLineWidth: cannot set negative width." );
return 0; COMMON_RETURN_SELF;
} }
p->SetLineWidth(Width); p->SetLineWidth(Width);
return 0; COMMON_RETURN_SELF;
} }
static int SetDrawState( T* p, lua_State* L ) static int SetDrawState( T* p, lua_State* L )
@@ -558,7 +558,7 @@ public:
if( !lua_istable(L, ArgsIndex) ) if( !lua_istable(L, ArgsIndex) )
{ {
LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex:SetDrawState: Table expected, something else recieved. Doing nothing."); LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex:SetDrawState: Table expected, something else recieved. Doing nothing.");
return 0; COMMON_RETURN_SELF;
} }
// Fetch the draw mode, if provided. // Fetch the draw mode, if provided.
lua_getfield(L, ArgsIndex, "Mode"); lua_getfield(L, ArgsIndex, "Mode");
@@ -583,7 +583,7 @@ public:
} }
lua_pop(L, 1); lua_pop(L, 1);
p->SetDrawState(dm, first, num); p->SetDrawState(dm, first, num);
return 0; COMMON_RETURN_SELF;
} }
static int GetDestDrawMode( T* p, lua_State* L ) static int GetDestDrawMode( T* p, lua_State* L )
@@ -635,7 +635,7 @@ public:
RageTextureID ID( SArg(1) ); RageTextureID ID( SArg(1) );
p->LoadFromTexture( ID ); p->LoadFromTexture( ID );
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetTexture( T* p, lua_State *L ) static int SetTexture( T* p, lua_State *L )
@@ -643,7 +643,7 @@ public:
RageTexture *Texture = Luna<RageTexture>::check(L, 1); RageTexture *Texture = Luna<RageTexture>::check(L, 1);
Texture = TEXTUREMAN->CopyTexture( Texture ); Texture = TEXTUREMAN->CopyTexture( Texture );
p->SetTexture( Texture ); p->SetTexture( Texture );
return 0; COMMON_RETURN_SELF;
} }
static int GetTexture(T* p, lua_State *L) static int GetTexture(T* p, lua_State *L)
{ {
+1 -1
View File
@@ -41,7 +41,7 @@ public:
{ {
Actor *pTarget = Luna<Actor>::check( L, 1 ); Actor *pTarget = Luna<Actor>::check( L, 1 );
p->SetTarget( pTarget ); p->SetTarget( pTarget );
return 0; COMMON_RETURN_SELF;
} }
static int GetTarget( T* p, lua_State *L ) static int GetTarget( T* p, lua_State *L )
+17 -17
View File
@@ -324,32 +324,32 @@ void ActorScroller::PositionItemsAndDrawPrimitives( bool bDrawPrimitives )
class LunaActorScroller: public Luna<ActorScroller> class LunaActorScroller: public Luna<ActorScroller>
{ {
public: public:
static int PositionItems( T* p, lua_State *L ) { p->PositionItems(); return 0; } static int PositionItems( T* p, lua_State *L ) { p->PositionItems(); COMMON_RETURN_SELF; }
static int SetTransformFromFunction( T* p, lua_State *L ) static int SetTransformFromFunction( T* p, lua_State *L )
{ {
LuaReference ref; LuaReference ref;
LuaHelpers::FromStack( L, ref, 1 ); LuaHelpers::FromStack( L, ref, 1 );
p->SetTransformFromReference( ref ); p->SetTransformFromReference( ref );
return 0; COMMON_RETURN_SELF;
} }
static int SetTransformFromHeight( T* p, lua_State *L ) { p->SetTransformFromHeight(FArg(1)); return 0; } static int SetTransformFromHeight( T* p, lua_State *L ) { p->SetTransformFromHeight(FArg(1)); COMMON_RETURN_SELF; }
static int SetTransformFromWidth( T* p, lua_State *L ) { p->SetTransformFromWidth(FArg(1)); return 0; } static int SetTransformFromWidth( T* p, lua_State *L ) { p->SetTransformFromWidth(FArg(1)); COMMON_RETURN_SELF; }
static int SetCurrentAndDestinationItem( T* p, lua_State *L ) { p->SetCurrentAndDestinationItem( FArg(1) ); return 0; } static int SetCurrentAndDestinationItem( T* p, lua_State *L ) { p->SetCurrentAndDestinationItem( FArg(1) ); COMMON_RETURN_SELF; }
static int SetDestinationItem( T* p, lua_State *L ) { p->SetDestinationItem( FArg(1) ); return 0; } static int SetDestinationItem( T* p, lua_State *L ) { p->SetDestinationItem( FArg(1) ); COMMON_RETURN_SELF; }
static int GetSecondsToDestination( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsToDestination() ); return 1; } static int GetSecondsToDestination( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsToDestination() ); return 1; }
static int SetSecondsPerItem( T* p, lua_State *L ) { p->SetSecondsPerItem(FArg(1)); return 0; } static int SetSecondsPerItem( T* p, lua_State *L ) { p->SetSecondsPerItem(FArg(1)); COMMON_RETURN_SELF; }
static int GetSecondsPauseBetweenItems( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsPauseBetweenItems() ); return 1; } static int GetSecondsPauseBetweenItems( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsPauseBetweenItems() ); return 1; }
static int SetSecondsPauseBetweenItems( T* p, lua_State *L ) { p->SetSecondsPauseBetweenItems(FArg(1)); return 0; } static int SetSecondsPauseBetweenItems( T* p, lua_State *L ) { p->SetSecondsPauseBetweenItems(FArg(1)); COMMON_RETURN_SELF; }
static int SetPauseCountdownSeconds( T* p, lua_State *L ) { p->SetPauseCountdownSeconds(FArg(1)); return 0; } static int SetPauseCountdownSeconds( T* p, lua_State *L ) { p->SetPauseCountdownSeconds(FArg(1)); COMMON_RETURN_SELF; }
static int SetNumSubdivisions( T* p, lua_State *L ) { p->SetNumSubdivisions(IArg(1)); return 0; } static int SetNumSubdivisions( T* p, lua_State *L ) { p->SetNumSubdivisions(IArg(1)); COMMON_RETURN_SELF; }
static int ScrollThroughAllItems( T* p, lua_State *L ) { p->ScrollThroughAllItems(); return 0; } static int ScrollThroughAllItems( T* p, lua_State *L ) { p->ScrollThroughAllItems(); COMMON_RETURN_SELF; }
static int ScrollWithPadding( T* p, lua_State *L ) { p->ScrollWithPadding(FArg(1),FArg(2)); return 0; } static int ScrollWithPadding( T* p, lua_State *L ) { p->ScrollWithPadding(FArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int SetFastCatchup( T* p, lua_State *L ) { p->SetFastCatchup(BArg(1)); return 0; } static int SetFastCatchup( T* p, lua_State *L ) { p->SetFastCatchup(BArg(1)); COMMON_RETURN_SELF; }
static int SetLoop( T* p, lua_State *L ) { p->SetLoop(BArg(1)); return 0; } static int SetLoop( T* p, lua_State *L ) { p->SetLoop(BArg(1)); COMMON_RETURN_SELF; }
static int SetWrap( T* p, lua_State *L ) { p->SetWrap(BArg(1)); return 0; } static int SetWrap( T* p, lua_State *L ) { p->SetWrap(BArg(1)); COMMON_RETURN_SELF; }
static int SetMask( T* p, lua_State *L ) { p->EnableMask(FArg(1), FArg(2)); return 0; } static int SetMask( T* p, lua_State *L ) { p->EnableMask(FArg(1), FArg(2)); COMMON_RETURN_SELF; }
static int SetNumItemsToDraw( T* p, lua_State *L ) { p->SetNumItemsToDraw(FArg(1)); return 0; } static int SetNumItemsToDraw( T* p, lua_State *L ) { p->SetNumItemsToDraw(FArg(1)); COMMON_RETURN_SELF; }
static int GetFullScrollLengthSeconds( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsForCompleteScrollThrough() ); return 1; } static int GetFullScrollLengthSeconds( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsForCompleteScrollThrough() ); return 1; }
static int GetCurrentItem( T* p, lua_State *L ) { lua_pushnumber( L, p->GetCurrentItem() ); return 1; } static int GetCurrentItem( T* p, lua_State *L ) { lua_pushnumber( L, p->GetCurrentItem() ); return 1; }
static int GetDestinationItem( T* p, lua_State *L ) { lua_pushnumber( L, p->GetDestinationItem() ); return 1; } static int GetDestinationItem( T* p, lua_State *L ) { lua_pushnumber( L, p->GetDestinationItem() ); return 1; }
+4 -4
View File
@@ -50,10 +50,10 @@ void ActorSound::LoadFromNode( const XNode* pNode )
class LunaActorSound: public Luna<ActorSound> class LunaActorSound: public Luna<ActorSound>
{ {
public: public:
static int load( T* p, lua_State *L ) { p->Load(SArg(1)); return 0; } static int load( T* p, lua_State *L ) { p->Load(SArg(1)); COMMON_RETURN_SELF; }
static int play( T* p, lua_State *L ) { p->Play(); return 0; } static int play( T* p, lua_State *L ) { p->Play(); COMMON_RETURN_SELF; }
static int pause( T* p, lua_State *L ) { p->Pause(BArg(1)); return 0; } static int pause( T* p, lua_State *L ) { p->Pause(BArg(1)); COMMON_RETURN_SELF; }
static int stop( T* p, lua_State *L ) { p->Stop(); return 0; } static int stop( T* p, lua_State *L ) { p->Stop(); COMMON_RETURN_SELF; }
static int get( T* p, lua_State *L ) { p->PushSound( L ); return 1; } static int get( T* p, lua_State *L ) { p->PushSound( L ); return 1; }
LunaActorSound() LunaActorSound()
+8 -3
View File
@@ -195,8 +195,13 @@ public:
{ {
RString s = p->GetCurAnnouncerName(); RString s = p->GetCurAnnouncerName();
if( s.empty() ) if( s.empty() )
return 0; {
lua_pushstring(L, s ); lua_pushnil(L);
}
else
{
lua_pushstring(L, s );
}
return 1; return 1;
} }
static int SetCurrentAnnouncer( T* p, lua_State *L ) static int SetCurrentAnnouncer( T* p, lua_State *L )
@@ -205,7 +210,7 @@ public:
// only bother switching if the announcer exists. -aj // only bother switching if the announcer exists. -aj
if(p->DoesAnnouncerExist(s)) if(p->DoesAnnouncerExist(s))
p->SwitchAnnouncer(s); p->SwitchAnnouncer(s);
return 0; COMMON_RETURN_SELF;
} }
LunaAnnouncerManager() LunaAnnouncerManager()
+4 -4
View File
@@ -307,7 +307,7 @@ REGISTER_ACTOR_CLASS( SongBPMDisplay );
class LunaBPMDisplay: public Luna<BPMDisplay> class LunaBPMDisplay: public Luna<BPMDisplay>
{ {
public: public:
static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); return 0; } static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); COMMON_RETURN_SELF; }
static int SetFromSong( T* p, lua_State *L ) static int SetFromSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->NoBPM(); } if( lua_isnil(L,1) ) { p->NoBPM(); }
@@ -316,7 +316,7 @@ public:
const Song* pSong = Luna<Song>::check( L, 1, true ); const Song* pSong = Luna<Song>::check( L, 1, true );
p->SetBpmFromSong(pSong); p->SetBpmFromSong(pSong);
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetFromSteps( T* p, lua_State *L ) static int SetFromSteps( T* p, lua_State *L )
{ {
@@ -326,7 +326,7 @@ public:
const Steps* pSteps = Luna<Steps>::check( L, 1, true ); const Steps* pSteps = Luna<Steps>::check( L, 1, true );
p->SetBpmFromSteps(pSteps); p->SetBpmFromSteps(pSteps);
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetFromCourse( T* p, lua_State *L ) static int SetFromCourse( T* p, lua_State *L )
{ {
@@ -336,7 +336,7 @@ public:
const Course* pCourse = Luna<Course>::check( L, 1, true ); const Course* pCourse = Luna<Course>::check( L, 1, true );
p->SetBpmFromCourse(pCourse); p->SetBpmFromCourse(pCourse);
} }
return 0; COMMON_RETURN_SELF;
} }
static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; } static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; }
+12 -12
View File
@@ -244,53 +244,53 @@ void Banner::LoadFromSortOrder( SortOrder so )
class LunaBanner: public Luna<Banner> class LunaBanner: public Luna<Banner>
{ {
public: public:
static int scaletoclipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; } static int scaletoclipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; } static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int LoadFromSong( T* p, lua_State *L ) static int LoadFromSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromSong( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromSong( NULL ); }
else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); } else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadFromCourse( T* p, lua_State *L ) static int LoadFromCourse( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromCourse( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromCourse( NULL ); }
else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); } else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadFromCachedBanner( T* p, lua_State *L ) static int LoadFromCachedBanner( T* p, lua_State *L )
{ {
p->LoadFromCachedBanner( SArg(1) ); p->LoadFromCachedBanner( SArg(1) );
return 0; COMMON_RETURN_SELF;
} }
static int LoadIconFromCharacter( T* p, lua_State *L ) static int LoadIconFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadCardFromCharacter( T* p, lua_State *L ) static int LoadCardFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadBannerFromUnlockEntry( T* p, lua_State *L ) static int LoadBannerFromUnlockEntry( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadBannerFromUnlockEntry( NULL ); } if( lua_isnil(L,1) ) { p->LoadBannerFromUnlockEntry( NULL ); }
else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBannerFromUnlockEntry( pUE ); } else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBannerFromUnlockEntry( pUE ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadBackgroundFromUnlockEntry( T* p, lua_State *L ) static int LoadBackgroundFromUnlockEntry( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadBackgroundFromUnlockEntry( NULL ); } if( lua_isnil(L,1) ) { p->LoadBackgroundFromUnlockEntry( NULL ); }
else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBackgroundFromUnlockEntry( pUE ); } else { UnlockEntry *pUE = Luna<UnlockEntry>::check(L,1); p->LoadBackgroundFromUnlockEntry( pUE ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadFromSongGroup( T* p, lua_State *L ) static int LoadFromSongGroup( T* p, lua_State *L )
{ {
p->LoadFromSongGroup( SArg(1) ); p->LoadFromSongGroup( SArg(1) );
return 0; COMMON_RETURN_SELF;
} }
static int LoadFromSortOrder( T* p, lua_State *L ) static int LoadFromSortOrder( T* p, lua_State *L )
{ {
@@ -300,10 +300,10 @@ public:
SortOrder so = Enum::Check<SortOrder>(L, 1); SortOrder so = Enum::Check<SortOrder>(L, 1);
p->LoadFromSortOrder( so ); p->LoadFromSortOrder( so );
} }
return 0; COMMON_RETURN_SELF;
} }
static int GetScrolling( T* p, lua_State *L ){ lua_pushboolean( L, p->GetScrolling() ); return 1; } static int GetScrolling( T* p, lua_State *L ){ lua_pushboolean( L, p->GetScrolling() ); return 1; }
static int SetScrolling( T* p, lua_State *L ){ p->SetScrolling( BArg(1), FArg(2) ); return 0; } static int SetScrolling( T* p, lua_State *L ){ p->SetScrolling( BArg(1), FArg(2) ); COMMON_RETURN_SELF; }
static int GetPercentScrolling( T* p, lua_State *L ){ lua_pushnumber( L, p->ScrollingPercent() ); return 1; } static int GetPercentScrolling( T* p, lua_State *L ){ lua_pushnumber( L, p->ScrollingPercent() ); return 1; }
LunaBanner() LunaBanner()
+14 -14
View File
@@ -916,19 +916,19 @@ void BitmapText::Attribute::FromStack( lua_State *L, int iPos )
class LunaBitmapText: public Luna<BitmapText> class LunaBitmapText: public Luna<BitmapText>
{ {
public: public:
static int wrapwidthpixels( T* p, lua_State *L ) { p->SetWrapWidthPixels( IArg(1) ); return 0; } static int wrapwidthpixels( T* p, lua_State *L ) { p->SetWrapWidthPixels( IArg(1) ); COMMON_RETURN_SELF; }
#define MAX_DIMENSION(maxdimension, SetMaxDimension) \ #define MAX_DIMENSION(maxdimension, SetMaxDimension) \
static int maxdimension( T* p, lua_State *L ) \ static int maxdimension( T* p, lua_State *L ) \
{ p->SetMaxDimension(FArg(1)); return 0; } { p->SetMaxDimension(FArg(1)); COMMON_RETURN_SELF; }
MAX_DIMENSION(maxwidth, SetMaxWidth); MAX_DIMENSION(maxwidth, SetMaxWidth);
MAX_DIMENSION(maxheight, SetMaxHeight); MAX_DIMENSION(maxheight, SetMaxHeight);
#undef MAX_DIMENSION #undef MAX_DIMENSION
static int max_dimension_use_zoom(T* p, lua_State* L) static int max_dimension_use_zoom(T* p, lua_State* L)
{ {
p->SetMaxDimUseZoom(lua_toboolean(L, 1)); p->SetMaxDimUseZoom(lua_toboolean(L, 1));
return 0; COMMON_RETURN_SELF;
} }
static int vertspacing( T* p, lua_State *L ) { p->SetVertSpacing( IArg(1) ); return 0; } static int vertspacing( T* p, lua_State *L ) { p->SetVertSpacing( IArg(1) ); COMMON_RETURN_SELF; }
static int settext( T* p, lua_State *L ) static int settext( T* p, lua_State *L )
{ {
RString s = SArg(1); RString s = SArg(1);
@@ -949,12 +949,12 @@ public:
} }
p->SetText( s, sAlt ); p->SetText( s, sAlt );
return 0; COMMON_RETURN_SELF;
} }
static int rainbowscroll( T* p, lua_State *L ) { p->SetRainbowScroll( BArg(1) ); return 0; } static int rainbowscroll( T* p, lua_State *L ) { p->SetRainbowScroll( BArg(1) ); COMMON_RETURN_SELF; }
static int jitter( T* p, lua_State *L ) { p->SetJitter( BArg(1) ); return 0; } static int jitter( T* p, lua_State *L ) { p->SetJitter( BArg(1) ); COMMON_RETURN_SELF; }
static int distort( T* p, lua_State *L) { p->SetDistortion( FArg(1) ); return 0; } static int distort( T* p, lua_State *L) { p->SetDistortion( FArg(1) ); COMMON_RETURN_SELF; }
static int undistort( T* p, lua_State *L) { p->UnSetDistortion(); return 0; } static int undistort( T* p, lua_State *L) { p->UnSetDistortion(); COMMON_RETURN_SELF; }
static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; } static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; }
static int AddAttribute( T* p, lua_State *L ) static int AddAttribute( T* p, lua_State *L )
{ {
@@ -963,13 +963,13 @@ public:
attr.FromStack( L, 2 ); attr.FromStack( L, 2 );
p->AddAttribute( iPos, attr ); p->AddAttribute( iPos, attr );
return 0; COMMON_RETURN_SELF;
} }
static int ClearAttributes( T* p, lua_State * ) { p->ClearAttributes(); return 0; } static int ClearAttributes( T* p, lua_State *L ) { p->ClearAttributes(); COMMON_RETURN_SELF; }
static int strokecolor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetStrokeColor( c ); return 0; } static int strokecolor( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetStrokeColor( c ); COMMON_RETURN_SELF; }
DEFINE_METHOD(getstrokecolor, GetStrokeColor()); DEFINE_METHOD(getstrokecolor, GetStrokeColor());
static int uppercase( T* p, lua_State *L ) { p->SetUppercase( BArg(1) ); return 0; } static int uppercase( T* p, lua_State *L ) { p->SetUppercase( BArg(1) ); COMMON_RETURN_SELF; }
static int textglowmode( T* p, lua_State *L ) { p->SetTextGlowMode( Enum::Check<TextGlowMode>(L, 1) ); return 0; } static int textglowmode( T* p, lua_State *L ) { p->SetTextGlowMode( Enum::Check<TextGlowMode>(L, 1) ); COMMON_RETURN_SELF; }
LunaBitmapText() LunaBitmapText()
{ {
+2 -2
View File
@@ -140,14 +140,14 @@ public:
static int Load( T* p, lua_State *L ) static int Load( T* p, lua_State *L )
{ {
p->Load( SArg(1) ); p->Load( SArg(1) );
return 0; COMMON_RETURN_SELF;
} }
static int Set( T* p, lua_State *L ) static int Set( T* p, lua_State *L )
{ {
StageStats *pStageStats = Luna<StageStats>::check( L, 1 ); StageStats *pStageStats = Luna<StageStats>::check( L, 1 );
PlayerStageStats *pPlayerStageStats = Luna<PlayerStageStats>::check( L, 2 ); PlayerStageStats *pPlayerStageStats = Luna<PlayerStageStats>::check( L, 2 );
p->Set( *pStageStats, *pPlayerStageStats ); p->Set( *pStageStats, *pPlayerStageStats );
return 0; COMMON_RETURN_SELF;
} }
LunaComboGraph() LunaComboGraph()
+2 -2
View File
@@ -100,8 +100,8 @@ void ControllerStateDisplay::Update( float fDelta )
class LunaControllerStateDisplay: public Luna<ControllerStateDisplay> class LunaControllerStateDisplay: public Luna<ControllerStateDisplay>
{ {
public: public:
static int LoadGameController( T* p, lua_State *L ) { p->LoadGameController( SArg(1), Enum::Check<GameController>(L, 2) ); return 0; } static int LoadGameController( T* p, lua_State *L ) { p->LoadGameController( SArg(1), Enum::Check<GameController>(L, 2) ); COMMON_RETURN_SELF; }
static int LoadMultiPlayer( T* p, lua_State *L ) { p->LoadMultiPlayer( SArg(1), Enum::Check<MultiPlayer>(L, 2) ); return 0; } static int LoadMultiPlayer( T* p, lua_State *L ) { p->LoadMultiPlayer( SArg(1), Enum::Check<MultiPlayer>(L, 2) ); COMMON_RETURN_SELF; }
LunaControllerStateDisplay() LunaControllerStateDisplay()
{ {
+1 -1
View File
@@ -154,7 +154,7 @@ void CourseContentsList::SetItemFromGameState( Actor *pActor, int iCourseEntryIn
class LunaCourseContentsList: public Luna<CourseContentsList> class LunaCourseContentsList: public Luna<CourseContentsList>
{ {
public: public:
static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); return 0; } static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); COMMON_RETURN_SELF; }
LunaCourseContentsList() LunaCourseContentsList()
{ {
+5 -5
View File
@@ -111,7 +111,7 @@ public:
Steps *pS = Luna<Steps>::check(L,1); Steps *pS = Luna<Steps>::check(L,1);
p->SetFromSteps( PLAYER_1, pS ); p->SetFromSteps( PLAYER_1, pS );
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetFromTrail( T* p, lua_State *L ) static int SetFromTrail( T* p, lua_State *L )
{ {
@@ -124,11 +124,11 @@ public:
Trail *pT = Luna<Trail>::check(L,1); Trail *pT = Luna<Trail>::check(L,1);
p->SetFromTrail( PLAYER_1, pT ); p->SetFromTrail( PLAYER_1, pT );
} }
return 0; COMMON_RETURN_SELF;
} }
static int Unset( T* p, lua_State *L ) { p->Unset(); return 0; } static int Unset( T* p, lua_State *L ) { p->Unset(); COMMON_RETURN_SELF; }
static int SetPlayer( T* p, lua_State *L ) { p->SetPlayer( Enum::Check<PlayerNumber>(L, 1) ); return 0; } static int SetPlayer( T* p, lua_State *L ) { p->SetPlayer( Enum::Check<PlayerNumber>(L, 1) ); COMMON_RETURN_SELF; }
static int SetFromDifficulty( T* p, lua_State *L ) { p->SetFromDifficulty( Enum::Check<Difficulty>(L, 1) ); return 0; } static int SetFromDifficulty( T* p, lua_State *L ) { p->SetFromDifficulty( Enum::Check<Difficulty>(L, 1) ); COMMON_RETURN_SELF; }
LunaDifficultyIcon() LunaDifficultyIcon()
{ {
+1 -1
View File
@@ -389,7 +389,7 @@ void StepsDisplayList::HandleMessage( const Message &msg )
class LunaStepsDisplayList: public Luna<StepsDisplayList> class LunaStepsDisplayList: public Luna<StepsDisplayList>
{ {
public: public:
static int setfromgamestate( T* p, lua_State *L ) { p->SetFromGameState(); return 0; } static int setfromgamestate( T* p, lua_State *L ) { p->SetFromGameState(); COMMON_RETURN_SELF; }
LunaStepsDisplayList() LunaStepsDisplayList()
{ {
+12 -12
View File
@@ -268,37 +268,37 @@ void FadingBanner::LoadCustom( RString sBanner )
class LunaFadingBanner: public Luna<FadingBanner> class LunaFadingBanner: public Luna<FadingBanner>
{ {
public: public:
static int scaletoclipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; } static int scaletoclipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); return 0; } static int ScaleToClipped( T* p, lua_State *L ) { p->ScaleToClipped(FArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int LoadFromSong( T* p, lua_State *L ) static int LoadFromSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromSong( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromSong( NULL ); }
else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); } else { Song *pS = Luna<Song>::check(L,1); p->LoadFromSong( pS ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadFromCourse( T* p, lua_State *L ) static int LoadFromCourse( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromCourse( NULL ); } if( lua_isnil(L,1) ) { p->LoadFromCourse( NULL ); }
else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); } else { Course *pC = Luna<Course>::check(L,1); p->LoadFromCourse( pC ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadIconFromCharacter( T* p, lua_State *L ) static int LoadIconFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadCardFromCharacter( T* p, lua_State *L ) static int LoadCardFromCharacter( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); } if( lua_isnil(L,1) ) { p->LoadIconFromCharacter( NULL ); }
else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); } else { Character *pC = Luna<Character>::check(L,1); p->LoadIconFromCharacter( pC ); }
return 0; COMMON_RETURN_SELF;
} }
static int LoadFromSongGroup( T* p, lua_State *L ) { p->LoadFromSongGroup( SArg(1) ); return 0; } static int LoadFromSongGroup( T* p, lua_State *L ) { p->LoadFromSongGroup( SArg(1) ); COMMON_RETURN_SELF; }
static int LoadRandom( T* p, lua_State *L ) { p->LoadRandom(); return 0; } static int LoadRandom( T* p, lua_State *L ) { p->LoadRandom(); COMMON_RETURN_SELF; }
static int LoadRoulette( T* p, lua_State *L ) { p->LoadRoulette(); return 0; } static int LoadRoulette( T* p, lua_State *L ) { p->LoadRoulette(); COMMON_RETURN_SELF; }
static int LoadCourseFallback( T* p, lua_State *L ) { p->LoadCourseFallback(); return 0; } static int LoadCourseFallback( T* p, lua_State *L ) { p->LoadCourseFallback(); COMMON_RETURN_SELF; }
static int LoadFallback( T* p, lua_State *L ) { p->LoadFallback(); return 0; } static int LoadFallback( T* p, lua_State *L ) { p->LoadFallback(); COMMON_RETURN_SELF; }
static int LoadFromSortOrder( T* p, lua_State *L ) static int LoadFromSortOrder( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->LoadFromSortOrder( SortOrder_Invalid ); } if( lua_isnil(L,1) ) { p->LoadFromSortOrder( SortOrder_Invalid ); }
@@ -307,7 +307,7 @@ public:
SortOrder so = Enum::Check<SortOrder>(L, 1); SortOrder so = Enum::Check<SortOrder>(L, 1);
p->LoadFromSortOrder( so ); p->LoadFromSortOrder( so );
} }
return 0; COMMON_RETURN_SELF;
} }
static int GetLatestIndex( T* p, lua_State *L ){ lua_pushnumber( L, p->GetLatestIndex() ); return 1; } static int GetLatestIndex( T* p, lua_State *L ){ lua_pushnumber( L, p->GetLatestIndex() ); return 1; }
+5 -5
View File
@@ -795,19 +795,19 @@ public:
float fVolume = FArg(1); float fVolume = FArg(1);
float fDurationSeconds = FArg(2); float fDurationSeconds = FArg(2);
p->DimMusic( fVolume, fDurationSeconds ); p->DimMusic( fVolume, fDurationSeconds );
return 0; COMMON_RETURN_SELF;
} }
static int PlayOnce( T* p, lua_State *L ) static int PlayOnce( T* p, lua_State *L )
{ {
RString sPath = SArg(1); RString sPath = SArg(1);
p->PlayOnce( sPath ); p->PlayOnce( sPath );
return 0; COMMON_RETURN_SELF;
} }
static int PlayAnnouncer( T* p, lua_State *L ) static int PlayAnnouncer( T* p, lua_State *L )
{ {
RString sPath = SArg(1); RString sPath = SArg(1);
p->PlayOnceFromAnnouncer( sPath ); p->PlayOnceFromAnnouncer( sPath );
return 0; COMMON_RETURN_SELF;
} }
static int GetPlayerBalance( T* p, lua_State *L ) static int GetPlayerBalance( T* p, lua_State *L )
{ {
@@ -847,10 +847,10 @@ public:
} }
p->PlayMusic(musicPath, NULL, loop, musicStart, musicLength, p->PlayMusic(musicPath, NULL, loop, musicStart, musicLength,
fadeIn, fadeOut, alignBeat, applyRate); fadeIn, fadeOut, alignBeat, applyRate);
return 0; COMMON_RETURN_SELF;
} }
static int StopMusic( T* p, lua_State *L ) { p->StopMusic(); return 0; } static int StopMusic( T* p, lua_State *L ) { p->StopMusic(); COMMON_RETURN_SELF; }
static int IsTimingDelayed( T* p, lua_State *L ) { lua_pushboolean( L, g_Playing->m_bTimingDelayed ); return 1; } static int IsTimingDelayed( T* p, lua_State *L ) { lua_pushboolean( L, g_Playing->m_bTimingDelayed ); return 1; }
LunaGameSoundManager() LunaGameSoundManager()
+33 -34
View File
@@ -2272,7 +2272,7 @@ public:
static int SetMultiplayer( T* p, lua_State *L ) static int SetMultiplayer( T* p, lua_State *L )
{ {
p->m_bMultiplayer = BArg(1); p->m_bMultiplayer = BArg(1);
return 0; COMMON_RETURN_SELF;
} }
DEFINE_METHOD( InStepEditor, m_bInStepEditor ); DEFINE_METHOD( InStepEditor, m_bInStepEditor );
DEFINE_METHOD( GetNumMultiplayerNoteFields, m_iNumMultiplayerNoteFields ) DEFINE_METHOD( GetNumMultiplayerNoteFields, m_iNumMultiplayerNoteFields )
@@ -2281,7 +2281,7 @@ public:
static int SetNumMultiplayerNoteFields( T* p, lua_State *L ) static int SetNumMultiplayerNoteFields( T* p, lua_State *L )
{ {
p->m_iNumMultiplayerNoteFields = IArg(1); p->m_iNumMultiplayerNoteFields = IArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int GetPlayerState( T* p, lua_State *L ) static int GetPlayerState( T* p, lua_State *L )
{ {
@@ -2310,14 +2310,14 @@ public:
pn = Enum::Check<PlayerNumber>(L, 2); pn = Enum::Check<PlayerNumber>(L, 2);
} }
p->ApplyGameCommand(SArg(1),pn); p->ApplyGameCommand(SArg(1),pn);
return 0; COMMON_RETURN_SELF;
} }
static int GetCurrentSong( T* p, lua_State *L ) { if(p->m_pCurSong) p->m_pCurSong->PushSelf(L); else lua_pushnil(L); return 1; } static int GetCurrentSong( T* p, lua_State *L ) { if(p->m_pCurSong) p->m_pCurSong->PushSelf(L); else lua_pushnil(L); return 1; }
static int SetCurrentSong( T* p, lua_State *L ) static int SetCurrentSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->m_pCurSong.Set( NULL ); } if( lua_isnil(L,1) ) { p->m_pCurSong.Set( NULL ); }
else { Song *pS = Luna<Song>::check( L, 1, true ); p->m_pCurSong.Set( pS ); } else { Song *pS = Luna<Song>::check( L, 1, true ); p->m_pCurSong.Set( pS ); }
return 0; COMMON_RETURN_SELF;
} }
static void SetCompatibleStyleOrError(T* p, lua_State* L, StepsType stype) static void SetCompatibleStyleOrError(T* p, lua_State* L, StepsType stype)
{ {
@@ -2351,14 +2351,14 @@ public:
SetCompatibleStyleOrError(p, L, pS->m_StepsType); SetCompatibleStyleOrError(p, L, pS->m_StepsType);
p->m_pCurSteps[pn].Set(pS); p->m_pCurSteps[pn].Set(pS);
} }
return 0; COMMON_RETURN_SELF;
} }
static int GetCurrentCourse( T* p, lua_State *L ) { if(p->m_pCurCourse) p->m_pCurCourse->PushSelf(L); else lua_pushnil(L); return 1; } static int GetCurrentCourse( T* p, lua_State *L ) { if(p->m_pCurCourse) p->m_pCurCourse->PushSelf(L); else lua_pushnil(L); return 1; }
static int SetCurrentCourse( T* p, lua_State *L ) static int SetCurrentCourse( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->m_pCurCourse.Set( NULL ); } if( lua_isnil(L,1) ) { p->m_pCurCourse.Set( NULL ); }
else { Course *pC = Luna<Course>::check(L,1); p->m_pCurCourse.Set( pC ); } else { Course *pC = Luna<Course>::check(L,1); p->m_pCurCourse.Set( pC ); }
return 0; COMMON_RETURN_SELF;
} }
static int GetCurrentTrail( T* p, lua_State *L ) static int GetCurrentTrail( T* p, lua_State *L )
{ {
@@ -2381,16 +2381,16 @@ public:
SetCompatibleStyleOrError(p, L, pS->m_StepsType); SetCompatibleStyleOrError(p, L, pS->m_StepsType);
p->m_pCurTrail[pn].Set(pS); p->m_pCurTrail[pn].Set(pS);
} }
return 0; COMMON_RETURN_SELF;
} }
static int GetPreferredSong( T* p, lua_State *L ) { if(p->m_pPreferredSong) p->m_pPreferredSong->PushSelf(L); else lua_pushnil(L); return 1; } static int GetPreferredSong( T* p, lua_State *L ) { if(p->m_pPreferredSong) p->m_pPreferredSong->PushSelf(L); else lua_pushnil(L); return 1; }
static int SetPreferredSong( T* p, lua_State *L ) static int SetPreferredSong( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) { p->m_pPreferredSong = NULL; } if( lua_isnil(L,1) ) { p->m_pPreferredSong = NULL; }
else { Song *pS = Luna<Song>::check(L,1); p->m_pPreferredSong = pS; } else { Song *pS = Luna<Song>::check(L,1); p->m_pPreferredSong = pS; }
return 0; COMMON_RETURN_SELF;
} }
static int SetTemporaryEventMode( T* p, lua_State *L ) { p->m_bTemporaryEventMode = BArg(1); return 0; } static int SetTemporaryEventMode( T* p, lua_State *L ) { p->m_bTemporaryEventMode = BArg(1); COMMON_RETURN_SELF; }
static int Env( T* p, lua_State *L ) { p->m_Environment->PushSelf(L); return 1; } static int Env( T* p, lua_State *L ) { p->m_Environment->PushSelf(L); return 1; }
static int GetEditSourceSteps( T* p, lua_State *L ) static int GetEditSourceSteps( T* p, lua_State *L )
{ {
@@ -2404,7 +2404,7 @@ public:
PlayerNumber pn = Enum::Check<PlayerNumber>( L, 1 ); PlayerNumber pn = Enum::Check<PlayerNumber>( L, 1 );
Difficulty dc = Enum::Check<Difficulty>( L, 2 ); Difficulty dc = Enum::Check<Difficulty>( L, 2 );
p->m_PreferredDifficulty[pn].Set( dc ); p->m_PreferredDifficulty[pn].Set( dc );
return 0; COMMON_RETURN_SELF;
} }
DEFINE_METHOD( GetPreferredDifficulty, m_PreferredDifficulty[Enum::Check<PlayerNumber>(L, 1)] ) DEFINE_METHOD( GetPreferredDifficulty, m_PreferredDifficulty[Enum::Check<PlayerNumber>(L, 1)] )
DEFINE_METHOD( AnyPlayerHasRankingFeats, AnyPlayerHasRankingFeats() ) DEFINE_METHOD( AnyPlayerHasRankingFeats, AnyPlayerHasRankingFeats() )
@@ -2473,17 +2473,17 @@ public:
static int ApplyStageModifiers( T* p, lua_State *L ) static int ApplyStageModifiers( T* p, lua_State *L )
{ {
p->ApplyStageModifiers( Enum::Check<PlayerNumber>(L, 1), SArg(2) ); p->ApplyStageModifiers( Enum::Check<PlayerNumber>(L, 1), SArg(2) );
return 0; COMMON_RETURN_SELF;
} }
static int ApplyPreferredModifiers( T* p, lua_State *L ) static int ApplyPreferredModifiers( T* p, lua_State *L )
{ {
p->ApplyPreferredModifiers( Enum::Check<PlayerNumber>(L, 1), SArg(2) ); p->ApplyPreferredModifiers( Enum::Check<PlayerNumber>(L, 1), SArg(2) );
return 0; COMMON_RETURN_SELF;
} }
static int ClearStageModifiersIllegalForCourse( T* p, lua_State *L ) static int ClearStageModifiersIllegalForCourse( T* p, lua_State *L )
{ {
p->ClearStageModifiersIllegalForCourse(); p->ClearStageModifiersIllegalForCourse();
return 0; COMMON_RETURN_SELF;
} }
static int SetSongOptions( T* p, lua_State *L ) static int SetSongOptions( T* p, lua_State *L )
{ {
@@ -2493,7 +2493,7 @@ public:
so.FromString( SArg(2) ); so.FromString( SArg(2) );
p->m_SongOptions.Assign( m, so ); p->m_SongOptions.Assign( m, so );
return 0; COMMON_RETURN_SELF;
} }
static int GetStageResult( T* p, lua_State *L ) static int GetStageResult( T* p, lua_State *L )
{ {
@@ -2511,7 +2511,6 @@ public:
lua_pushboolean(L, p->GetStageResult(PLAYER_1)==RESULT_DRAW); return 1; lua_pushboolean(L, p->GetStageResult(PLAYER_1)==RESULT_DRAW); return 1;
} }
static int GetCurrentGame( T* p, lua_State *L ) { const_cast<Game*>(p->GetCurrentGame())->PushSelf( L ); return 1; } static int GetCurrentGame( T* p, lua_State *L ) { const_cast<Game*>(p->GetCurrentGame())->PushSelf( L ); return 1; }
//static int SetCurrentGame( T* p, lua_State *L ) { p->SetCurrentGame( GAMEMAN->StringToGame( SArg(1) ) ); return 0; }
DEFINE_METHOD( GetEditCourseEntryIndex, m_iEditCourseEntryIndex ) DEFINE_METHOD( GetEditCourseEntryIndex, m_iEditCourseEntryIndex )
DEFINE_METHOD( GetEditLocalProfileID, m_sEditLocalProfileID.Get() ) DEFINE_METHOD( GetEditLocalProfileID, m_sEditLocalProfileID.Get() )
static int GetEditLocalProfile( T* p, lua_State *L ) static int GetEditLocalProfile( T* p, lua_State *L )
@@ -2554,7 +2553,7 @@ public:
return vpStepsToShow.size()*2; return vpStepsToShow.size()*2;
} }
static int SetPreferredSongGroup( T* p, lua_State *L ) { p->m_sPreferredSongGroup.Set( SArg(1) ); return 0; } static int SetPreferredSongGroup( T* p, lua_State *L ) { p->m_sPreferredSongGroup.Set( SArg(1) ); COMMON_RETURN_SELF; }
DEFINE_METHOD( GetPreferredSongGroup, m_sPreferredSongGroup.Get() ); DEFINE_METHOD( GetPreferredSongGroup, m_sPreferredSongGroup.Get() );
static int GetHumanPlayers( T* p, lua_State *L ) static int GetHumanPlayers( T* p, lua_State *L )
{ {
@@ -2602,15 +2601,15 @@ public:
} }
static int GetGameSeed( T* p, lua_State *L ) { LuaHelpers::Push( L, p->m_iGameSeed ); return 1; } static int GetGameSeed( T* p, lua_State *L ) { LuaHelpers::Push( L, p->m_iGameSeed ); return 1; }
static int GetStageSeed( T* p, lua_State *L ) { LuaHelpers::Push( L, p->m_iStageSeed ); return 1; } static int GetStageSeed( T* p, lua_State *L ) { LuaHelpers::Push( L, p->m_iStageSeed ); return 1; }
static int SaveLocalData( T* p, lua_State *L ) { p->SaveLocalData(); return 0; } static int SaveLocalData( T* p, lua_State *L ) { p->SaveLocalData(); COMMON_RETURN_SELF; }
static int SetJukeboxUsesModifiers( T* p, lua_State *L ) static int SetJukeboxUsesModifiers( T* p, lua_State *L )
{ {
p->m_bJukeboxUsesModifiers = BArg(1); return 0; p->m_bJukeboxUsesModifiers = BArg(1); COMMON_RETURN_SELF;
} }
static int Reset( T* p, lua_State *L ) { p->Reset(); return 0; } static int Reset( T* p, lua_State *L ) { p->Reset(); COMMON_RETURN_SELF; }
static int JoinPlayer( T* p, lua_State *L ) { p->JoinPlayer(Enum::Check<PlayerNumber>(L, 1)); return 0; } static int JoinPlayer( T* p, lua_State *L ) { p->JoinPlayer(Enum::Check<PlayerNumber>(L, 1)); COMMON_RETURN_SELF; }
static int UnjoinPlayer( T* p, lua_State *L ) { p->UnjoinPlayer(Enum::Check<PlayerNumber>(L, 1)); return 0; } static int UnjoinPlayer( T* p, lua_State *L ) { p->UnjoinPlayer(Enum::Check<PlayerNumber>(L, 1)); COMMON_RETURN_SELF; }
static int JoinInput( T* p, lua_State *L ) static int JoinInput( T* p, lua_State *L )
{ {
lua_pushboolean(L, p->JoinInput(Enum::Check<PlayerNumber>(L, 1))); lua_pushboolean(L, p->JoinInput(Enum::Check<PlayerNumber>(L, 1)));
@@ -2625,10 +2624,10 @@ public:
Character* c = CHARMAN->GetCharacterFromID(SArg(2)); Character* c = CHARMAN->GetCharacterFromID(SArg(2));
if (c) if (c)
p->m_pCurCharacters[Enum::Check<PlayerNumber>(L, 1)] = c; p->m_pCurCharacters[Enum::Check<PlayerNumber>(L, 1)] = c;
return 0; COMMON_RETURN_SELF;
} }
static int GetExpandedSectionName( T* p, lua_State *L ) { lua_pushstring(L, p->sExpandedSectionName); return 1; } static int GetExpandedSectionName( T* p, lua_State *L ) { lua_pushstring(L, p->sExpandedSectionName); return 1; }
static int AddStageToPlayer( T* p, lua_State *L ) { p->AddStageToPlayer(Enum::Check<PlayerNumber>(L, 1)); return 0; } static int AddStageToPlayer( T* p, lua_State *L ) { p->AddStageToPlayer(Enum::Check<PlayerNumber>(L, 1)); COMMON_RETURN_SELF; }
static int InsertCoin( T* p, lua_State *L ) static int InsertCoin( T* p, lua_State *L )
{ {
int numCoins = IArg(1); int numCoins = IArg(1);
@@ -2639,25 +2638,25 @@ public:
// Warn themers if they attempt to set credits to a negative value. // Warn themers if they attempt to set credits to a negative value.
luaL_error( L, "Credits may not be negative." ); luaL_error( L, "Credits may not be negative." );
} }
return 0; COMMON_RETURN_SELF;
} }
static int InsertCredit( T* p, lua_State *L ) static int InsertCredit( T* p, lua_State *L )
{ {
StepMania::InsertCredit(); StepMania::InsertCredit();
return 0; COMMON_RETURN_SELF;
} }
static int CurrentOptionsDisqualifyPlayer( T* p, lua_State *L ) { lua_pushboolean(L, p->CurrentOptionsDisqualifyPlayer(Enum::Check<PlayerNumber>(L, 1))); return 1; } static int CurrentOptionsDisqualifyPlayer( T* p, lua_State *L ) { lua_pushboolean(L, p->CurrentOptionsDisqualifyPlayer(Enum::Check<PlayerNumber>(L, 1))); return 1; }
static int ResetPlayerOptions( T* p, lua_State *L ) static int ResetPlayerOptions( T* p, lua_State *L )
{ {
p->ResetPlayerOptions(Enum::Check<PlayerNumber>(L, 1)); p->ResetPlayerOptions(Enum::Check<PlayerNumber>(L, 1));
return 0; COMMON_RETURN_SELF;
} }
static int RefreshNoteSkinData( T* p, lua_State *L ) static int RefreshNoteSkinData( T* p, lua_State *L )
{ {
NOTESKIN->RefreshNoteSkinData(p->m_pCurGame); NOTESKIN->RefreshNoteSkinData(p->m_pCurGame);
return 0; COMMON_RETURN_SELF;
} }
static int Dopefish( T* p, lua_State *L ) static int Dopefish( T* p, lua_State *L )
@@ -2675,26 +2674,26 @@ public:
} }
p->LoadProfiles( LoadEdits ); p->LoadProfiles( LoadEdits );
SCREENMAN->ZeroNextUpdate(); SCREENMAN->ZeroNextUpdate();
return 0; COMMON_RETURN_SELF;
} }
static int SaveProfiles( T* p, lua_State *L ) static int SaveProfiles( T* p, lua_State *L )
{ {
p->SavePlayerProfiles(); p->SavePlayerProfiles();
SCREENMAN->ZeroNextUpdate(); SCREENMAN->ZeroNextUpdate();
return 0; COMMON_RETURN_SELF;
} }
static int SetFailTypeExplicitlySet(T* p, lua_State* L) static int SetFailTypeExplicitlySet(T* p, lua_State* L)
{ {
p->m_bFailTypeWasExplicitlySet= true; p->m_bFailTypeWasExplicitlySet= true;
return 0; COMMON_RETURN_SELF;
} }
static int StoreRankingName( T* p, lua_State *L ) static int StoreRankingName( T* p, lua_State *L )
{ {
p->StoreRankingName(Enum::Check<PlayerNumber>(L, 1), SArg(2)); p->StoreRankingName(Enum::Check<PlayerNumber>(L, 1), SArg(2));
return 0; COMMON_RETURN_SELF;
} }
DEFINE_METHOD( HaveProfileToLoad, HaveProfileToLoad() ) DEFINE_METHOD( HaveProfileToLoad, HaveProfileToLoad() )
@@ -2772,13 +2771,13 @@ public:
if( !AreStyleAndPlayModeCompatible( p, L, pStyle, p->m_PlayMode ) ) if( !AreStyleAndPlayModeCompatible( p, L, pStyle, p->m_PlayMode ) )
{ {
return 0; COMMON_RETURN_SELF;
} }
p->SetCurrentStyle( pStyle ); p->SetCurrentStyle( pStyle );
ClearIncompatibleStepsAndTrails( p, L ); ClearIncompatibleStepsAndTrails( p, L );
return 0; COMMON_RETURN_SELF;
} }
static int SetCurrentPlayMode( T* p, lua_State *L ) static int SetCurrentPlayMode( T* p, lua_State *L )
@@ -2788,7 +2787,7 @@ public:
{ {
p->m_PlayMode.Set( pm ); p->m_PlayMode.Set( pm );
} }
return 0; COMMON_RETURN_SELF;
} }
LunaGameState() LunaGameState()
+2 -2
View File
@@ -50,13 +50,13 @@ public:
static int Load( T* p, lua_State *L ) static int Load( T* p, lua_State *L )
{ {
p->Load( SArg(1) ); p->Load( SArg(1) );
return 0; COMMON_RETURN_SELF;
} }
static int SetGrade( T* p, lua_State *L ) static int SetGrade( T* p, lua_State *L )
{ {
Grade g = Enum::Check<Grade>(L, 1); Grade g = Enum::Check<Grade>(L, 1);
p->SetGrade( g ); p->SetGrade( g );
return 0; COMMON_RETURN_SELF;
} }
LunaGradeDisplay() LunaGradeDisplay()
+2 -2
View File
@@ -282,14 +282,14 @@ public:
static int Load( T* p, lua_State *L ) static int Load( T* p, lua_State *L )
{ {
p->Load( SArg(1) ); p->Load( SArg(1) );
return 0; COMMON_RETURN_SELF;
} }
static int Set( T* p, lua_State *L ) static int Set( T* p, lua_State *L )
{ {
StageStats *pStageStats = Luna<StageStats>::check( L, 1 ); StageStats *pStageStats = Luna<StageStats>::check( L, 1 );
PlayerStageStats *pPlayerStageStats = Luna<PlayerStageStats>::check( L, 2 ); PlayerStageStats *pPlayerStageStats = Luna<PlayerStageStats>::check( L, 2 );
p->Set( *pStageStats, *pPlayerStageStats ); p->Set( *pStageStats, *pPlayerStageStats );
return 0; COMMON_RETURN_SELF;
} }
LunaGraphDisplay() LunaGraphDisplay()
+3 -3
View File
@@ -224,7 +224,7 @@ public:
RadarValues *pRV = Luna<RadarValues>::check(L,2); RadarValues *pRV = Luna<RadarValues>::check(L,2);
p->SetFromRadarValues( pn, *pRV ); p->SetFromRadarValues( pn, *pRV );
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetFromValues( T* p, lua_State *L ) static int SetFromValues( T* p, lua_State *L )
{ {
@@ -239,9 +239,9 @@ public:
LuaHelpers::ReadArrayFromTable( vals, L ); LuaHelpers::ReadArrayFromTable( vals, L );
p->SetFromValues(pn, vals); p->SetFromValues(pn, vals);
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetEmpty( T* p, lua_State *L ) { p->SetEmpty( Enum::Check<PlayerNumber>(L, 1) ); return 0; } static int SetEmpty( T* p, lua_State *L ) { p->SetEmpty( Enum::Check<PlayerNumber>(L, 1) ); COMMON_RETURN_SELF; }
LunaGrooveRadar() LunaGrooveRadar()
{ {
+3 -3
View File
@@ -91,14 +91,14 @@ public:
else else
p->SetTips( arrayTips ); p->SetTips( arrayTips );
return 0; COMMON_RETURN_SELF;
} }
static int SetTipsColonSeparated( T* p, lua_State *L ) static int SetTipsColonSeparated( T* p, lua_State *L )
{ {
vector<RString> vs; vector<RString> vs;
split( SArg(1), "::", vs ); split( SArg(1), "::", vs );
p->SetTips( vs ); p->SetTips( vs );
return 0; COMMON_RETURN_SELF;
} }
static int gettips( T* p, lua_State *L ) static int gettips( T* p, lua_State *L )
@@ -111,7 +111,7 @@ public:
return 2; return 2;
} }
static int SetSecsBetweenSwitches( T* p, lua_State *L ) { p->SetSecsBetweenSwitches( FArg(1) ); return 0; } static int SetSecsBetweenSwitches( T* p, lua_State *L ) { p->SetSecsBetweenSwitches( FArg(1) ); COMMON_RETURN_SELF; }
LunaHelpDisplay() LunaHelpDisplay()
{ {
+1 -1
View File
@@ -108,7 +108,7 @@ void HoldJudgment::HandleMessage( const Message &msg )
class LunaHoldJudgment: public Luna<HoldJudgment> class LunaHoldJudgment: public Luna<HoldJudgment>
{ {
public: public:
static int LoadFromMultiPlayer( T* p, lua_State *L ) { p->LoadFromMultiPlayer( Enum::Check<MultiPlayer>(L, 1) ); return 0; } static int LoadFromMultiPlayer( T* p, lua_State *L ) { p->LoadFromMultiPlayer( Enum::Check<MultiPlayer>(L, 1) ); COMMON_RETURN_SELF; }
LunaHoldJudgment() LunaHoldJudgment()
{ {
+1 -1
View File
@@ -268,7 +268,7 @@ class LunaLifeMeterBattery: public Luna<LifeMeterBattery>
public: public:
static int GetLivesLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetLivesLeft() ); return 1; } static int GetLivesLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetLivesLeft() ); return 1; }
static int GetTotalLives( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTotalLives()); return 1; } static int GetTotalLives( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTotalLives()); return 1; }
static int ChangeLives( T* p, lua_State *L ) { p->ChangeLives(IArg(1)); return 0; } static int ChangeLives( T* p, lua_State *L ) { p->ChangeLives(IArg(1)); COMMON_RETURN_SELF; }
LunaLifeMeterBattery() LunaLifeMeterBattery()
{ {
+2
View File
@@ -161,6 +161,8 @@ public:
#define DEFINE_METHOD( method_name, expr ) \ #define DEFINE_METHOD( method_name, expr ) \
static int method_name( T* p, lua_State *L ) { LuaHelpers::Push( L, p->expr ); return 1; } static int method_name( T* p, lua_State *L ) { LuaHelpers::Push( L, p->expr ); return 1; }
#define COMMON_RETURN_SELF p->PushSelf(L); return 1;
#define ADD_METHOD( method_name ) \ #define ADD_METHOD( method_name ) \
AddMethod( #method_name, method_name ) AddMethod( #method_name, method_name )
+7 -7
View File
@@ -203,14 +203,14 @@ void MenuTimer::SetText( float fSeconds )
class LunaMenuTimer: public Luna<MenuTimer> class LunaMenuTimer: public Luna<MenuTimer>
{ {
public: public:
static int SetSeconds( T* p, lua_State *L ) { p->SetSeconds(FArg(1)); return 0; } static int SetSeconds( T* p, lua_State *L ) { p->SetSeconds(FArg(1)); COMMON_RETURN_SELF; }
static int GetSeconds( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSeconds() ); return 1; } static int GetSeconds( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSeconds() ); return 1; }
static int start( T* p, lua_State *L ) { p->Start(); return 0; } static int start( T* p, lua_State *L ) { p->Start(); COMMON_RETURN_SELF; }
static int pause( T* p, lua_State *L ) { p->Pause(); return 0; } static int pause( T* p, lua_State *L ) { p->Pause(); COMMON_RETURN_SELF; }
static int stop( T* p, lua_State *L ) { p->Stop(); return 0; } static int stop( T* p, lua_State *L ) { p->Stop(); COMMON_RETURN_SELF; }
static int disable( T* p, lua_State *L ) { p->Disable(); return 0; } static int disable( T* p, lua_State *L ) { p->Disable(); COMMON_RETURN_SELF; }
static int silent( T* p, lua_State *L ) { p->EnableSilent(BArg(1)); return 0; } static int silent( T* p, lua_State *L ) { p->EnableSilent(BArg(1)); COMMON_RETURN_SELF; }
static int stealth( T* p, lua_State *L ) { p->EnableStealth(BArg(1)); return 0; } static int stealth( T* p, lua_State *L ) { p->EnableStealth(BArg(1)); COMMON_RETURN_SELF; }
LunaMenuTimer() LunaMenuTimer()
{ {
+2 -2
View File
@@ -307,12 +307,12 @@ public:
Message msg( SArg(1), ParamTable ); Message msg( SArg(1), ParamTable );
p->Broadcast( msg ); p->Broadcast( msg );
return 0; COMMON_RETURN_SELF;
} }
static int SetLogging(T* p, lua_State *L) static int SetLogging(T* p, lua_State *L)
{ {
p->SetLogging(lua_toboolean(L, -1)); p->SetLogging(lua_toboolean(L, -1));
return 0; COMMON_RETURN_SELF;
} }
LunaMessageManager() LunaMessageManager()
+1 -1
View File
@@ -97,7 +97,7 @@ void SongMeterDisplay::Update( float fDeltaTime )
class LunaMeterDisplay: public Luna<MeterDisplay> class LunaMeterDisplay: public Luna<MeterDisplay>
{ {
public: public:
static int SetStreamWidth( T* p, lua_State *L ) { p->SetStreamWidth(FArg(1)); return 0; } static int SetStreamWidth( T* p, lua_State *L ) { p->SetStreamWidth(FArg(1)); COMMON_RETURN_SELF; }
LunaMeterDisplay() LunaMeterDisplay()
{ {
+1 -1
View File
@@ -184,7 +184,7 @@ void ModIconRow::SetFromGameState()
class LunaModIconRow: public Luna<ModIconRow> class LunaModIconRow: public Luna<ModIconRow>
{ {
public: public:
static int Load( T* p, lua_State *L ) { p->Load( SArg(1), Enum::Check<PlayerNumber>(L, 2) ); return 0; } static int Load( T* p, lua_State *L ) { p->Load( SArg(1), Enum::Check<PlayerNumber>(L, 2) ); COMMON_RETURN_SELF; }
LunaModIconRow() LunaModIconRow()
{ {
+6 -6
View File
@@ -775,14 +775,14 @@ bool Model::MaterialsNeedNormals() const
class LunaModel: public Luna<Model> class LunaModel: public Luna<Model>
{ {
public: public:
static int position( T* p, lua_State *L ) { p->SetPosition( FArg(1) ); return 0; } static int position( T* p, lua_State *L ) { p->SetPosition( FArg(1) ); COMMON_RETURN_SELF; }
static int playanimation( T* p, lua_State *L ) { p->PlayAnimation(SArg(1),FArg(2)); return 0; } static int playanimation( T* p, lua_State *L ) { p->PlayAnimation(SArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int SetDefaultAnimation( T* p, lua_State *L ) { p->SetDefaultAnimation(SArg(1),FArg(2)); return 0; } static int SetDefaultAnimation( T* p, lua_State *L ) { p->SetDefaultAnimation(SArg(1),FArg(2)); COMMON_RETURN_SELF; }
static int GetDefaultAnimation( T* p, lua_State *L ) { lua_pushstring( L, p->GetDefaultAnimation() ); return 1; } static int GetDefaultAnimation( T* p, lua_State *L ) { lua_pushstring( L, p->GetDefaultAnimation() ); return 1; }
static int loop( T* p, lua_State *L ) { p->SetLoop(BArg(1)); return 0; } static int loop( T* p, lua_State *L ) { p->SetLoop(BArg(1)); COMMON_RETURN_SELF; }
static int rate( T* p, lua_State *L ) { p->SetRate(FArg(1)); return 0; } static int rate( T* p, lua_State *L ) { p->SetRate(FArg(1)); COMMON_RETURN_SELF; }
static int GetNumStates( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumStates() ); return 1; } static int GetNumStates( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumStates() ); return 1; }
//static int CelShading( T* p, lua_State *L ) { p->SetCelShading(BArg(1)); return 0; } //static int CelShading( T* p, lua_State *L ) { p->SetCelShading(BArg(1)); COMMON_RETURN_SELF; }
LunaModel() LunaModel()
{ {
+33 -17
View File
@@ -8,13 +8,21 @@
// Functions are designed to combine Get and Set into one, to be less clumsy to use. -Kyz // Functions are designed to combine Get and Set into one, to be less clumsy to use. -Kyz
// If a valid arg is passed, the value is set. // If a valid arg is passed, the value is set.
// The previous value is returned. // The previous value is returned.
// OPTIONAL_RETURN_SELF exists to provide optional chaining support.
// Example: local a= player_options:Twirl(5, 1, true):Roll(5, true):Dizzy(true):Twirl()
#define OPTIONAL_RETURN_SELF(option_index) \
if(lua_isboolean(L, option_index) && lua_toboolean(L, option_index)) \
{ \
p->PushSelf(L); \
return 1; \
}
#define FLOAT_INTERFACE(func_name, member, valid) \ #define FLOAT_INTERFACE(func_name, member, valid) \
static int func_name(T* p, lua_State* L) \ static int func_name(T* p, lua_State* L) \
{ \ { \
DefaultNilArgs(L, 2); \ int original_top= lua_gettop(L); \
lua_pushnumber(L, p->m_f ## member); \ lua_pushnumber(L, p->m_f ## member); \
lua_pushnumber(L, p->m_Speedf ## member); \ lua_pushnumber(L, p->m_Speedf ## member); \
if(lua_isnumber(L, 1)) \ if(lua_isnumber(L, 1) && original_top >= 1) \
{ \ { \
float v= FArg(1); \ float v= FArg(1); \
if(!valid) \ if(!valid) \
@@ -22,23 +30,20 @@
luaL_error(L, "Invalid value %f", v); \ luaL_error(L, "Invalid value %f", v); \
} \ } \
p->m_f ## member = v; \ p->m_f ## member = v; \
if(p->m_Speedf ## member <= 0.0f) \
{ \
p->m_Speedf ## member = 1.0f; \
} \
} \ } \
if(lua_isnumber(L, 2)) \ if(original_top >= 2 && lua_isnumber(L, 2)) \
{ \ { \
p->m_Speedf ## member = FArgGTEZero(L, 2); \ p->m_Speedf ## member = FArgGTEZero(L, 2); \
} \ } \
OPTIONAL_RETURN_SELF(original_top); \
return 2; \ return 2; \
} }
#define FLOAT_NO_SPEED_INTERFACE(func_name, member, valid) \ #define FLOAT_NO_SPEED_INTERFACE(func_name, member, valid) \
static int func_name(T* p, lua_State* L) \ static int func_name(T* p, lua_State* L) \
{ \ { \
DefaultNilArgs(L, 1); \ int original_top= lua_gettop(L); \
lua_pushnumber(L, p->m_f ## member); \ lua_pushnumber(L, p->m_f ## member); \
if(lua_isnumber(L, 1)) \ if(lua_isnumber(L, 1) && original_top >= 1) \
{ \ { \
float v= FArg(1); \ float v= FArg(1); \
if(!valid) \ if(!valid) \
@@ -47,53 +52,63 @@
} \ } \
p->m_f ## member = v; \ p->m_f ## member = v; \
} \ } \
OPTIONAL_RETURN_SELF(original_top); \
return 1; \ return 1; \
} }
#define INT_INTERFACE(func_name, member) \ #define INT_INTERFACE(func_name, member) \
static int func_name(T* p, lua_State* L) \ static int func_name(T* p, lua_State* L) \
{ \ { \
DefaultNilArgs(L, 1); \ int original_top= lua_gettop(L); \
lua_pushnumber(L, p->m_ ## member); \ lua_pushnumber(L, p->m_ ## member); \
if(lua_isnumber(L, 1)) \ if(lua_isnumber(L, 1) && original_top >= 1) \
{ \ { \
p->m_ ## member = IArg(1); \ p->m_ ## member = IArg(1); \
} \ } \
OPTIONAL_RETURN_SELF(original_top); \
return 1; \ return 1; \
} }
// BOOL_INTERFACE can't use OPTIONAL_RETURN_SELF because it pushes a bool.
// If it did original_top, then "foo(true)" would chain when it shouldn't.
#define BOOL_INTERFACE(func_name, member) \ #define BOOL_INTERFACE(func_name, member) \
static int func_name(T* p, lua_State* L) \ static int func_name(T* p, lua_State* L) \
{ \ { \
DefaultNilArgs(L, 1); \ int original_top= lua_gettop(L); \
lua_pushboolean(L, p->m_b ## member); \ lua_pushboolean(L, p->m_b ## member); \
if(lua_isboolean(L, 1)) \ if(lua_isboolean(L, 1) && original_top >= 1) \
{ \ { \
p->m_b ## member = BArg(1); \ p->m_b ## member = BArg(1); \
} \ } \
if(original_top >= 2 && lua_isboolean(L, 2)) \
{ \
p->PushSelf(L); \
return 1; \
} \
return 1; \ return 1; \
} }
#define ENUM_INTERFACE(func_name, member, enum_name) \ #define ENUM_INTERFACE(func_name, member, enum_name) \
static int func_name(T* p, lua_State* L) \ static int func_name(T* p, lua_State* L) \
{ \ { \
DefaultNilArgs(L, 1); \ int original_top= lua_gettop(L); \
Enum::Push(L, p->m_ ## member); \ Enum::Push(L, p->m_ ## member); \
if(!lua_isnil(L, 1)) \ if(!lua_isnil(L, 1) && original_top >= 1) \
{ \ { \
p->m_ ## member= Enum::Check<enum_name>(L, 1); \ p->m_ ## member= Enum::Check<enum_name>(L, 1); \
} \ } \
OPTIONAL_RETURN_SELF(original_top); \
return 1; \ return 1; \
} }
// Walk the table to make sure all entries are valid before setting. // Walk the table to make sure all entries are valid before setting.
#define FLOAT_TABLE_INTERFACE(func_name, member, valid) \ #define FLOAT_TABLE_INTERFACE(func_name, member, valid) \
static int func_name(T* p, lua_State* L) \ static int func_name(T* p, lua_State* L) \
{ \ { \
DefaultNilArgs(L, 1); \ int original_top= lua_gettop(L); \
lua_createtable(L, p->m_ ## member.size(), 0); \ lua_createtable(L, p->m_ ## member.size(), 0); \
for(size_t n= 0; n < p->m_ ## member.size(); ++n) \ for(size_t n= 0; n < p->m_ ## member.size(); ++n) \
{ \ { \
lua_pushnumber(L, p->m_ ## member[n]); \ lua_pushnumber(L, p->m_ ## member[n]); \
lua_rawseti(L, -2, n+1); \ lua_rawseti(L, -2, n+1); \
} \ } \
if(lua_istable(L, 1)) \ if(lua_istable(L, 1) && original_top >= 1) \
{ \ { \
size_t size= lua_objlen(L, 1); \ size_t size= lua_objlen(L, 1); \
if(valid(L, 1)) \ if(valid(L, 1)) \
@@ -110,6 +125,7 @@
} \ } \
} \ } \
} \ } \
OPTIONAL_RETURN_SELF(original_top); \
return 1; \ return 1; \
} }
+1 -1
View File
@@ -294,7 +294,7 @@ void PaneDisplay::SetFromGameState()
class LunaPaneDisplay: public Luna<PaneDisplay> class LunaPaneDisplay: public Luna<PaneDisplay>
{ {
public: public:
static int SetFromGameState( T* pc, lua_State *L ) { pc->SetFromGameState(); return 0; } static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); COMMON_RETURN_SELF; }
LunaPaneDisplay() LunaPaneDisplay()
{ {
+1 -1
View File
@@ -219,7 +219,7 @@ public:
const PlayerState *pStageStats = Luna<PlayerState>::check( L, 1 ); const PlayerState *pStageStats = Luna<PlayerState>::check( L, 1 );
const PlayerStageStats *pPlayerStageStats = Luna<PlayerStageStats>::check( L, 2 ); const PlayerStageStats *pPlayerStageStats = Luna<PlayerStageStats>::check( L, 2 );
p->Load( pStageStats, pPlayerStageStats ); p->Load( pStageStats, pPlayerStageStats );
return 0; COMMON_RETURN_SELF;
} }
LunaPercentageDisplay() LunaPercentageDisplay()
+2 -2
View File
@@ -3492,13 +3492,13 @@ public:
{ {
Actor *pActor = Luna<Actor>::check(L, 1); Actor *pActor = Luna<Actor>::check(L, 1);
p->SetActorWithJudgmentPosition(pActor); p->SetActorWithJudgmentPosition(pActor);
return 0; COMMON_RETURN_SELF;
} }
static int SetActorWithComboPosition( T* p, lua_State *L ) static int SetActorWithComboPosition( T* p, lua_State *L )
{ {
Actor *pActor = Luna<Actor>::check(L, 1); Actor *pActor = Luna<Actor>::check(L, 1);
p->SetActorWithComboPosition(pActor); p->SetActorWithComboPosition(pActor);
return 0; COMMON_RETURN_SELF;
} }
static int GetPlayerTimingData( T* p, lua_State *L ) static int GetPlayerTimingData( T* p, lua_State *L )
{ {
+37 -27
View File
@@ -1086,7 +1086,7 @@ public:
// NoteSkins // NoteSkins
static int NoteSkin(T* p, lua_State* L) static int NoteSkin(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if( p->m_sNoteSkin.empty() ) if( p->m_sNoteSkin.empty() )
{ {
lua_pushstring( L, CommonMetrics::DEFAULT_NOTESKIN_NAME.GetValue() ); lua_pushstring( L, CommonMetrics::DEFAULT_NOTESKIN_NAME.GetValue() );
@@ -1095,11 +1095,12 @@ public:
{ {
lua_pushstring( L, p->m_sNoteSkin ); lua_pushstring( L, p->m_sNoteSkin );
} }
if(lua_isstring(L, 1)) if(original_top >= 1 && lua_isstring(L, 1))
{ {
if(NOTESKIN->DoesNoteSkinExist(SArg(1))) RString skin= SArg(1);
if(NOTESKIN->DoesNoteSkinExist(skin))
{ {
p->m_sNoteSkin = SArg(1); p->m_sNoteSkin = skin;
lua_pushboolean(L, true); lua_pushboolean(L, true);
} }
else else
@@ -1111,6 +1112,7 @@ public:
{ {
lua_pushnil(L); lua_pushnil(L);
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
@@ -1127,7 +1129,7 @@ public:
// engine's enforcement of sane separation between speed mod types. // engine's enforcement of sane separation between speed mod types.
static int CMod(T* p, lua_State* L) static int CMod(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if(p->m_fTimeSpacing) if(p->m_fTimeSpacing)
{ {
lua_pushnumber(L, p->m_fScrollBPM); lua_pushnumber(L, p->m_fScrollBPM);
@@ -1138,7 +1140,7 @@ public:
lua_pushnil(L); lua_pushnil(L);
lua_pushnil(L); lua_pushnil(L);
} }
if(lua_isnumber(L, 1)) if(original_top >= 1 && lua_isnumber(L, 1))
{ {
float speed= FArg(1); float speed= FArg(1);
if(!isfinite(speed) || speed <= 0.0f) if(!isfinite(speed) || speed <= 0.0f)
@@ -1150,16 +1152,17 @@ public:
p->m_fScrollSpeed = 1; p->m_fScrollSpeed = 1;
p->m_fMaxScrollBPM = 0; p->m_fMaxScrollBPM = 0;
} }
if(lua_isnumber(L, 2)) if(original_top >= 2 && lua_isnumber(L, 2))
{ {
SetSpeedModApproaches(p, FArgGTEZero(L, 2)); SetSpeedModApproaches(p, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
static int XMod(T* p, lua_State* L) static int XMod(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if(!p->m_fTimeSpacing) if(!p->m_fTimeSpacing)
{ {
lua_pushnumber(L, p->m_fScrollSpeed); lua_pushnumber(L, p->m_fScrollSpeed);
@@ -1170,23 +1173,24 @@ public:
lua_pushnil(L); lua_pushnil(L);
lua_pushnil(L); lua_pushnil(L);
} }
if(lua_isnumber(L, 1)) if(lua_isnumber(L, 1) && original_top >= 1)
{ {
p->m_fScrollSpeed = FArg(1); p->m_fScrollSpeed = FArg(1);
p->m_fTimeSpacing = 0; p->m_fTimeSpacing = 0;
p->m_fScrollBPM= CMOD_DEFAULT; p->m_fScrollBPM= CMOD_DEFAULT;
p->m_fMaxScrollBPM = 0; p->m_fMaxScrollBPM = 0;
} }
if(lua_isnumber(L, 2)) if(lua_isnumber(L, 2) && original_top >= 2)
{ {
SetSpeedModApproaches(p, FArgGTEZero(L, 2)); SetSpeedModApproaches(p, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
static int MMod(T* p, lua_State* L) static int MMod(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if(!p->m_fTimeSpacing && p->m_fMaxScrollBPM) if(!p->m_fTimeSpacing && p->m_fMaxScrollBPM)
{ {
lua_pushnumber(L, p->m_fMaxScrollBPM); lua_pushnumber(L, p->m_fMaxScrollBPM);
@@ -1197,7 +1201,7 @@ public:
lua_pushnil(L); lua_pushnil(L);
lua_pushnil(L); lua_pushnil(L);
} }
if(lua_isnumber(L, 1)) if(lua_isnumber(L, 1) && original_top >= 1)
{ {
float speed= FArg(1); float speed= FArg(1);
if(!isfinite(speed) || speed <= 0.0f) if(!isfinite(speed) || speed <= 0.0f)
@@ -1209,10 +1213,11 @@ public:
p->m_fScrollSpeed= 1; p->m_fScrollSpeed= 1;
p->m_fMaxScrollBPM = speed; p->m_fMaxScrollBPM = speed;
} }
if(lua_isnumber(L, 2)) if(lua_isnumber(L, 2) && original_top >= 2)
{ {
SetSpeedModApproaches(p, FArgGTEZero(L, 2)); SetSpeedModApproaches(p, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
@@ -1224,23 +1229,24 @@ public:
static int Overhead(T* p, lua_State* L) static int Overhead(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
lua_pushboolean(L, (p->m_fPerspectiveTilt == 0.0f && p->m_fSkew == 0.0f)); lua_pushboolean(L, (p->m_fPerspectiveTilt == 0.0f && p->m_fSkew == 0.0f));
if(lua_toboolean(L, 1)) if(lua_toboolean(L, 1))
{ {
p->m_fPerspectiveTilt= 0; p->m_fPerspectiveTilt= 0;
p->m_fSkew= 0; p->m_fSkew= 0;
} }
if(lua_isnumber(L, 2)) if(lua_isnumber(L, 2) && original_top >= 2)
{ {
SetPerspectiveApproach(p, L, FArgGTEZero(L, 2)); SetPerspectiveApproach(p, L, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 1; return 1;
} }
static int Incoming(T* p, lua_State* L) static int Incoming(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if((p->m_fSkew > 0.0f && p->m_fPerspectiveTilt < 0.0f) || if((p->m_fSkew > 0.0f && p->m_fPerspectiveTilt < 0.0f) ||
(p->m_fSkew < 0.0f && p->m_fPerspectiveTilt > 0.0f)) (p->m_fSkew < 0.0f && p->m_fPerspectiveTilt > 0.0f))
{ {
@@ -1252,22 +1258,23 @@ public:
lua_pushnil(L); lua_pushnil(L);
lua_pushnil(L); lua_pushnil(L);
} }
if(lua_isnumber(L, 1)) if(lua_isnumber(L, 1) && original_top >= 1)
{ {
float value= FArg(1); float value= FArg(1);
p->m_fPerspectiveTilt= -value; p->m_fPerspectiveTilt= -value;
p->m_fSkew= value; p->m_fSkew= value;
} }
if(lua_isnumber(L, 2)) if(lua_isnumber(L, 2) && original_top >= 2)
{ {
SetPerspectiveApproach(p, L, FArgGTEZero(L, 2)); SetPerspectiveApproach(p, L, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
static int Space(T* p, lua_State* L) static int Space(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if((p->m_fSkew > 0.0f && p->m_fPerspectiveTilt > 0.0f) || if((p->m_fSkew > 0.0f && p->m_fPerspectiveTilt > 0.0f) ||
(p->m_fSkew < 0.0f && p->m_fPerspectiveTilt < 0.0f)) (p->m_fSkew < 0.0f && p->m_fPerspectiveTilt < 0.0f))
{ {
@@ -1279,22 +1286,23 @@ public:
lua_pushnil(L); lua_pushnil(L);
lua_pushnil(L); lua_pushnil(L);
} }
if(lua_isnumber(L, 1)) if(lua_isnumber(L, 1) && original_top >= 1)
{ {
float value= FArg(1); float value= FArg(1);
p->m_fPerspectiveTilt= value; p->m_fPerspectiveTilt= value;
p->m_fSkew= value; p->m_fSkew= value;
} }
if(lua_isnumber(L, 2)) if(lua_isnumber(L, 2) && original_top >= 2)
{ {
SetPerspectiveApproach(p, L, FArgGTEZero(L, 2)); SetPerspectiveApproach(p, L, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
static int Hallway(T* p, lua_State* L) static int Hallway(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if(p->m_fSkew == 0.0f && p->m_fPerspectiveTilt < 0.0f) if(p->m_fSkew == 0.0f && p->m_fPerspectiveTilt < 0.0f)
{ {
lua_pushnumber(L, -p->m_fPerspectiveTilt); lua_pushnumber(L, -p->m_fPerspectiveTilt);
@@ -1305,21 +1313,22 @@ public:
lua_pushnil(L); lua_pushnil(L);
lua_pushnil(L); lua_pushnil(L);
} }
if(lua_isnumber(L, 1)) if(lua_isnumber(L, 1) && original_top >= 1)
{ {
p->m_fPerspectiveTilt= -FArg(1); p->m_fPerspectiveTilt= -FArg(1);
p->m_fSkew= 0; p->m_fSkew= 0;
} }
if(lua_isnumber(L, 2)) if(lua_isnumber(L, 2) && original_top >= 2)
{ {
SetPerspectiveApproach(p, L, FArgGTEZero(L, 2)); SetPerspectiveApproach(p, L, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
static int Distant(T* p, lua_State* L) static int Distant(T* p, lua_State* L)
{ {
DefaultNilArgs(L, 2); int original_top= lua_gettop(L);
if(p->m_fSkew == 0.0f && p->m_fPerspectiveTilt > 0.0f) if(p->m_fSkew == 0.0f && p->m_fPerspectiveTilt > 0.0f)
{ {
lua_pushnumber(L, p->m_fPerspectiveTilt); lua_pushnumber(L, p->m_fPerspectiveTilt);
@@ -1330,15 +1339,16 @@ public:
lua_pushnil(L); lua_pushnil(L);
lua_pushnil(L); lua_pushnil(L);
} }
if(lua_isnumber(L, 1)) if(lua_isnumber(L, 1) && original_top >= 1)
{ {
p->m_fPerspectiveTilt= FArg(1); p->m_fPerspectiveTilt= FArg(1);
p->m_fSkew= 0; p->m_fSkew= 0;
} }
if(lua_isnumber(L, 2)) if(lua_isnumber(L, 2) && original_top >= 2)
{ {
SetPerspectiveApproach(p, L, FArgGTEZero(L, 2)); SetPerspectiveApproach(p, L, FArgGTEZero(L, 2));
} }
OPTIONAL_RETURN_SELF(original_top);
return 2; return 2;
} }
+4 -4
View File
@@ -834,7 +834,7 @@ public:
p->m_iScore = IArg(1); p->m_iScore = IArg(1);
return 1; return 1;
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetCurMaxScore( T* p, lua_State *L ) static int SetCurMaxScore( T* p, lua_State *L )
{ {
@@ -843,13 +843,13 @@ public:
p->m_iCurMaxScore = IArg(1); p->m_iCurMaxScore = IArg(1);
return 1; return 1;
} }
return 0; COMMON_RETURN_SELF;
} }
static int FailPlayer( T* p, lua_State * ) static int FailPlayer( T* p, lua_State *L )
{ {
p->m_bFailed = true; p->m_bFailed = true;
return 0; COMMON_RETURN_SELF;
} }
LunaPlayerStageStats() LunaPlayerStageStats()
+5 -5
View File
@@ -567,12 +567,12 @@ public:
if( pPref == NULL ) if( pPref == NULL )
{ {
LuaHelpers::ReportScriptErrorFmt( "SetPreference: unknown preference \"%s\"", sName.c_str() ); LuaHelpers::ReportScriptErrorFmt( "SetPreference: unknown preference \"%s\"", sName.c_str() );
return 0; COMMON_RETURN_SELF;
} }
lua_pushvalue( L, 2 ); lua_pushvalue( L, 2 );
pPref->SetFromStack( L ); pPref->SetFromStack( L );
return 0; COMMON_RETURN_SELF;
} }
static int SetPreferenceToDefault( T* p, lua_State *L ) static int SetPreferenceToDefault( T* p, lua_State *L )
{ {
@@ -582,12 +582,12 @@ public:
if( pPref == NULL ) if( pPref == NULL )
{ {
LuaHelpers::ReportScriptErrorFmt( "SetPreferenceToDefault: unknown preference \"%s\"", sName.c_str() ); LuaHelpers::ReportScriptErrorFmt( "SetPreferenceToDefault: unknown preference \"%s\"", sName.c_str() );
return 0; COMMON_RETURN_SELF;
} }
pPref->LoadDefault(); pPref->LoadDefault();
LOG->Trace( "Restored preference \"%s\" to default \"%s\"", sName.c_str(), pPref->ToString().c_str() ); LOG->Trace( "Restored preference \"%s\" to default \"%s\"", sName.c_str(), pPref->ToString().c_str() );
return 0; COMMON_RETURN_SELF;
} }
static int PreferenceExists( T* p, lua_State *L ) static int PreferenceExists( T* p, lua_State *L )
{ {
@@ -603,7 +603,7 @@ public:
return 1; return 1;
} }
static int SavePreferences( T* p, lua_State *L ) { p->SavePrefsToDisk(); return 0; } static int SavePreferences( T* p, lua_State *L ) { p->SavePrefsToDisk(); COMMON_RETURN_SELF; }
LunaPrefsManager() LunaPrefsManager()
{ {
+14 -14
View File
@@ -2394,7 +2394,7 @@ public:
screenshot.sMD5= BinaryToHex(CRYPTMAN->GetMD5ForFile(filename)); screenshot.sMD5= BinaryToHex(CRYPTMAN->GetMD5ForFile(filename));
screenshot.highScore= *hs; screenshot.highScore= *hs;
p->AddScreenshot(screenshot); p->AddScreenshot(screenshot);
return 0; COMMON_RETURN_SELF;
} }
DEFINE_METHOD(GetType, m_Type); DEFINE_METHOD(GetType, m_Type);
DEFINE_METHOD(GetPriority, m_ListPriority); DEFINE_METHOD(GetPriority, m_ListPriority);
@@ -2403,13 +2403,13 @@ public:
static int SetDisplayName( T* p, lua_State *L ) static int SetDisplayName( T* p, lua_State *L )
{ {
p->m_sDisplayName= SArg(1); p->m_sDisplayName= SArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int GetLastUsedHighScoreName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sLastUsedHighScoreName ); return 1; } static int GetLastUsedHighScoreName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sLastUsedHighScoreName ); return 1; }
static int SetLastUsedHighScoreName( T* p, lua_State *L ) static int SetLastUsedHighScoreName( T* p, lua_State *L )
{ {
p->m_sLastUsedHighScoreName= SArg(1); p->m_sLastUsedHighScoreName= SArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int GetHighScoreList( T* p, lua_State *L ) static int GetHighScoreList( T* p, lua_State *L )
{ {
@@ -2431,7 +2431,7 @@ public:
} }
luaL_typerror( L, 1, "Song or Course" ); luaL_typerror( L, 1, "Song or Course" );
return 0; COMMON_RETURN_SELF;
} }
static int GetCategoryHighScoreList( T* p, lua_State *L ) static int GetCategoryHighScoreList( T* p, lua_State *L )
{ {
@@ -2498,9 +2498,9 @@ public:
} }
static int GetCharacter( T* p, lua_State *L ) { p->GetCharacter()->PushSelf(L); return 1; } static int GetCharacter( T* p, lua_State *L ) { p->GetCharacter()->PushSelf(L); return 1; }
static int SetCharacter( T* p, lua_State *L ) { p->SetCharacter(SArg(1)); return 0; } static int SetCharacter( T* p, lua_State *L ) { p->SetCharacter(SArg(1)); COMMON_RETURN_SELF; }
static int GetWeightPounds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iWeightPounds ); return 1; } static int GetWeightPounds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iWeightPounds ); return 1; }
static int SetWeightPounds( T* p, lua_State *L ) { p->m_iWeightPounds = IArg(1); return 0; } static int SetWeightPounds( T* p, lua_State *L ) { p->m_iWeightPounds = IArg(1); COMMON_RETURN_SELF; }
DEFINE_METHOD(GetVoomax, m_Voomax); DEFINE_METHOD(GetVoomax, m_Voomax);
DEFINE_METHOD(GetAge, GetAge()); DEFINE_METHOD(GetAge, GetAge());
DEFINE_METHOD(GetBirthYear, m_BirthYear); DEFINE_METHOD(GetBirthYear, m_BirthYear);
@@ -2509,35 +2509,35 @@ public:
static int SetVoomax( T* p, lua_State *L ) static int SetVoomax( T* p, lua_State *L )
{ {
p->m_Voomax= FArg(1); p->m_Voomax= FArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int SetBirthYear( T* p, lua_State *L ) static int SetBirthYear( T* p, lua_State *L )
{ {
p->m_BirthYear= IArg(1); p->m_BirthYear= IArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int SetIgnoreStepCountCalories( T* p, lua_State *L ) static int SetIgnoreStepCountCalories( T* p, lua_State *L )
{ {
p->m_IgnoreStepCountCalories= BArg(1); p->m_IgnoreStepCountCalories= BArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int SetIsMale( T* p, lua_State *L ) static int SetIsMale( T* p, lua_State *L )
{ {
p->m_IsMale= BArg(1); p->m_IsMale= BArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int AddCaloriesToDailyTotal( T* p, lua_State *L ) static int AddCaloriesToDailyTotal( T* p, lua_State *L )
{ {
p->AddCaloriesToDailyTotal(FArg(1)); p->AddCaloriesToDailyTotal(FArg(1));
return 0; COMMON_RETURN_SELF;
} }
DEFINE_METHOD(CalculateCaloriesFromHeartRate, CalculateCaloriesFromHeartRate(FArg(1), FArg(2))); DEFINE_METHOD(CalculateCaloriesFromHeartRate, CalculateCaloriesFromHeartRate(FArg(1), FArg(2)));
static int GetGoalType( T* p, lua_State *L ) { lua_pushnumber(L, p->m_GoalType ); return 1; } static int GetGoalType( T* p, lua_State *L ) { lua_pushnumber(L, p->m_GoalType ); return 1; }
static int SetGoalType( T* p, lua_State *L ) { p->m_GoalType = Enum::Check<GoalType>(L, 1); return 0; } static int SetGoalType( T* p, lua_State *L ) { p->m_GoalType = Enum::Check<GoalType>(L, 1); COMMON_RETURN_SELF; }
static int GetGoalCalories( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iGoalCalories ); return 1; } static int GetGoalCalories( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iGoalCalories ); return 1; }
static int SetGoalCalories( T* p, lua_State *L ) { p->m_iGoalCalories = IArg(1); return 0; } static int SetGoalCalories( T* p, lua_State *L ) { p->m_iGoalCalories = IArg(1); COMMON_RETURN_SELF; }
static int GetGoalSeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iGoalSeconds ); return 1; } static int GetGoalSeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iGoalSeconds ); return 1; }
static int SetGoalSeconds( T* p, lua_State *L ) { p->m_iGoalSeconds = IArg(1); return 0; } static int SetGoalSeconds( T* p, lua_State *L ) { p->m_iGoalSeconds = IArg(1); COMMON_RETURN_SELF; }
static int GetCaloriesBurnedToday( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCaloriesBurnedToday() ); return 1; } static int GetCaloriesBurnedToday( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCaloriesBurnedToday() ); return 1; }
static int GetTotalNumSongsPlayed( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iNumTotalSongsPlayed ); return 1; } static int GetTotalNumSongsPlayed( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iNumTotalSongsPlayed ); return 1; }
static int IsCodeUnlocked( T* p, lua_State *L ) { lua_pushboolean(L, p->IsCodeUnlocked(SArg(1)) ); return 1; } static int IsCodeUnlocked( T* p, lua_State *L ) { lua_pushboolean(L, p->IsCodeUnlocked(SArg(1)) ); return 1; }
+4 -4
View File
@@ -642,7 +642,7 @@ public:
RageSoundParams params( p->GetParams() ); RageSoundParams params( p->GetParams() );
params.m_fPitch = FArg(1); params.m_fPitch = FArg(1);
p->SetParams( params ); p->SetParams( params );
return 0; COMMON_RETURN_SELF;
} }
static int speed( T* p, lua_State *L ) static int speed( T* p, lua_State *L )
@@ -650,7 +650,7 @@ public:
RageSoundParams params( p->GetParams() ); RageSoundParams params( p->GetParams() );
params.m_fSpeed = FArg(1); params.m_fSpeed = FArg(1);
p->SetParams( params ); p->SetParams( params );
return 0; COMMON_RETURN_SELF;
} }
static int volume( T* p, lua_State *L ) static int volume( T* p, lua_State *L )
@@ -658,7 +658,7 @@ public:
RageSoundParams params( p->GetParams() ); RageSoundParams params( p->GetParams() );
params.m_Volume = FArg(1); params.m_Volume = FArg(1);
p->SetParams( params ); p->SetParams( params );
return 0; COMMON_RETURN_SELF;
} }
static int SetProperty( T* p, lua_State *L ) static int SetProperty( T* p, lua_State *L )
@@ -682,7 +682,7 @@ public:
else if( val == "Volume" ) params.m_Volume = FArg(2); else if( val == "Volume" ) params.m_Volume = FArg(2);
p->SetParams( params ); p->SetParams( params );
return 0; COMMON_RETURN_SELF;
} }
/* /*
+4 -4
View File
@@ -86,9 +86,9 @@ const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const
class LunaRageTexture: public Luna<RageTexture> class LunaRageTexture: public Luna<RageTexture>
{ {
public: public:
static int position( T* p, lua_State *L ) { p->SetPosition( FArg(1) ); return 0; } static int position( T* p, lua_State *L ) { p->SetPosition( FArg(1) ); COMMON_RETURN_SELF; }
static int loop( T* p, lua_State *L ) { p->SetLooping( BIArg(1) ); return 0; } static int loop( T* p, lua_State *L ) { p->SetLooping( BIArg(1) ); COMMON_RETURN_SELF; }
static int rate( T* p, lua_State *L ) { p->SetPlaybackRate( FArg(1) ); return 0; } static int rate( T* p, lua_State *L ) { p->SetPlaybackRate( FArg(1) ); COMMON_RETURN_SELF; }
static int GetTextureCoordRect( T* p, lua_State *L ) static int GetTextureCoordRect( T* p, lua_State *L )
{ {
const RectF *pRect = p->GetTextureCoordRect( IArg(1) ); const RectF *pRect = p->GetTextureCoordRect( IArg(1) );
@@ -106,7 +106,7 @@ public:
static int Reload(T* p, lua_State* L) static int Reload(T* p, lua_State* L)
{ {
p->Reload(); p->Reload();
return 0; COMMON_RETURN_SELF;
} }
LunaRageTexture() LunaRageTexture()
+2 -2
View File
@@ -83,9 +83,9 @@ public:
{ {
bool bPreserveTexture = !!luaL_opt( L, lua_toboolean, 1, false ); bool bPreserveTexture = !!luaL_opt( L, lua_toboolean, 1, false );
p->BeginRenderingTo( bPreserveTexture ); p->BeginRenderingTo( bPreserveTexture );
return 0; COMMON_RETURN_SELF;
} }
static int FinishRenderingTo( T* p, lua_State *L ) { p->FinishRenderingTo(); return 0; } static int FinishRenderingTo( T* p, lua_State *L ) { p->FinishRenderingTo(); COMMON_RETURN_SELF; }
LunaRageTextureRenderTarget() LunaRageTextureRenderTarget()
{ {
+2 -2
View File
@@ -122,8 +122,8 @@ void RollingNumbers::UpdateText()
class LunaRollingNumbers: public Luna<RollingNumbers> class LunaRollingNumbers: public Luna<RollingNumbers>
{ {
public: public:
static int Load( T* p, lua_State *L ) { p->Load(SArg(1)); return 0; } static int Load( T* p, lua_State *L ) { p->Load(SArg(1)); COMMON_RETURN_SELF; }
static int targetnumber( T* p, lua_State *L ) { p->SetTargetNumber( FArg(1) ); return 0; } static int targetnumber( T* p, lua_State *L ) { p->SetTargetNumber( FArg(1) ); COMMON_RETURN_SELF; }
LunaRollingNumbers() LunaRollingNumbers()
{ {
+5 -5
View File
@@ -408,9 +408,9 @@ class LunaScreen: public Luna<Screen>
{ {
public: public:
static int GetNextScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetNextScreenName() ); return 1; } static int GetNextScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetNextScreenName() ); return 1; }
static int SetNextScreenName( T* p, lua_State *L ) { p->SetNextScreenName(SArg(1)); return 0; } static int SetNextScreenName( T* p, lua_State *L ) { p->SetNextScreenName(SArg(1)); COMMON_RETURN_SELF; }
static int GetPrevScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetPrevScreen() ); return 1; } static int GetPrevScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetPrevScreen() ); return 1; }
static int lockinput( T* p, lua_State *L ) { p->SetLockInputSecs(FArg(1)); return 0; } static int lockinput( T* p, lua_State *L ) { p->SetLockInputSecs(FArg(1)); COMMON_RETURN_SELF; }
DEFINE_METHOD( GetScreenType, GetScreenType() ) DEFINE_METHOD( GetScreenType, GetScreenType() )
static int PostScreenMessage( T* p, lua_State *L ) static int PostScreenMessage( T* p, lua_State *L )
@@ -418,7 +418,7 @@ public:
RString sMessage = SArg(1); RString sMessage = SArg(1);
ScreenMessage SM = ScreenMessageHelpers::ToScreenMessage( sMessage ); ScreenMessage SM = ScreenMessageHelpers::ToScreenMessage( sMessage );
p->PostScreenMessage( SM, IArg(2) ); p->PostScreenMessage( SM, IArg(2) );
return 0; COMMON_RETURN_SELF;
} }
static int AddInputCallback(T* p, lua_State* L) static int AddInputCallback(T* p, lua_State* L)
@@ -428,7 +428,7 @@ public:
luaL_error(L, "Input callback must be a function."); luaL_error(L, "Input callback must be a function.");
} }
p->AddInputCallbackFromStack(L); p->AddInputCallbackFromStack(L);
return 0; COMMON_RETURN_SELF;
} }
static int RemoveInputCallback(T* p, lua_State* L) static int RemoveInputCallback(T* p, lua_State* L)
@@ -438,7 +438,7 @@ public:
luaL_error(L, "Input callback must be a function."); luaL_error(L, "Input callback must be a function.");
} }
p->RemoveInputCallback(L); p->RemoveInputCallback(L);
return 0; COMMON_RETURN_SELF;
} }
LunaScreen() LunaScreen()
+4 -4
View File
@@ -909,7 +909,7 @@ public:
RString screen= SArg(1); RString screen= SArg(1);
ValidateScreenName(L, screen); ValidateScreenName(L, screen);
p->SetNewScreen(screen); p->SetNewScreen(screen);
return 0; COMMON_RETURN_SELF;
} }
static int GetTopScreen( T* p, lua_State *L ) static int GetTopScreen( T* p, lua_State *L )
{ {
@@ -920,7 +920,7 @@ public:
lua_pushnil( L ); lua_pushnil( L );
return 1; return 1;
} }
static int SystemMessage( T* p, lua_State *L ) { p->SystemMessage( SArg(1) ); return 0; } static int SystemMessage( T* p, lua_State *L ) { p->SystemMessage( SArg(1) ); COMMON_RETURN_SELF; }
static int ScreenIsPrepped( T* p, lua_State *L ) { lua_pushboolean( L, ScreenManagerUtil::ScreenIsPrepped( SArg(1) ) ); return 1; } static int ScreenIsPrepped( T* p, lua_State *L ) { lua_pushboolean( L, ScreenManagerUtil::ScreenIsPrepped( SArg(1) ) ); return 1; }
static int ScreenClassExists( T* p, lua_State *L ) { lua_pushboolean( L, g_pmapRegistrees->find( SArg(1) ) != g_pmapRegistrees->end() ); return 1; } static int ScreenClassExists( T* p, lua_State *L ) { lua_pushboolean( L, g_pmapRegistrees->find( SArg(1) ) != g_pmapRegistrees->end() ); return 1; }
static int AddNewScreenToTop( T* p, lua_State *L ) static int AddNewScreenToTop( T* p, lua_State *L )
@@ -935,10 +935,10 @@ public:
} }
p->AddNewScreenToTop( screen, SM ); p->AddNewScreenToTop( screen, SM );
return 0; COMMON_RETURN_SELF;
} }
//static int GetScreenStackSize( T* p, lua_State *L ) { lua_pushnumber( L, ScreenManagerUtil::g_ScreenStack.size() ); return 1; } //static int GetScreenStackSize( T* p, lua_State *L ) { lua_pushnumber( L, ScreenManagerUtil::g_ScreenStack.size() ); return 1; }
static int ReloadOverlayScreens( T* p, lua_State *L ) { p->ReloadOverlayScreens(); return 0; } static int ReloadOverlayScreens( T* p, lua_State *L ) { p->ReloadOverlayScreens(); COMMON_RETURN_SELF; }
LunaScreenManager() LunaScreenManager()
{ {
+1 -1
View File
@@ -47,7 +47,7 @@ public:
LUA->YieldLua(); LUA->YieldLua();
p->Continue(); p->Continue();
LUA->UnyieldLua(); LUA->UnyieldLua();
return 0; COMMON_RETURN_SELF;
} }
static int HaveProfileToLoad( T* p, lua_State *L ) static int HaveProfileToLoad( T* p, lua_State *L )
{ {
+1 -1
View File
@@ -35,7 +35,7 @@ public:
LUA->YieldLua(); LUA->YieldLua();
p->Continue(); p->Continue();
LUA->UnyieldLua(); LUA->UnyieldLua();
return 0; COMMON_RETURN_SELF;
} }
static int HaveProfileToSave( T* p, lua_State *L ) static int HaveProfileToSave( T* p, lua_State *L )
{ {
+1 -1
View File
@@ -1937,7 +1937,7 @@ public:
p->GetMusicWheel()->PushSelf(L); p->GetMusicWheel()->PushSelf(L);
return 1; return 1;
} }
static int OpenOptionsList( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); p->OpenOptionsList(pn); return 0; } static int OpenOptionsList( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); p->OpenOptionsList(pn); COMMON_RETURN_SELF; }
LunaScreenSelectMusic() LunaScreenSelectMusic()
{ {
+3 -3
View File
@@ -373,12 +373,12 @@ bool ScreenWithMenuElementsSimple::MenuBack( const InputEventPlus &input )
class LunaScreenWithMenuElements: public Luna<ScreenWithMenuElements> class LunaScreenWithMenuElements: public Luna<ScreenWithMenuElements>
{ {
public: public:
static int Cancel( T* p, lua_State *L ) { p->Cancel( SM_GoToPrevScreen ); return 0; } static int Cancel( T* p, lua_State *L ) { p->Cancel( SM_GoToPrevScreen ); COMMON_RETURN_SELF; }
static int IsTransitioning( T* p, lua_State *L ) { lua_pushboolean( L, p->IsTransitioning() ); return 1; } static int IsTransitioning( T* p, lua_State *L ) { lua_pushboolean( L, p->IsTransitioning() ); return 1; }
static int SetAllowLateJoin( T* p, lua_State *L ) static int SetAllowLateJoin( T* p, lua_State *L )
{ {
p->m_bShouldAllowLateJoin= BArg(1); p->m_bShouldAllowLateJoin= BArg(1);
return 0; COMMON_RETURN_SELF;
} }
static int StartTransitioningScreen( T* p, lua_State *L ) static int StartTransitioningScreen( T* p, lua_State *L )
@@ -386,7 +386,7 @@ public:
RString sMessage = SArg(1); RString sMessage = SArg(1);
ScreenMessage SM = ScreenMessageHelpers::ToScreenMessage( sMessage ); ScreenMessage SM = ScreenMessageHelpers::ToScreenMessage( sMessage );
p->StartTransitioningScreen( SM ); p->StartTransitioningScreen( SM );
return 0; COMMON_RETURN_SELF;
} }
LunaScreenWithMenuElements() LunaScreenWithMenuElements()
+2 -2
View File
@@ -1920,13 +1920,13 @@ public:
static int SetPreferredSongs( T* p, lua_State *L ) static int SetPreferredSongs( T* p, lua_State *L )
{ {
p->UpdatePreferredSort( SArg(1), "PreferredCourses.txt" ); p->UpdatePreferredSort( SArg(1), "PreferredCourses.txt" );
return 0; COMMON_RETURN_SELF;
} }
static int SetPreferredCourses( T* p, lua_State *L ) static int SetPreferredCourses( T* p, lua_State *L )
{ {
p->UpdatePreferredSort( "PreferredSongs.txt", SArg(1) ); p->UpdatePreferredSort( "PreferredSongs.txt", SArg(1) );
return 0; COMMON_RETURN_SELF;
} }
static int GetAllSongs( T* p, lua_State *L ) static int GetAllSongs( T* p, lua_State *L )
{ {
+15 -15
View File
@@ -1048,7 +1048,7 @@ public:
RageTextureID ID( SArg(1) ); RageTextureID ID( SArg(1) );
p->Load( ID ); p->Load( ID );
} }
return 0; COMMON_RETURN_SELF;
} }
static int LoadBackground( T* p, lua_State *L ) static int LoadBackground( T* p, lua_State *L )
{ {
@@ -1069,8 +1069,8 @@ public:
/* Commands that go in the tweening queue: /* Commands that go in the tweening queue:
* Commands that take effect immediately (ignoring the tweening queue): */ * Commands that take effect immediately (ignoring the tweening queue): */
static int customtexturerect( T* p, lua_State *L ) { p->SetCustomTextureRect( RectF(FArg(1),FArg(2),FArg(3),FArg(4)) ); return 0; } static int customtexturerect( T* p, lua_State *L ) { p->SetCustomTextureRect( RectF(FArg(1),FArg(2),FArg(3),FArg(4)) ); COMMON_RETURN_SELF; }
static int SetCustomImageRect( T* p, lua_State *L ) { p->SetCustomImageRect( RectF(FArg(1),FArg(2),FArg(3),FArg(4)) ); return 0; } static int SetCustomImageRect( T* p, lua_State *L ) { p->SetCustomImageRect( RectF(FArg(1),FArg(2),FArg(3),FArg(4)) ); COMMON_RETURN_SELF; }
static int SetCustomPosCoords( T* p, lua_State *L ) static int SetCustomPosCoords( T* p, lua_State *L )
{ {
float coords[8]; float coords[8];
@@ -1083,24 +1083,24 @@ public:
} }
} }
p->SetCustomPosCoords(coords); p->SetCustomPosCoords(coords);
return 0; COMMON_RETURN_SELF;
} }
static int StopUsingCustomPosCoords( T* p, lua_State *L ) { p->StopUsingCustomPosCoords(); return 0; } static int StopUsingCustomPosCoords( T* p, lua_State *L ) { p->StopUsingCustomPosCoords(); COMMON_RETURN_SELF; }
static int texcoordvelocity( T* p, lua_State *L ) { p->SetTexCoordVelocity( FArg(1),FArg(2) ); return 0; } static int texcoordvelocity( T* p, lua_State *L ) { p->SetTexCoordVelocity( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int scaletoclipped( T* p, lua_State *L ) { p->ScaleToClipped( FArg(1),FArg(2) ); return 0; } static int scaletoclipped( T* p, lua_State *L ) { p->ScaleToClipped( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int CropTo( T* p, lua_State *L ) { p->CropTo( FArg(1),FArg(2) ); return 0; } static int CropTo( T* p, lua_State *L ) { p->CropTo( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int stretchtexcoords( T* p, lua_State *L ) { p->StretchTexCoords( FArg(1),FArg(2) ); return 0; } static int stretchtexcoords( T* p, lua_State *L ) { p->StretchTexCoords( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int addimagecoords( T* p, lua_State *L ) { p->AddImageCoords( FArg(1),FArg(2) ); return 0; } static int addimagecoords( T* p, lua_State *L ) { p->AddImageCoords( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int setstate( T* p, lua_State *L ) { p->SetState( IArg(1) ); return 0; } static int setstate( T* p, lua_State *L ) { p->SetState( IArg(1) ); COMMON_RETURN_SELF; }
static int GetState( T* p, lua_State *L ) { lua_pushnumber( L, p->GetState() ); return 1; } static int GetState( T* p, lua_State *L ) { lua_pushnumber( L, p->GetState() ); return 1; }
static int GetAnimationLengthSeconds( T* p, lua_State *L ) { lua_pushnumber( L, p->GetAnimationLengthSeconds() ); return 1; } static int GetAnimationLengthSeconds( T* p, lua_State *L ) { lua_pushnumber( L, p->GetAnimationLengthSeconds() ); return 1; }
static int SetSecondsIntoAnimation( T* p, lua_State *L ) { p->SetSecondsIntoAnimation(FArg(0)); return 0; } static int SetSecondsIntoAnimation( T* p, lua_State *L ) { p->SetSecondsIntoAnimation(FArg(0)); COMMON_RETURN_SELF; }
static int SetTexture( T* p, lua_State *L ) static int SetTexture( T* p, lua_State *L )
{ {
RageTexture *pTexture = Luna<RageTexture>::check(L, 1); RageTexture *pTexture = Luna<RageTexture>::check(L, 1);
pTexture = TEXTUREMAN->CopyTexture( pTexture ); pTexture = TEXTUREMAN->CopyTexture( pTexture );
p->SetTexture( pTexture ); p->SetTexture( pTexture );
return 0; COMMON_RETURN_SELF;
} }
static int GetTexture( T* p, lua_State *L ) static int GetTexture( T* p, lua_State *L )
{ {
@@ -1115,10 +1115,10 @@ public:
{ {
EffectMode em = Enum::Check<EffectMode>(L, 1); EffectMode em = Enum::Check<EffectMode>(L, 1);
p->SetEffectMode( em ); p->SetEffectMode( em );
return 0; COMMON_RETURN_SELF;
} }
static int GetNumStates( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumStates() ); return 1; } static int GetNumStates( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumStates() ); return 1; }
static int SetAllStateDelays( T* p, lua_State *L ) { p->SetAllStateDelays(FArg(1)); return 0; } static int SetAllStateDelays( T* p, lua_State *L ) { p->SetAllStateDelays(FArg(1)); COMMON_RETURN_SELF; }
LunaSprite() LunaSprite()
{ {
+4 -4
View File
@@ -288,7 +288,7 @@ void StepsDisplay::SetInternal( const SetParams &params )
class LunaStepsDisplay: public Luna<StepsDisplay> class LunaStepsDisplay: public Luna<StepsDisplay>
{ {
public: public:
static int Load( T* p, lua_State *L ) { p->Load( SArg(1), NULL ); return 0; } static int Load( T* p, lua_State *L ) { p->Load( SArg(1), NULL ); COMMON_RETURN_SELF; }
static int SetFromSteps( T* p, lua_State *L ) static int SetFromSteps( T* p, lua_State *L )
{ {
if( lua_isnil(L,1) ) if( lua_isnil(L,1) )
@@ -300,7 +300,7 @@ public:
Steps *pS = Luna<Steps>::check(L,1); Steps *pS = Luna<Steps>::check(L,1);
p->SetFromSteps( pS ); p->SetFromSteps( pS );
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetFromTrail( T* p, lua_State *L ) static int SetFromTrail( T* p, lua_State *L )
{ {
@@ -313,13 +313,13 @@ public:
Trail *pT = Luna<Trail>::check(L,1); Trail *pT = Luna<Trail>::check(L,1);
p->SetFromTrail( pT ); p->SetFromTrail( pT );
} }
return 0; COMMON_RETURN_SELF;
} }
static int SetFromGameState( T* p, lua_State *L ) static int SetFromGameState( T* p, lua_State *L )
{ {
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
p->SetFromGameState( pn ); p->SetFromGameState( pn );
return 0; COMMON_RETURN_SELF;
} }
LunaStepsDisplay() LunaStepsDisplay()
+3 -3
View File
@@ -90,12 +90,12 @@ void TextBanner::SetFromSong( const Song *pSong )
class LunaTextBanner: public Luna<TextBanner> class LunaTextBanner: public Luna<TextBanner>
{ {
public: public:
static int Load( T* p, lua_State *L ) { p->Load( SArg(1) ); return 0; } static int Load( T* p, lua_State *L ) { p->Load( SArg(1) ); COMMON_RETURN_SELF; }
static int SetFromSong( T* p, lua_State *L ) static int SetFromSong( T* p, lua_State *L )
{ {
Song *pSong = Luna<Song>::check(L,1); Song *pSong = Luna<Song>::check(L,1);
p->SetFromSong( pSong ); p->SetFromSong( pSong );
return 0; COMMON_RETURN_SELF;
} }
static int SetFromString( T* p, lua_State *L ) static int SetFromString( T* p, lua_State *L )
{ {
@@ -106,7 +106,7 @@ public:
RString sDisplayArtist = SArg(5); RString sDisplayArtist = SArg(5);
RString sTranslitArtist = SArg(6); RString sTranslitArtist = SArg(6);
p->SetFromString( sDisplayTitle, sTranslitTitle, sDisplaySubTitle, sTranslitSubTitle, sDisplayArtist, sTranslitArtist ); p->SetFromString( sDisplayTitle, sTranslitTitle, sDisplaySubTitle, sTranslitSubTitle, sDisplayArtist, sTranslitArtist );
return 0; COMMON_RETURN_SELF;
} }
LunaTextBanner() LunaTextBanner()
+5 -5
View File
@@ -926,21 +926,21 @@ public:
return 1; return 1;
} }
static int FindEntryID( T* p, lua_State *L ) { RString sName = SArg(1); RString s = p->FindEntryID(sName); if( s.empty() ) lua_pushnil(L); else lua_pushstring(L, s); return 1; } static int FindEntryID( T* p, lua_State *L ) { RString sName = SArg(1); RString s = p->FindEntryID(sName); if( s.empty() ) lua_pushnil(L); else lua_pushstring(L, s); return 1; }
static int UnlockEntryID( T* p, lua_State *L ) { RString sUnlockEntryID = SArg(1); p->UnlockEntryID(sUnlockEntryID); return 0; } static int UnlockEntryID( T* p, lua_State *L ) { RString sUnlockEntryID = SArg(1); p->UnlockEntryID(sUnlockEntryID); COMMON_RETURN_SELF; }
static int UnlockEntryIndex( T* p, lua_State *L ) { int iUnlockEntryID = IArg(1); p->UnlockEntryIndex(iUnlockEntryID); return 0; } static int UnlockEntryIndex( T* p, lua_State *L ) { int iUnlockEntryID = IArg(1); p->UnlockEntryIndex(iUnlockEntryID); COMMON_RETURN_SELF; }
static int LockEntryID( T * p, lua_State * L) static int LockEntryID( T * p, lua_State * L)
{ {
RString entryID = SArg(1); RString entryID = SArg(1);
p->LockEntryID( entryID ); p->LockEntryID( entryID );
return 0; COMMON_RETURN_SELF;
} }
static int LockEntryIndex( T * p, lua_State * L) static int LockEntryIndex( T * p, lua_State * L)
{ {
int entryIndex = IArg(1); int entryIndex = IArg(1);
p->LockEntryIndex( entryIndex ); p->LockEntryIndex( entryIndex );
return 0; COMMON_RETURN_SELF;
} }
static int PreferUnlockEntryID( T* p, lua_State *L ) { RString sUnlockEntryID = SArg(1); p->PreferUnlockEntryID(sUnlockEntryID); return 0; } static int PreferUnlockEntryID( T* p, lua_State *L ) { RString sUnlockEntryID = SArg(1); p->PreferUnlockEntryID(sUnlockEntryID); COMMON_RETURN_SELF; }
static int GetNumUnlocks( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocks() ); return 1; } static int GetNumUnlocks( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocks() ); return 1; }
static int GetNumUnlocked( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocked() ); return 1; } static int GetNumUnlocked( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocked() ); return 1; }
static int GetUnlockEntryIndexToCelebrate( T* p, lua_State *L ) { lua_pushnumber( L, p->GetUnlockEntryIndexToCelebrate() ); return 1; } static int GetUnlockEntryIndexToCelebrate( T* p, lua_State *L ) { lua_pushnumber( L, p->GetUnlockEntryIndexToCelebrate() ); return 1; }
+2 -3
View File
@@ -526,7 +526,7 @@ int WheelBase::FirstVisibleIndex()
class LunaWheelBase: public Luna<WheelBase> class LunaWheelBase: public Luna<WheelBase>
{ {
public: public:
static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); return 0; } static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); COMMON_RETURN_SELF; }
static int GetWheelItem( T* p, lua_State *L ) static int GetWheelItem( T* p, lua_State *L )
{ {
int iItem = IArg(1); int iItem = IArg(1);
@@ -539,11 +539,10 @@ public:
return 1; return 1;
} }
static int IsSettled( T* p, lua_State *L ){ lua_pushboolean( L, p->IsSettled() ); return 1; } static int IsSettled( T* p, lua_State *L ){ lua_pushboolean( L, p->IsSettled() ); return 1; }
static int SetOpenSection( T* p, lua_State *L ){ p->SetOpenSection( SArg(1) ); return 0; } static int SetOpenSection( T* p, lua_State *L ){ p->SetOpenSection( SArg(1) ); COMMON_RETURN_SELF; }
static int GetCurrentIndex( T* p, lua_State *L ){ lua_pushnumber( L, p->GetCurrentIndex() ); return 1; } static int GetCurrentIndex( T* p, lua_State *L ){ lua_pushnumber( L, p->GetCurrentIndex() ); return 1; }
static int GetNumItems( T* p, lua_State *L ){ lua_pushnumber( L, p->GetNumItems() ); return 1; } static int GetNumItems( T* p, lua_State *L ){ lua_pushnumber( L, p->GetNumItems() ); return 1; }
// evil shit // evil shit
//static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); return 0; }
//static int ChangeMusic( T* p, lua_State *L ){ p->ChangeMusicUnlessLocked( IArg(1) ); return 0; } //static int ChangeMusic( T* p, lua_State *L ){ p->ChangeMusicUnlessLocked( IArg(1) ); return 0; }
DEFINE_METHOD( GetSelectedType, GetSelectedType() ) DEFINE_METHOD( GetSelectedType, GetSelectedType() )
+2 -2
View File
@@ -122,8 +122,8 @@ void WorkoutGraph::SetFromGameStateAndHighlightSong( int iSongIndex )
class LunaWorkoutGraph: public Luna<WorkoutGraph> class LunaWorkoutGraph: public Luna<WorkoutGraph>
{ {
public: public:
static int SetFromCurrentWorkout( T* p, lua_State *L ) { p->SetFromCurrentWorkout(); return 0; } static int SetFromCurrentWorkout( T* p, lua_State *L ) { p->SetFromCurrentWorkout(); COMMON_RETURN_SELF; }
static int SetFromGameStateAndHighlightSong( T* p, lua_State *L ) { p->SetFromGameStateAndHighlightSong(IArg(1)); return 0; } static int SetFromGameStateAndHighlightSong( T* p, lua_State *L ) { p->SetFromGameStateAndHighlightSong(IArg(1)); COMMON_RETURN_SELF; }
LunaWorkoutGraph() LunaWorkoutGraph()
{ {