From d9041d6e12ded456c17622f7f2e7bbacb9e99b1a Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 26 Mar 2019 09:09:02 +0800 Subject: *misc --- source/libs/asura-lib-utils/io/file.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/libs/asura-lib-utils/io/file.cpp') diff --git a/source/libs/asura-lib-utils/io/file.cpp b/source/libs/asura-lib-utils/io/file.cpp index 092a90d..976203d 100644 --- a/source/libs/asura-lib-utils/io/file.cpp +++ b/source/libs/asura-lib-utils/io/file.cpp @@ -38,7 +38,7 @@ namespace AsuraEngine throw Exception("Physfs is NOT initialized."); if (mode == FILE_MODE_CLOSED) - return; + return false; if (mode == FILE_MODE_READ && !PHYSFS_exists(mFileName.c_str())) throw Exception("Could NOT open file %s. Does not exist.", mFileName.c_str()); @@ -53,7 +53,7 @@ namespace AsuraEngine // 已经在之前打开过,就不再创建新的handle了 if (mFileHandle != nullptr) - return; + return true; PHYSFS_getLastErrorCode(); @@ -83,7 +83,7 @@ namespace AsuraEngine mFileHandle = handle; mMode = mode; - if (mFileHandle != nullptr && !SetBuffer(mBufferMode,mBufferSize)) + if (mFileHandle && !SetBuffer(mBufferMode,mBufferSize)) { mBufferMode = BUFFER_MODE_NONE; mBufferSize = 0; -- cgit v1.1-26-g67d0