/[EmuXPortal]/trunk/EmuXPortal/Api/RomConfig.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Api/RomConfig.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 27 by william, Wed Apr 4 03:38:07 2012 UTC revision 29 by william, Wed Apr 4 04:13:17 2012 UTC
# Line 18  namespace EmuXPortal.Api Line 18  namespace EmuXPortal.Api
18      public static class RomLoader      public static class RomLoader
19      {      {
20          private const string EMU_CONFIG = "emu.config"; // if this file signifies the emulator configuration          private const string EMU_CONFIG = "emu.config"; // if this file signifies the emulator configuration
21          public static IRomConfig Load(string rom_file)          public static IRomConfig Load(string rom_file, IEmuConfig EMUConfig)
22          {          {
23              IRomConfig config = null;              IRomConfig config = null;
24              config = new RomConfig(rom_file);              config = new RomConfig(rom_file, EMUConfig);            
25              return config;              return config;
26          }          }
27          #region private class RomConfig : IRomConfig          #region private class RomConfig : IRomConfig
28          private class RomConfig : IRomConfig          private class RomConfig : IRomConfig
29          {          {
30              public RomConfig(string rom_file)              public RomConfig(string rom_file, IEmuConfig EMUConfig)
31              {              {
32                  FileInfo fi = new FileInfo(rom_file);                  FileInfo fi = new FileInfo(rom_file);
33                  this.RomFile =fi.FullName;                  this.RomFile =fi.FullName;
# Line 36  namespace EmuXPortal.Api Line 36  namespace EmuXPortal.Api
36                  // load image                  // load image
37                  if (File.Exists(string.Format("{0}.jpg", fi.FullName.Replace(fi.Extension, "")))) { rom_img = string.Format("{0}.jpg", fi.FullName.Replace(fi.Extension, "")); }                  if (File.Exists(string.Format("{0}.jpg", fi.FullName.Replace(fi.Extension, "")))) { rom_img = string.Format("{0}.jpg", fi.FullName.Replace(fi.Extension, "")); }
38                  this.RomImage = (rom_img == "") ? Properties.Resources.DefaultGameImage : Image.FromFile(rom_img);                  this.RomImage = (rom_img == "") ? Properties.Resources.DefaultGameImage : Image.FromFile(rom_img);
39                  string config_dir = fi.Directory.Parent.FullName;                  //string config_dir = fi.Directory.Parent.FullName;
40                  Config = EmuConfigLoader.Load(config_dir);                  //Config = EmuConfigLoader.Load(config_dir);
41                    Config = EMUConfig;
42              }              }
43              #region IRomConfig Members              #region IRomConfig Members
44              public string RomFile { get; private set; }              public string RomFile { get; private set; }

Legend:
Removed from v.27  
changed lines
  Added in v.29

  ViewVC Help
Powered by ViewVC 1.1.22