Shows an Open File dialog and opens the ROM if the user selects a ROM file. @param hParent Handle of the main window @param initialdir Directory that's pre-selected in the Open File dialog.
| 1178 | /// @param hParent Handle of the main window |
| 1179 | /// @param initialdir Directory that's pre-selected in the Open File dialog. |
| 1180 | void LoadNewGamey(HWND hParent, const char *initialdir) |
| 1181 | { |
| 1182 | const char filter[] = "All usable files (*.nes,*.nsf,*.fds,*.unf,*.zip,*.rar,*.7z,*.gz)\0*.nes;*.nsf;*.fds;*.unf;*.zip;*.rar;*.7z;*.gz\0All non-compressed usable files (*.nes,*.nsf,*.fds,*.unf)\0*.nes;*.nsf;*.fds;*.unf\0All Files (*.*)\0*.*\0\0"; |
| 1183 | char nameo[2048]; |
| 1184 | |
| 1185 | // Create the Open File dialog |
| 1186 | OPENFILENAME ofn; |
| 1187 | memset(&ofn,0,sizeof(ofn)); |
| 1188 | |
| 1189 | ofn.lStructSize=sizeof(ofn); |
| 1190 | ofn.hInstance=fceu_hInstance; |
| 1191 | ofn.lpstrTitle=FCEU_NAME" Open File..."; |
| 1192 | ofn.lpstrFilter=filter; |
| 1193 | nameo[0]=0; |
| 1194 | ofn.hwndOwner=hParent; |
| 1195 | ofn.lpstrFile=nameo; |
| 1196 | ofn.nMaxFile=256; |
| 1197 | ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; //OFN_EXPLORER|OFN_ENABLETEMPLATE|OFN_ENABLEHOOK; |
| 1198 | string stdinitdir = FCEU_GetPath(FCEUMKF_ROMS); |
| 1199 | |
| 1200 | if (initialdir) //adelikat: If a directory is specified in the function parameter, it should take priority |
| 1201 | ofn.lpstrInitialDir = initialdir; |
| 1202 | else //adelikat: Else just use the override, if no override it will default to 0 - last directory used. |
| 1203 | ofn.lpstrInitialDir = stdinitdir.c_str(); |
| 1204 | |
| 1205 | // Show the Open File dialog |
| 1206 | if(GetOpenFileName(&ofn)) |
| 1207 | { |
| 1208 | ALoad(nameo); |
| 1209 | } |
| 1210 | } |
| 1211 | |
| 1212 | void GetMouseData(uint32 (&md)[3]) |
| 1213 | { |
no test coverage detected