예제 #1
0
파일: nlua_planet.c 프로젝트: naev/naev
/**
 * @brief Gets a planet's colour based on its friendliness or hostility to the player.
 *
 * @usage col = p:colour()
 *
 *    @luatparam Pilot p Planet to get the colour of.
 *    @luatreturn Colour The planet's colour.
 * @luafunc colour( p )
 */
static int planetL_colour( lua_State *L )
{
   Planet *p;
   const glColour *col;

   p = luaL_validplanet(L,1);
   col = planet_getColour( p );

   lua_pushcolour( L, *col );

   return 1;
}
예제 #2
0
파일: nlua_planet.c 프로젝트: Anatolis/naev
/**
 * @brief Gets a planet's colour based on its friendliness or hostility to the player.
 *
 * @usage col = p:colour()
 *
 *    @luaparam p Planet to get the colour of.
 *    @luareturn The planet's colour.
 * @luafunc colour( p )
 */
static int planetL_colour( lua_State *L )
{
   Planet *p;
   glColour *col;
   LuaColour lc;

   p = luaL_validplanet(L,1);
   col = planet_getColour( p );

   memcpy( &lc.col, col, sizeof(glColour) );
   lua_pushcolour( L, lc );

   return 1;
}