MCPcopy Create free account
hub / github.com/TASEmulators/fceux / UpdateRecordDialogPath

Function UpdateRecordDialogPath

src/drivers/win/replay.cpp:817–842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

815}
816
817static void UpdateRecordDialogPath(HWND hwndDlg, const std::string &fname)
818{
819 const std::string &baseMovieDir = FCEU_GetPath(FCEUMKF_MOVIE);
820 char* fn=0;
821
822 // display a shortened filename if the file exists in the base movie directory
823 if(!strncmp(fname.c_str(), baseMovieDir.c_str(), baseMovieDir.size()))
824 {
825 char szDrive[MAX_PATH]={0};
826 char szDirectory[MAX_PATH]={0};
827 char szFilename[MAX_PATH]={0};
828 char szExt[MAX_PATH]={0};
829
830 _splitpath(fname.c_str(), szDrive, szDirectory, szFilename, szExt);
831 fn=(char*)malloc(strlen(szFilename)+strlen(szExt)+1);
832 _makepath(fn, "", "", szFilename, szExt);
833 }
834 else
835 fn=strdup(fname.c_str());
836
837 if(fn)
838 {
839 SetWindowText(GetDlgItem(hwndDlg,IDC_EDIT_FILENAME),fn); // FIXME: make utf-8?
840 free(fn);
841 }
842}
843
844static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
845{

Callers 1

RecordDialogProcFunction · 0.85

Calls 2

FCEU_GetPathFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected