This commit is contained in:
Glenn Maynard
2006-07-28 23:19:16 +00:00
parent c6aa765685
commit 413e4acd26
2 changed files with 29 additions and 0 deletions
+23
View File
@@ -67,6 +67,29 @@ const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const
return &m_TextureCoordRects[iFrameNo];
}
// lua start
#include "LuaBinding.h"
class LunaRageTexture: public Luna<RageTexture>
{
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.
+6
View File
@@ -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: */