Added looping in love.audio (though needs implementation in love.sound).

This commit is contained in:
rude
2009-08-01 22:11:48 +02:00
parent c1ed4372d9
commit 524ef5e118
14 changed files with 87 additions and 20 deletions
+7 -3
View File
@@ -32,9 +32,7 @@ namespace physfs
Filesystem::Filesystem()
: open_count(0), buffer(0)
{
// TODO: love.exe << fail
if(!PHYSFS_init("love.exe"))
throw Exception(PHYSFS_getLastError());
}
Filesystem::~Filesystem()
@@ -47,6 +45,12 @@ namespace physfs
return "love.filesystem.physfs";
}
void Filesystem::init(const char * arg0)
{
if(!PHYSFS_init(arg0))
throw Exception(PHYSFS_getLastError());
}
bool Filesystem::setIdentity( const char * ident )
{
// Check whether save directory is already set.
@@ -91,10 +91,13 @@ namespace physfs
public:
Filesystem();
~Filesystem();
const char * getName() const;
void init(const char * arg0);
/**
* This sets up the save directory. If the
* it is already set up, nothing happens.
@@ -36,6 +36,22 @@ namespace physfs
return false;
}
int _wrap_init(lua_State * L)
{
const char * arg0 = luaL_checkstring(L, 1);
try
{
instance->init(arg0);
}
catch(Exception & e)
{
return luaL_error(L, e.what());
}
return 0;
}
int _wrap_setIdentity(lua_State * L)
{
const char * arg = luaL_checkstring(L, 1);
@@ -200,6 +216,7 @@ namespace physfs
// List of functions to wrap.
const luaL_Reg wrap_Filesystem_functions[] = {
{ "init", _wrap_init },
{ "setIdentity", _wrap_setIdentity },
{ "setSource", _wrap_setSource },
{ "newFile", _wrap_newFile },
@@ -33,6 +33,7 @@ namespace filesystem
namespace physfs
{
bool hack_setupWriteDirectory();
int _wrap_init(lua_State * L);
int _wrap_setIdentity(lua_State * L);
int _wrap_setSource(lua_State * L);
int _wrap_newFile(lua_State * L);