Add love.filesystem.openFile. Deprecate love.filesystem.newFile.

This commit is contained in:
Alex Szpakowski
2022-04-22 21:05:20 -03:00
parent e167a77994
commit b8ff64e9e3
6 changed files with 69 additions and 44 deletions
+4 -2
View File
@@ -48,7 +48,8 @@ File::File(const std::string &filename, Mode mode)
, bufferMode(BUFFER_NONE)
, bufferSize(0)
{
open(mode);
if (!open(mode))
throw love::Exception("Could not open file at path %s", filename.c_str());
}
File::File(const File &other)
@@ -58,7 +59,8 @@ File::File(const File &other)
, bufferMode(other.bufferMode)
, bufferSize(other.bufferSize)
{
open(other.mode);
if (!open(other.mode))
throw love::Exception("Could not open file at path %s", filename.c_str());
}
File::~File()