diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index 2d0fb22a6b..e2ec90ca99 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -67,6 +67,29 @@ const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const return &m_TextureCoordRects[iFrameNo]; } +// lua start +#include "LuaBinding.h" + +class LunaRageTexture: public Luna +{ +public: + LunaRageTexture() { LUA->Register( Register ); } + + static int position( T* p, lua_State *L ) { p->SetPosition( FArg(1) ); return 0; } + static int loop( T* p, lua_State *L ) { p->SetLooping( !!IArg(1) ); return 0; } + static int rate( T* p, lua_State *L ) { p->SetPlaybackRate( FArg(1) ); return 0; } + + static void Register(lua_State *L) { + ADD_METHOD( position ); + ADD_METHOD( loop ); + ADD_METHOD( rate ); + } + +}; + +LUA_REGISTER_CLASS( RageTexture ) +// lua end + /* * Copyright (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/stepmania/src/RageTexture.h b/stepmania/src/RageTexture.h index 7c2623f283..37822e74d7 100644 --- a/stepmania/src/RageTexture.h +++ b/stepmania/src/RageTexture.h @@ -6,6 +6,7 @@ #include "RageTypes.h" #include "RageTextureID.h" +struct lua_State; class RageTexture { public: @@ -59,6 +60,11 @@ public: static void GetFrameDimensionsFromFileName( RString sPath, int* puFramesWide, int* puFramesHigh ); + // + // Lua + // + virtual void PushSelf( lua_State *L ); + private: /* We might change settings when loading (due to hints, hardware * limitations, etc). The data actually loaded is here: */