MCPcopy Create free account
hub / github.com/diasurgical/devilution / SFileOpenFile

Function SFileOpenFile

SourceX/storm/storm.cpp:168–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166};
167
168BOOL SFileOpenFile(const char *filename, HANDLE *phFile)
169{
170 bool result = false;
171
172 if (directFileAccess) {
173 char directPath[DVL_MAX_PATH] = "\0";
174 char tmpPath[DVL_MAX_PATH] = "\0";
175 for (size_t i = 0; i < strlen(filename); i++) {
176 tmpPath[i] = AsciiToLowerTable_Path[static_cast<unsigned char>(filename[i])];
177 }
178 snprintf(directPath, DVL_MAX_PATH, "%s%s", SBasePath, tmpPath);
179 result = SFileOpenFileEx((HANDLE)0, directPath, 0xFFFFFFFF, phFile);
180 }
181 if (!result && patch_rt_mpq) {
182 result = SFileOpenFileEx((HANDLE)patch_rt_mpq, filename, 0, phFile);
183 }
184 if (!result) {
185 result = SFileOpenFileEx((HANDLE)diabdat_mpq, filename, 0, phFile);
186 }
187
188 if (!result || !*phFile) {
189 SDL_Log("%s: Not found: %s", __FUNCTION__, filename);
190 }
191 return result;
192}
193
194BOOL SBmpLoadImage(const char *pszFileName, SDL_Color *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *dwHeight, DWORD *pdwBpp)
195{

Callers 6

music_startFunction · 0.85
SBmpLoadImageFunction · 0.85
SVidPlayBeginFunction · 0.85
WOpenFileFunction · 0.85
stream_playFunction · 0.85
init_archivesFunction · 0.85

Calls 2

SFileOpenFileExFunction · 0.85
SDL_LogFunction · 0.85

Tested by

no test coverage detected