mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
It's now possible to build each module individually (as a DLL).
This commit is contained in:
@@ -32,12 +32,12 @@ namespace physfs
|
||||
Filesystem::Filesystem()
|
||||
: open_count(0), buffer(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Filesystem::~Filesystem()
|
||||
{
|
||||
PHYSFS_deinit();
|
||||
if(PHYSFS_isInit())
|
||||
PHYSFS_deinit();
|
||||
}
|
||||
|
||||
const char * Filesystem::getName() const
|
||||
@@ -53,6 +53,9 @@ namespace physfs
|
||||
|
||||
bool Filesystem::setIdentity( const char * ident )
|
||||
{
|
||||
if(PHYSFS_isInit())
|
||||
return false;
|
||||
|
||||
// Check whether save directory is already set.
|
||||
if(!save_identity.empty() || PHYSFS_getWriteDir() != 0)
|
||||
return false;
|
||||
@@ -83,6 +86,9 @@ namespace physfs
|
||||
|
||||
bool Filesystem::setSource(const char * source)
|
||||
{
|
||||
if(!PHYSFS_isInit())
|
||||
return false;
|
||||
|
||||
// Check whether directory is already set.
|
||||
if(!game_source.empty())
|
||||
return false;
|
||||
@@ -99,6 +105,9 @@ namespace physfs
|
||||
|
||||
bool Filesystem::setupWriteDirectory()
|
||||
{
|
||||
if(!PHYSFS_isInit())
|
||||
return false;
|
||||
|
||||
// These must all be set.
|
||||
if(save_identity.empty() || save_path_full.empty() || save_path_relative.empty())
|
||||
return false;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
// LOVE
|
||||
#include <common/Module.h>
|
||||
#include <common/config.h>
|
||||
#include <common/constants.h>
|
||||
#include <filesystem/FileData.h>
|
||||
#include "File.h"
|
||||
|
||||
|
||||
@@ -243,6 +243,15 @@ namespace physfs
|
||||
0
|
||||
};
|
||||
|
||||
// List of constants.
|
||||
static const LuaConstant wrap_Filesystem_constants[] = {
|
||||
{ "file_closed", File::CLOSED },
|
||||
{ "file_read", File::READ },
|
||||
{ "file_write", File::WRITE },
|
||||
{ "file_append", File::APPEND },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
int wrap_Filesystem_open(lua_State * L)
|
||||
{
|
||||
if(instance == 0)
|
||||
@@ -260,10 +269,14 @@ namespace physfs
|
||||
|
||||
luax_register_gc(L, "love.filesystem", instance);
|
||||
|
||||
return luax_register_module(L, wrap_Filesystem_functions, wrap_Filesystem_types, "filesystem");
|
||||
return luax_register_module(L, wrap_Filesystem_functions, wrap_Filesystem_types, wrap_Filesystem_constants, "filesystem");
|
||||
}
|
||||
|
||||
} // physfs
|
||||
} // filesystem
|
||||
} // love
|
||||
|
||||
int luaopen_love_filesystem(lua_State * L)
|
||||
{
|
||||
return love::filesystem::physfs::wrap_Filesystem_open(L);
|
||||
}
|
||||
@@ -64,4 +64,6 @@ namespace physfs
|
||||
} // filesystem
|
||||
} // love
|
||||
|
||||
extern "C" LOVE_EXPORT int luaopen_love_filesystem(lua_State * L);
|
||||
|
||||
#endif // LOVE_FILESYSTEM_PHYSFS_WRAP_FILESYSTEM_H
|
||||
|
||||
Reference in New Issue
Block a user