bind
This commit is contained in:
@@ -67,6 +67,29 @@ const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const
|
|||||||
return &m_TextureCoordRects[iFrameNo];
|
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
|
* Copyright (c) 2001-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "RageTypes.h"
|
#include "RageTypes.h"
|
||||||
#include "RageTextureID.h"
|
#include "RageTextureID.h"
|
||||||
|
|
||||||
|
struct lua_State;
|
||||||
class RageTexture
|
class RageTexture
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -59,6 +60,11 @@ public:
|
|||||||
|
|
||||||
static void GetFrameDimensionsFromFileName( RString sPath, int* puFramesWide, int* puFramesHigh );
|
static void GetFrameDimensionsFromFileName( RString sPath, int* puFramesWide, int* puFramesHigh );
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lua
|
||||||
|
//
|
||||||
|
virtual void PushSelf( lua_State *L );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* We might change settings when loading (due to hints, hardware
|
/* We might change settings when loading (due to hints, hardware
|
||||||
* limitations, etc). The data actually loaded is here: */
|
* limitations, etc). The data actually loaded is here: */
|
||||||
|
|||||||
Reference in New Issue
Block a user