src/mess/osd/windows/ui/mess32ui.c
| r768 | r769 | |
| 742 | 742 | //GetDirectory(filename,last_directory,sizeof(last_directory)); |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | | free(t_filter); |
| 746 | | |
| 747 | 745 | return success; |
| 748 | 746 | } |
| 749 | 747 | |
| 750 | 748 | |
| 751 | 749 | |
| 752 | 750 | /* Specify IO_COUNT for type if you want all types */ |
| 753 | | static void SetupImageTypes(int nDriver, mess_image_type *types, int count, BOOL bZip, int type) |
| 751 | static void SetupImageTypes(const struct IODevice *devices, mess_image_type *types, int count, BOOL bZip, int type) |
| 754 | 752 | { |
| 755 | | const struct IODevice *devices; |
| 756 | 753 | int num_extensions = 0; |
| 757 | 754 | int devindex; |
| 758 | 755 | |
| r768 | r769 | |
| 766 | 763 | num_extensions++; |
| 767 | 764 | } |
| 768 | 765 | |
| 769 | | devices = devices_allocate(drivers[nDriver]); |
| 770 | 766 | if (devices != NULL) |
| 771 | 767 | { |
| 772 | 768 | for (devindex = 0; devices[devindex].type < IO_COUNT; devindex++) |
| r768 | r769 | |
| 792 | 788 | } |
| 793 | 789 | } |
| 794 | 790 | } |
| 795 | | devices_free(devices); |
| 796 | 791 | } |
| 797 | 792 | } |
| 798 | 793 | |
| r768 | r769 | |
| 805 | 800 | int nGame; |
| 806 | 801 | HWND hwndList; |
| 807 | 802 | char* utf8_filename; |
| 803 | const struct IODevice *devices; |
| 808 | 804 | |
| 809 | 805 | begin_resource_tracking(); |
| 810 | 806 | |
| 811 | 807 | hwndList = GetDlgItem(GetMainWindow(), IDC_LIST); |
| 812 | 808 | nGame = Picker_GetSelectedItem(hwndList); |
| 813 | | SetupImageTypes(nGame, imagetypes, sizeof(imagetypes) / sizeof(imagetypes[0]), TRUE, iDevice); |
| 809 | devices = devices_allocate(drivers[nGame]); |
| 810 | SetupImageTypes(devices, imagetypes, sizeof(imagetypes) / sizeof(imagetypes[0]), TRUE, iDevice); |
| 814 | 811 | |
| 815 | 812 | if (CommonFileImageDialog(last_directory, cfd, filename, imagetypes)) |
| 816 | 813 | { |
| r768 | r769 | |
| 821 | 818 | SoftwarePicker_AddFile(GetDlgItem(GetMainWindow(), IDC_SWLIST), utf8_filename); |
| 822 | 819 | free(utf8_filename); |
| 823 | 820 | } |
| 824 | | end_resource_tracking(); |
| 821 | |
| 822 | if (devices != NULL) |
| 823 | devices_free(devices); |
| 825 | 824 | } |
| 826 | 825 | |
| 827 | 826 | |
| r768 | r769 | |
| 845 | 844 | BOOL bResult; |
| 846 | 845 | mess_image_type imagetypes[64]; |
| 847 | 846 | HWND hwndList; |
| 847 | int gamenum; |
| 848 | const struct IODevice *devices; |
| 848 | 849 | |
| 849 | | begin_resource_tracking(); |
| 850 | | |
| 851 | 850 | hwndList = GetDlgItem(GetMainWindow(), IDC_LIST); |
| 852 | | SetupImageTypes(Picker_GetSelectedItem(hwndList), imagetypes, sizeof(imagetypes) / sizeof(imagetypes[0]), TRUE, dev->type); |
| 851 | gamenum = Picker_GetSelectedItem(hwndList); |
| 852 | devices = devices_allocate(drivers[gamenum]); |
| 853 | SetupImageTypes(devices, imagetypes, sizeof(imagetypes) / sizeof(imagetypes[0]), TRUE, dev->type); |
| 853 | 854 | bResult = CommonFileImageDialog(last_directory, GetOpenFileName, pszFilename, imagetypes); |
| 854 | 855 | |
| 855 | | end_resource_tracking(); |
| 856 | if (devices != NULL) |
| 857 | devices_free(devices); |
| 856 | 858 | return bResult; |
| 857 | 859 | } |
| 858 | 860 | |
| r768 | r769 | |
| 863 | 865 | BOOL bResult; |
| 864 | 866 | mess_image_type imagetypes[64]; |
| 865 | 867 | HWND hwndList; |
| 868 | int gamenum; |
| 869 | const struct IODevice *devices; |
| 866 | 870 | |
| 867 | | begin_resource_tracking(); |
| 868 | | |
| 869 | 871 | hwndList = GetDlgItem(GetMainWindow(), IDC_LIST); |
| 870 | | SetupImageTypes(Picker_GetSelectedItem(hwndList), imagetypes, sizeof(imagetypes) / sizeof(imagetypes[0]), TRUE, dev->type); |
| 872 | gamenum = Picker_GetSelectedItem(hwndList); |
| 873 | devices = devices_allocate(drivers[gamenum]); |
| 874 | SetupImageTypes(devices, imagetypes, sizeof(imagetypes) / sizeof(imagetypes[0]), TRUE, dev->type); |
| 871 | 875 | bResult = CommonFileImageDialog(last_directory, GetSaveFileName, pszFilename, imagetypes); |
| 872 | 876 | |
| 873 | | end_resource_tracking(); |
| 877 | if (devices != NULL) |
| 878 | devices_free(devices); |
| 874 | 879 | return bResult; |
| 875 | 880 | } |
| 876 | 881 | |