mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Removed the callback argument from love.filesystem.getDirectoryItems (resolves issue #877.)
Cleaned up the getDirectoryItems ccde to no longer call Lua API functions from Filesystem.cpp (now it's all in wrap_Filesystem.cpp.)
This commit is contained in:
@@ -408,7 +408,21 @@ int w_append(lua_State *L)
|
||||
|
||||
int w_getDirectoryItems(lua_State *L)
|
||||
{
|
||||
return instance()->getDirectoryItems(L);
|
||||
const char *dir = luaL_checkstring(L, 1);
|
||||
std::vector<std::string> items;
|
||||
|
||||
instance()->getDirectoryItems(dir, items);
|
||||
|
||||
lua_createtable(L, (int) items.size(), 0);
|
||||
|
||||
for (int i = 0; i < (int) items.size(); i++)
|
||||
{
|
||||
lua_pushstring(L, items[i].c_str());
|
||||
lua_rawseti(L, -2, i + 1);
|
||||
}
|
||||
|
||||
// Return the table.
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_lines(lua_State *L)
|
||||
|
||||
Reference in New Issue
Block a user