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

Function GetReplayPath

src/drivers/win/replay.cpp:34–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32void RefreshThrottleFPS();
33
34static char* GetReplayPath(HWND hwndDlg)
35{
36 char* fn=0;
37 char szChoice[MAX_PATH];
38
39 LONG lIndex = SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETCURSEL, 0, 0);
40 LONG lCount = SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETCOUNT, 0, 0);
41
42 // NOTE: lCount-1 is the "Browse..." list item
43 if(lIndex != CB_ERR && lIndex != lCount-1)
44 {
45 LONG lStringLength = SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETLBTEXTLEN, (WPARAM)lIndex, 0);
46 if(lStringLength < MAX_PATH)
47 {
48 char szDrive[MAX_PATH]={0};
49 char szDirectory[MAX_PATH]={0};
50 char szFilename[MAX_PATH]={0};
51 char szExt[MAX_PATH]={0};
52 char szTemp[MAX_PATH]={0};
53
54 SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)szTemp);
55 if(szTemp[0] && szTemp[1]!=':')
56 sprintf(szChoice, ".\\%s", szTemp);
57 else
58 strcpy(szChoice, szTemp);
59
60 SetCurrentDirectory(BaseDirectory.c_str());
61
62 _splitpath(szChoice, szDrive, szDirectory, szFilename, szExt);
63 if(szDrive[0]=='\0' && szDirectory[0]=='\0')
64 fn=strdup(FCEU_MakePath(FCEUMKF_MOVIE, szChoice).c_str()); // need to make a full path
65 else
66 fn=strdup(szChoice); // given a full path
67 }
68 }
69
70 return fn;
71}
72
73static std::string GetRecordPath(HWND hwndDlg)
74{

Callers 2

UpdateReplayDialogFunction · 0.85
ReplayDialogProcFunction · 0.85

Calls 1

FCEU_MakePathFunction · 0.85

Tested by

no test coverage detected