mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Fixed file services serialization
This commit is contained in:
		
							parent
							
								
									c24ea0f0ee
								
							
						
					
					
						commit
						2217b3558d
					
				
					 6 changed files with 26 additions and 14 deletions
				
			
		|  | @ -881,8 +881,9 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se | |||
| 
 | ||||
| IOFile::IOFile() {} | ||||
| 
 | ||||
| IOFile::IOFile(const std::string& filename, const char openmode[], int flags) { | ||||
|     Open(filename, openmode, flags); | ||||
| IOFile::IOFile(const std::string& filename, const char openmode[], int flags) | ||||
|     : filename(filename), openmode(openmode), flags(flags) { | ||||
|     Open(); | ||||
| } | ||||
| 
 | ||||
| IOFile::~IOFile() { | ||||
|  | @ -906,13 +907,9 @@ void IOFile::Swap(IOFile& other) { | |||
|     std::swap(flags, other.flags); | ||||
| } | ||||
| 
 | ||||
| bool IOFile::Open(const std::string& filename, const char openmode[], int flags) { | ||||
| bool IOFile::Open() { | ||||
|     Close(); | ||||
| 
 | ||||
|     this->filename = filename; | ||||
|     this->openmode = openmode; | ||||
|     this->flags = flags; | ||||
| 
 | ||||
| #ifdef _WIN32 | ||||
|     if (flags != 0) { | ||||
|         m_file = _wfsopen(Common::UTF8ToUTF16W(filename).c_str(), | ||||
|  | @ -922,7 +919,7 @@ bool IOFile::Open(const std::string& filename, const char openmode[], int flags) | |||
|                   Common::UTF8ToUTF16W(openmode).c_str()); | ||||
|     } | ||||
| #else | ||||
|     m_file = fopen(filename.c_str(), openmode); | ||||
|     m_file = fopen(filename.c_str(), openmode.c_str()); | ||||
| #endif | ||||
| 
 | ||||
|     m_good = IsOpen(); | ||||
|  |  | |||
|  | @ -306,7 +306,7 @@ public: | |||
|     } | ||||
| 
 | ||||
| private: | ||||
|     bool Open(const std::string& filename, const char openmode[], int flags = 0); | ||||
|     bool Open(); | ||||
| 
 | ||||
|     std::FILE* m_file = nullptr; | ||||
|     bool m_good = true; | ||||
|  | @ -330,6 +330,7 @@ private: | |||
|         ar >> flags; | ||||
|         u64 pos; | ||||
|         ar >> pos; | ||||
|         Open(); | ||||
|         Seek(pos, SEEK_SET); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue