fills output with the path also returns a pointer to the first character in the filename (non-directory) part of the path
| 583 | // fills output with the path |
| 584 | // also returns a pointer to the first character in the filename (non-directory) part of the path |
| 585 | static char* ConstructScriptSaveDataPath(char* output, int bufferSize, LuaContextInfo& info) |
| 586 | { |
| 587 | // Get_State_File_Name(output); TODO |
| 588 | char* slash1 = strrchr(output, '\\'); |
| 589 | char* slash2 = strrchr(output, '/'); |
| 590 | if(slash1) slash1[1] = '\0'; |
| 591 | if(slash2) slash2[1] = '\0'; |
| 592 | char* rv = output + strlen(output); |
| 593 | strncat(output, "u.", bufferSize-(strlen(output)+1)); |
| 594 | if(!info.dataSaveLoadKeySet) |
| 595 | strncat(output, FilenameFromPath(info.lastFilename.c_str()), bufferSize-(strlen(output)+1)); |
| 596 | else |
| 597 | snprintf(output+strlen(output), bufferSize-(strlen(output)+1), "%X", info.dataSaveKey); |
| 598 | strncat(output, ".luasav", bufferSize-(strlen(output)+1)); |
| 599 | return rv; |
| 600 | } |
| 601 | |
| 602 | // emu.persistglobalvariables({ |
| 603 | // variable1 = defaultvalue1, |
no test coverage detected