Пример #1
0
        public static void DoScanWithoutUI(string dir)
        {
            GameDB db = new GameDB();

            if (File.Exists("db.xml"))
            {
                db.ReadXml("db.xml");
            }

            Crc32.gen_crc_table();

            ScanDir(dir, db, null);
        }
Пример #2
0
        public static void ConvertImages()
        {
            Crc32.gen_crc_table();

            if (!Directory.Exists("TileCache"))
            {
                Directory.CreateDirectory("TileCache");
            }

            GameDB db = new GameDB();

            if (File.Exists("db.xml"))
            {
                db.ReadXml("db.xml");
            }

            foreach (var game in db.Game)
            {
                if (!game.IsScreenshotNull())
                {
                    if (!String.IsNullOrEmpty(game.Screenshot))
                    {
                        var ss = game.Screenshot.Replace("\\", "/");
                        if (!File.Exists(ss))
                        {
                            Console.WriteLine("File " + ss + " is missing");
                            continue;
                        }

                        //String dst = "TileCache/" + game.Screenshot.Substring(game.Screenshot.LastIndexOfAny(new char[] { '\\', '/' }) + 1);
                        string dst = "TileCache/" + game.Screenshot.Replace("\\", "_").Replace("/", "_").Replace(":", "_");

                        dst = dst.Replace(".png", ".tile");

                        if (!File.Exists(dst) || File.GetLastWriteTime(game.Screenshot) > File.GetLastWriteTime(dst))
                        {
                            if (!Quantizer.Program.Quantize(ss, dst))
                            {
                                Console.WriteLine("Error converting " + game.Screenshot + ". Skipped");
                            }
                        }
                    }
                }
            }
        }
Пример #3
0
        public GameDBMgr()
        {
            InitializeComponent();

            Text = "Game DB Manager - " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            ActiveXMLFileName = "db.xml";

            if (File.Exists(ActiveXMLFileName))
            {
                gameDB.ReadXml(ActiveXMLFileName);
            }

            Crc32.gen_crc_table();

            //Don't change the ID or order of this table, as it must match the one in the firmware!!
            if (gameDB.Genre.Count == 0)
            {
                AddGenre(1, "Shooter");
                AddGenre(2, "Action");
                AddGenre(3, "Sports");
                AddGenre(4, "Misc");
                AddGenre(5, "Casino");
                AddGenre(6, "Driving");
                AddGenre(7, "Platform");
                AddGenre(8, "Puzzle");
                AddGenre(9, "Boxing");
                AddGenre(10, "Wrestling");
                AddGenre(11, "Strategy");
                AddGenre(12, "Soccer");
                AddGenre(13, "Golf");
                AddGenre(14, "Beat'em-Up");
                AddGenre(15, "Baseball");
                AddGenre(16, "Mahjong");
                AddGenre(17, "Board");
                AddGenre(18, "Tennis");
                AddGenre(19, "Fighter");
                AddGenre(20, "Horse Racing");
                AddGenre(21, "Other");
            }

            genreBindingSource.DataSource = genreTable;
        }