Пример #1
0
        private void WriteTitleToLZ(string filename, int id)
        {
            DrawString2(storyList.Stories[id].Title);

            Graphics g3 = Graphics.FromImage(title_output);

            for (int i = 0; i < 7; i++)
            {
                var sRect = new Rectangle(i * 32, 0, 32, 16);
                var dRect = new Rectangle(0, i * 16, 32, 16);
                g3.DrawImage(title, dRect, sRect, GraphicsUnit.Pixel);
            }

            Color[] palette  = new Color[16];
            int     palIndex = 14;

            LoadPalFile("obj.pal");
            for (int j = 0; j < palette.Length; j++)
            {
                palette[j] = PALfilePalette[j + 16 * palIndex];
            }

            byte[] raw      = GBAGraphics.ToGBARaw(title_output, palette, GraphicsMode.Tile4bit);
            byte[] lzcomped = LZ77.Compress(raw);

            File.WriteAllBytes(filename, lzcomped);
        }
Пример #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Color[] palette  = new Color[16];
            int     palIndex = 14;

            LoadPalFile("obj.pal");
            for (int j = 0; j < palette.Length; j++)
            {
                palette[j] = PALfilePalette[j + 16 * palIndex];
            }

            byte[] raw = GBAGraphics.ToGBARaw(title_output, palette, GraphicsMode.Tile4bit);

            File.WriteAllBytes("test.bin", raw);
        }