love.graphics.newImage, love.image.newImageData, etc. no longer leave Lua-owned FileData objects floating around waiting to be GC'd when called with filename arguments, resulting in less memory use on startup (resolves issue #890.)

Moved love.filesystem Lua wrapper code from src/modules/filesystem/physfs/ to src/modules/filesystem/.
This commit is contained in:
Alex Szpakowski
2014-06-02 00:22:41 -03:00
parent 4d0bbb97d8
commit 724bdbd296
17 changed files with 215 additions and 177 deletions
+1
View File
@@ -658,6 +658,7 @@ int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d)
{
// Get more sound data.
int decoded = d->decode();
decoded = decoded >= 0 ? decoded : 0;
int fmt = getFormat(d->getChannels(), d->getBitDepth());
+1 -4
View File
@@ -41,10 +41,7 @@ int w_getSourceCount(lua_State *L)
int w_newSource(lua_State *L)
{
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T))
luax_convobj(L, 1, "filesystem", "newFileData");
if (luax_istype(L, 1, FILESYSTEM_FILE_DATA_T))
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || luax_istype(L, 1, FILESYSTEM_FILE_DATA_T))
luax_convobj(L, 1, "sound", "newDecoder");
Source::Type stype = Source::TYPE_STREAM;