MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / openLoadFile

Function openLoadFile

lib/framework/frame.cpp:144–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144PHYSFS_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.

Callers 5

loadFile2Function · 0.85
resLoadFunction · 0.85
loadFileToBufferVectorTFunction · 0.85
gameLoadFunction · 0.85
readVisibilityDataFunction · 0.85

Calls 2

ASSERTFunction · 0.50

Tested by

no test coverage detected