Exemple #1
0
        public TileMatrix(int fileIndex, int mapID, int width, int height)
        {
            m_Width       = width;
            m_Height      = height;
            m_BlockWidth  = width >> 3;
            m_BlockHeight = height >> 3;

            if (fileIndex != 0x7F)
            {
                string mapPath = Client.GetFilePath("map{0}.mul", fileIndex);

                if (mapPath != null)
                {
                    m_Map = new FileStream(mapPath, FileMode.Open, FileAccess.Read, FileShare.Read);
                }

                string indexPath = Client.GetFilePath("staidx{0}.mul", fileIndex);

                if (indexPath != null)
                {
                    m_Index       = new FileStream(indexPath, FileMode.Open, FileAccess.Read, FileShare.Read);
                    m_IndexReader = new BinaryReader(m_Index);
                }

                string staticsPath = Client.GetFilePath("statics{0}.mul", fileIndex);

                if (staticsPath != null)
                {
                    m_Statics = new FileStream(staticsPath, FileMode.Open, FileAccess.Read, FileShare.Read);
                }
            }

            m_EmptyStaticBlock = new HuedTile[8][][];

            for (int i = 0; i < 8; ++i)
            {
                m_EmptyStaticBlock[i] = new HuedTile[8][];

                for (int j = 0; j < 8; ++j)
                {
                    m_EmptyStaticBlock[i][j] = new HuedTile[0];
                }
            }

            m_InvalidLandBlock = new Tile[196];

            m_LandTiles   = new Tile[m_BlockWidth][][];
            m_StaticTiles = new HuedTile[m_BlockWidth][][][][];

            m_Patch = new TileMatrixPatch(this, mapID);

            /*for ( int i = 0; i < m_BlockWidth; ++i )
             * {
             *      m_LandTiles[i] = new Tile[m_BlockHeight][];
             *      m_StaticTiles[i] = new Tile[m_BlockHeight][][][];
             * }*/
        }
        public TileMatrix( int fileIndex, int mapID, int width, int height )
        {
            m_Width = width;
            m_Height = height;
            m_BlockWidth = width >> 3;
            m_BlockHeight = height >> 3;

            if ( fileIndex != 0x7F )
            {
                string mapPath = Client.GetFilePath( "map{0}.mul", fileIndex );

                if ( mapPath != null )
                    m_Map = new FileStream( mapPath, FileMode.Open, FileAccess.Read, FileShare.Read );

                string indexPath = Client.GetFilePath( "staidx{0}.mul", fileIndex );

                if ( indexPath != null )
                {
                    m_Index = new FileStream( indexPath, FileMode.Open, FileAccess.Read, FileShare.Read );
                    m_IndexReader = new BinaryReader( m_Index );
                }

                string staticsPath = Client.GetFilePath( "statics{0}.mul", fileIndex );

                if ( staticsPath != null )
                    m_Statics = new FileStream( staticsPath, FileMode.Open, FileAccess.Read, FileShare.Read );
            }

            m_EmptyStaticBlock = new HuedTile[8][][];

            for ( int i = 0; i < 8; ++i )
            {
                m_EmptyStaticBlock[i] = new HuedTile[8][];

                for ( int j = 0; j < 8; ++j )
                {
                    m_EmptyStaticBlock[i][j] = new HuedTile[0];
                }
            }

            m_InvalidLandBlock = new Tile[196];

            m_LandTiles = new Tile[m_BlockWidth][][];
            m_StaticTiles = new HuedTile[m_BlockWidth][][][][];

            m_Patch = new TileMatrixPatch( this, mapID );

            /*for ( int i = 0; i < m_BlockWidth; ++i )
            {
                m_LandTiles[i] = new Tile[m_BlockHeight][];
                m_StaticTiles[i] = new Tile[m_BlockHeight][][][];
            }*/
        }