registering lua function setTextureScale for objects
git-svn-id: svn://anubis/anaglym/trunk@220 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
fd4b6b27c8
commit
de49999c88
@ -925,8 +925,6 @@ void Engine::mouse_motion_event(int x, int y, int xrel, int yrel)
|
||||
void Engine::checkForFunctionFull(const std::string & lua_fn_name,
|
||||
const std::string & event_name, bool & presentFlag)
|
||||
{
|
||||
if (!presentFlag) /* only look for events we do not have a handler for */
|
||||
{
|
||||
lua_getfield(m_luaState, LUA_GLOBALSINDEX, lua_fn_name.c_str());
|
||||
if (lua_isfunction(m_luaState, -1))
|
||||
{
|
||||
@ -939,7 +937,6 @@ void Engine::checkForFunctionFull(const std::string & lua_fn_name,
|
||||
lua_pop(m_luaState, 1);
|
||||
presentFlag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Engine::doRegisterHandlerFull(int index,
|
||||
|
1
Engine.h
1
Engine.h
@ -71,6 +71,7 @@ class Engine
|
||||
void setTextureScale(float scale)
|
||||
{
|
||||
m_texture_scale = scale;
|
||||
render();
|
||||
}
|
||||
void draw();
|
||||
dReal getMass() { return m_ode_object->getMass(); }
|
||||
|
2
ag.cc
2
ag.cc
@ -169,6 +169,8 @@ namespace ag
|
||||
lua_setfield(L, -2, "setColor");
|
||||
lua_pushcfunction(L, object::setTexture);
|
||||
lua_setfield(L, -2, "setTexture");
|
||||
lua_pushcfunction(L, object::setTextureScale);
|
||||
lua_setfield(L, -2, "setTextureScale");
|
||||
lua_pushcfunction(L, object::setMass);
|
||||
lua_setfield(L, -2, "setMass");
|
||||
lua_pushcfunction(L, object::getMass);
|
||||
|
Loading…
x
Reference in New Issue
Block a user