mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Added looping in love.audio (though needs implementation in love.sound).
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user