Added a variant of love.graphics.captureScreenshot which takes a single filename parameter. Resolves issue #1293.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-07-29 12:54:53 -03:00
parent 2c80cce00b
commit 5ef6730497
6 changed files with 76 additions and 16 deletions
+2 -4
View File
@@ -459,11 +459,9 @@ int w_getDirectoryItems(lua_State *L)
int w_lines(lua_State *L)
{
File *file;
if (lua_isstring(L, 1))
{
file = instance()->newFile(lua_tostring(L, 1));
File *file = instance()->newFile(lua_tostring(L, 1));
bool success = false;
luax_catchexcept(L, [&](){ success = file->open(File::MODE_READ); });
@@ -488,7 +486,7 @@ int w_load(lua_State *L)
{
std::string filename = std::string(luaL_checkstring(L, 1));
Data *data = 0;
Data *data = nullptr;
try
{
data = instance()->read(filename.c_str());