| 815 | } |
| 816 | |
| 817 | static 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 | |
| 844 | static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 845 | { |
no test coverage detected