| 142 | } |
| 143 | |
| 144 | PHYSFS_file *openLoadFile(const char *fileName, bool hard_fail) |
| 145 | { |
| 146 | PHYSFS_file *fileHandle = PHYSFS_openRead(fileName); |
| 147 | debug(LOG_NEVER, "Reading...[directory: %s] %s", WZ_PHYSFS_getRealDir_String(fileName).c_str(), fileName); |
| 148 | if (!fileHandle) |
| 149 | { |
| 150 | if (hard_fail) |
| 151 | { |
| 152 | ASSERT(!"unable to open file", "file %s could not be opened: %s", fileName, WZ_PHYSFS_getLastError()); |
| 153 | } |
| 154 | else |
| 155 | { |
| 156 | debug(LOG_WZ, "optional file %s could not be opened: %s", fileName, WZ_PHYSFS_getLastError()); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | return fileHandle; |
| 161 | } |
| 162 | |
| 163 | /*************************************************************************** |
| 164 | Load the file with name pointed to by pFileName into a memory buffer. |
no test coverage detected