LynnaLab.Area.SetUniqueGfx C# (CSharp) Method

SetUniqueGfx() private method

private SetUniqueGfx ( int index ) : void
index int
return void
        void SetUniqueGfx(int index)
        {
            graphicsState.RemoveGfxHeaderType(GfxHeaderType.Unique);
            if (index != 0) {
                FileParser uniqueGfxHeaderFile = Project.GetFileWithLabel("uniqueGfxHeaderGroupsStart");
                GfxHeaderData header
                    = uniqueGfxHeaderFile.GetData("uniqueGfxHeaderGroup" + index.ToString("x2"))
                    as GfxHeaderData;
                if (header != null) {
                    bool next = true;
                    while (next) {
                        graphicsState.AddGfxHeader(header, GfxHeaderType.Unique);
                        next = false;
                        if (header.ShouldHaveNext()) {
                            GfxHeaderData nextHeader = header.NextData as GfxHeaderData;
                            if (nextHeader != null) {
                                header = nextHeader;
                                next = true;
                            }
                            // Might wanna print a warning if no next value is found
                        }
                    }
                }
            }
            InvalidateAllTiles();
        }