Example #1
0
/**
 * @brief Gets the tiny faction logo which is 24x24 or smaller.
 *
 *    @luaparam f Faction to get logo from.
 *    @luareturn The tiny faction logo or nil if not applicable.
 * @luafunc logoTiny( f )
 */
static int factionL_logoTiny( lua_State *L )
{
    int lf;
    glTexture *tex;
    lf = luaL_validfaction(L,1);
    tex = faction_logoTiny( lf );
    if (tex == NULL)
        return 0;
    lua_pushtex( L, gl_dupTexture( tex ) );
    return 1;
}
Example #2
0
/**
 * @brief Gets the texture of the planet in space.
 *
 * @uasge gfx = p:gfxSpace()
 *    @luaparam p Planet to get texture of.
 *    @luareturn The space texture of the planet.
 * @luafunc gfxSpace( p )
 */
static int planetL_gfxSpace( lua_State *L )
{
   Planet *p;
   LuaTex lt;
   p        = luaL_validplanet(L,1);
   if (p->gfx_space == NULL) /* Not loaded. */
      lt.tex   = gl_newImage( p->gfx_spaceName, OPENGL_TEX_MIPMAPS );
   else
      lt.tex   = gl_dupTexture( p->gfx_space );
   lua_pushtex( L, lt );
   return 1;
}
Example #3
0
/**
 * @brief Gets the small faction logo which is 64x64 or smaller.
 *
 *    @luaparam f Faction to get logo from.
 *    @luareturn The small faction logo or nil if not applicable.
 * @luafunc logoSmall( f )
 */
static int factionL_logoSmall( lua_State *L )
{
   int lf;
   LuaTex lt;
   glTexture *tex;
   lf = luaL_validfaction(L,1);
   tex = faction_logoSmall( lf );
   if (tex == NULL)
      return 0;
   lt.tex = gl_dupTexture( tex );
   lua_pushtex( L, lt );
   return 1;
}
Example #4
0
/**
 * @brief Opens a texture.
 *
 *    @luaparam path Path to open.
 *    @luareturn The opened texture or nil on error.
 * @luafunc open( path )
 */
static int texL_open( lua_State *L )
{
   const char *path;
   LuaTex lt;

   /* Get path. */
   path = luaL_checkstring( L, 1 );

   /* Push new texture. */
   lt.tex = gl_newImage( path, 0 );
   if (lt.tex == NULL)
      return 0;
   lua_pushtex( L, lt );
   return 1;
}
Example #5
0
/**
 * @brief Gets the store icon for an outfit.
 *
 * @usage ico = o:icon() -- Gets the shop icon for an outfit
 *
 *    @luaparam o Outfit to get information of.
 *    @luareturn The texture containing the icon of the outfit.
 * @luafunc icon( o )
 */
static int outfitL_icon( lua_State *L )
{
   Outfit *o = luaL_validoutfit(L,1);
   lua_pushtex( L, gl_dupTexture( o->gfx_store ) );
   return 1;
}