lua/wrappers/gfx/lua_gfx_engine.cpp
/**
	 * Registers an asset with the graphics engine.
	 * The name are always namespaced to the file they were loaded from.
	 * For example <code>filename:assetname</code><span> This filename should be relative
	 * to the </span><code>data/assets/</code><span> folder. If no filename is given then the current
	 * file being loaded will be used.
	 * 
	 * The files under </span><code>data/assets/</code><span> will be automatically loaded
	 * when an asset with their filename is used. Assets can also be
	 * registered from outside of those files, however they will need to always
	 * provide a filename. Assets can be overridden.</span>
	 *
	 * @param am.asset asset The asset to store.
	 * @returns am.gfx_engine This
	 */
Registers an asset with the graphics engine.
The name are always namespaced to the file they were loaded from.
For example filename:assetname This filename should be relative
to the data/assets/ folder. If no filename is given then the current
file being loaded will be used.

The files under data/assets/ will be automatically loaded
when an asset with their filename is used. Assets can also be
registered from outside of those files, however they will need to always
provide a filename. Assets can be overridden.


Registers an asset with the graphics engine . The name are always namespaced to the file they were loaded from . For example filename : assetname This filename should be relative to the data / assets / folder . If no filename is given then the current file being loaded will be used . The files under data / assets / will be automatically loaded when an asset with their filename is used . Assets can also be registered from outside of those files however they will need to always provide a filename . Assets can be overridden .
int GfxEngine_asset(lua_State *lua)
	{
        am::gfx::GfxEngine *gfxEngine = am::gfx::GfxEngine::getEngine();
		if (lua_isstr(lua, 1))
		{
			am::gfx::Asset *asset = gfxEngine->getAsset(lua_tostring(lua, 1));
			if (asset)
			{
				wrapRefObject<am::gfx::Asset>(lua, asset);
				return 1;
			}
			lua_pushnil(lua);
			return 1;
		}
		else
		{
			am::gfx::Asset *asset = castUData<am::gfx::Asset>(lua, 1);
			if (asset)
			{
				gfxEngine->addAsset(asset);
				lua_first(lua);
			}
		}
		return LuaState::expectedArgs(lua, "asset", 3, "string asset_name", "am.asset asset");
	}
int GfxEngine_asset ( lua_State * lua ) { am :: gfx :: GfxEngine * gfxEngine = am :: gfx :: GfxEngine :: getEngine ( ) ; if ( lua_isstr ( lua , 1 ) ) { am :: gfx :: Asset * asset = gfxEngine -> getAsset ( lua_tostring ( lua , 1 ) ) ; if ( asset ) { wrapRefObject < am :: gfx :: Asset > ( lua , asset ) ; return 1 ; } lua_pushnil ( lua ) ; return 1 ; } else { am :: gfx :: Asset * asset = castUData < am :: gfx :: Asset > ( lua , 1 ) ; if ( asset ) { gfxEngine -> addAsset ( asset ) ; lua_first ( lua ) ; } } return LuaState :: expectedArgs ( lua , " " , 3 , " " , " " ) ; }
Registers an asset with the graphics engine.
Registers an asset with the graphics engine .