added ag::loadStaticModel()
git-svn-id: svn://anubis/anaglym/trunk@45 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
05858c0c22
commit
8e502af057
19
ag.cc
19
ag.cc
@ -23,6 +23,7 @@ namespace ag
|
||||
{ "print", print },
|
||||
{ "println", println },
|
||||
{ "loadModel", loadModel },
|
||||
{ "loadStaticModel", loadStaticModel },
|
||||
{ "videoStart", videoStart },
|
||||
{ "videoStop", videoStop },
|
||||
{ "sleep", sleep },
|
||||
@ -99,7 +100,7 @@ namespace ag
|
||||
return ret;
|
||||
}
|
||||
|
||||
int loadModel(lua_State * L)
|
||||
static int loadModelSpecify(lua_State * L, bool static_data)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
|
||||
@ -123,12 +124,16 @@ namespace ag
|
||||
lua_setfield(L, -2, "id");
|
||||
lua_pushcfunction(L, object::draw);
|
||||
lua_setfield(L, -2, "draw");
|
||||
lua_pushcfunction(L, object::setPosition);
|
||||
lua_setfield(L, -2, "setPosition");
|
||||
lua_pushcfunction(L, object::getPosition);
|
||||
lua_setfield(L, -2, "getPosition");
|
||||
if (physpath != "")
|
||||
{
|
||||
Engine::Object * obj = g_engine->getObject(id);
|
||||
if (obj != NULL)
|
||||
{
|
||||
obj->loadPhy(physpath);
|
||||
obj->loadPhy(physpath, static_data);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
@ -146,6 +151,16 @@ namespace ag
|
||||
return 1;
|
||||
}
|
||||
|
||||
int loadModel(lua_State * L)
|
||||
{
|
||||
loadModelSpecify(L, false);
|
||||
}
|
||||
|
||||
int loadStaticModel(lua_State * L)
|
||||
{
|
||||
loadModelSpecify(L, true);
|
||||
}
|
||||
|
||||
int videoStart(lua_State * L)
|
||||
{
|
||||
g_engine->getVideo()->start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user