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

Function pfile_write_save_file

Source/pfile.cpp:506–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506void pfile_write_save_file(const char *pszName, BYTE *pbData, DWORD dwLen, DWORD qwLen)
507{
508 DWORD save_num;
509 char FileName[MAX_PATH];
510
511 pfile_strcpy(FileName, pszName);
512 save_num = pfile_get_save_num_from_name(plr[myplr]._pName);
513 {
514 char password[16] = PASSWORD_SINGLE;
515 if (gbMaxPlayers > 1)
516 strcpy(password, PASSWORD_MULTI);
517
518 codec_encode(pbData, dwLen, qwLen, password);
519 }
520 if (!pfile_open_archive(FALSE, save_num))
521 app_fatal("Unable to write so save file archive");
522 mpqapi_write_file(FileName, pbData, qwLen);
523 pfile_flush(TRUE, save_num);
524}
525
526void pfile_strcpy(char *dst, const char *src)
527{

Callers 2

SaveGameFunction · 0.85
SaveLevelFunction · 0.85

Calls 7

pfile_strcpyFunction · 0.85
codec_encodeFunction · 0.85
pfile_open_archiveFunction · 0.85
app_fatalFunction · 0.85
mpqapi_write_fileFunction · 0.85
pfile_flushFunction · 0.85

Tested by

no test coverage detected