Previous 15994 Revisions Next

r769 Tuesday 31st July, 2007 at 12:15:19 UTC by Nathan Woods
[Windows GUI] Fixed some recently introduced problems
[src/mess/osd/windows/ui]mess32ui.c

src/mess/osd/windows/ui/mess32ui.c
r768r769
742742        //GetDirectory(filename,last_directory,sizeof(last_directory));
743743    }
744744   
745    free(t_filter);
746
747745    return success;
748746}
749747
750748
751749
752750/* Specify IO_COUNT for type if you want all types */
753static void SetupImageTypes(int nDriver, mess_image_type *types, int count, BOOL bZip, int type)
751static void SetupImageTypes(const struct IODevice *devices, mess_image_type *types, int count, BOOL bZip, int type)
754752{
755    const struct IODevice *devices;
756753    int num_extensions = 0;
757754   int devindex;
758755
r768r769
766763      num_extensions++;
767764    }
768765
769   devices = devices_allocate(drivers[nDriver]);
770766   if (devices != NULL)
771767   {
772768      for (devindex = 0; devices[devindex].type < IO_COUNT; devindex++)
r768r769
792788            }
793789         }
794790      }
795      devices_free(devices);
796791   }
797792}
798793
r768r769
805800   int nGame;
806801   HWND hwndList;
807802   char* utf8_filename;
803   const struct IODevice *devices;
808804
809805   begin_resource_tracking();
810806
811807   hwndList = GetDlgItem(GetMainWindow(), IDC_LIST);
812808   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);
814811
815812   if (CommonFileImageDialog(last_directory, cfd, filename, imagetypes))
816813   {
r768r769
821818      SoftwarePicker_AddFile(GetDlgItem(GetMainWindow(), IDC_SWLIST), utf8_filename);
822819      free(utf8_filename);
823820   }
824   end_resource_tracking();
821
822   if (devices != NULL)
823      devices_free(devices);
825824}
826825
827826
r768r769
845844   BOOL bResult;
846845   mess_image_type imagetypes[64];
847846   HWND hwndList;
847   int gamenum;
848   const struct IODevice *devices;
848849
849   begin_resource_tracking();
850
851850   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);
853854   bResult = CommonFileImageDialog(last_directory, GetOpenFileName, pszFilename, imagetypes);
854855
855   end_resource_tracking();
856   if (devices != NULL)
857      devices_free(devices);
856858   return bResult;
857859}
858860
r768r769
863865   BOOL bResult;
864866   mess_image_type imagetypes[64];
865867   HWND hwndList;
868   int gamenum;
869   const struct IODevice *devices;
866870
867   begin_resource_tracking();
868
869871   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);
871875   bResult = CommonFileImageDialog(last_directory, GetSaveFileName, pszFilename, imagetypes);
872876
873   end_resource_tracking();
877   if (devices != NULL)
878      devices_free(devices);
874879   return bResult;
875880}
876881

Previous 15994 Revisions Next


© 1998-2018 The MESS Team