Browse Source

Fixed File::IsOpen() returning false for APK files on Android. Closes #179.

Lasse Öörni 12 years ago
parent
commit
56a246f2d6
2 changed files with 10 additions and 1 deletions
  1. 9 0
      Source/Engine/IO/File.cpp
  2. 1 1
      Source/Engine/IO/File.h

+ 9 - 0
Source/Engine/IO/File.cpp

@@ -463,4 +463,13 @@ void File::SetName(const String& name)
     fileName_ = name;
 }
 
+bool File::IsOpen() const
+{
+    #ifdef ANDROID
+        return handle_ != 0 || assetHandle_ != 0;
+    #else
+        return handle_ != 0;
+    #endif
+}
+
 }

+ 1 - 1
Source/Engine/IO/File.h

@@ -84,7 +84,7 @@ public:
     /// Return the open mode.
     FileMode GetMode() const { return mode_; }
     /// Return whether is open.
-    bool IsOpen() const { return handle_ != 0; }
+    bool IsOpen() const;
     /// Return the file handle.
     void* GetHandle() const { return handle_; }
     /// Return whether the file originates from a package.