Esempio n. 1
0
        public TileMatrix(InstallLocation install, int fileIndex, int mapID, int width, int height)
        {
            _install     = install;
            _width       = width;
            _height      = height;
            _blockWidth  = width >> 3;
            _blockHeight = height >> 3;

            if (fileIndex != 0x7F)
            {
                string mapPath     = install.GetPath("map{0}.mul", fileIndex);
                string indexPath   = install.GetPath("staidx{0}.mul", fileIndex);
                string staticsPath = install.GetPath("statics{0}.mul", fileIndex);

                if (!File.Exists(mapPath))
                {
                    mapPath = install.GetPath("map{0}LegacyMUL.uop", fileIndex);
                }

                _map           = new FileStream(mapPath, FileMode.Open, FileAccess.Read, FileShare.Read);
                _fileIndex     = new FileStream(indexPath, FileMode.Open, FileAccess.Read, FileShare.Read);
                _staticsStream = new FileStream(staticsPath, FileMode.Open, FileAccess.Read, FileShare.Read);

                _reader = new BinaryReader(_fileIndex);
            }

            _emptyStaticBlock = new HuedTile[8][][];

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

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

            _invalidLandBlock = new Tile[196];

            _landTiles   = new Tile[_blockWidth][][];
            _staticTiles = new HuedTile[_blockWidth][][][][];

            _patch = new TileMatrixPatch(this, install, mapID);

            /*for ( int i = 0; i < m_BlockWidth; ++i )
             * {
             *  m_LandTiles[i] = new Tile[m_BlockHeight][];
             *  m_StaticTiles[i] = new Tile[m_BlockHeight][][][];
             * }*/
        }
Esempio n. 2
0
        public TileMatrix(InstallLocation install, int fileIndex, int mapID, int width, int height)
        {
            _install = install;
            _width = width;
            _height = height;
            _blockWidth = width >> 3;
            _blockHeight = height >> 3;

            if (fileIndex != 0x7F)
            {
                string mapPath = install.GetPath("map{0}.mul", fileIndex);
                string indexPath = install.GetPath("staidx{0}.mul", fileIndex);
                string staticsPath = install.GetPath("statics{0}.mul", fileIndex);

                if (!File.Exists(mapPath))
                    mapPath = install.GetPath("map{0}LegacyMUL.uop", fileIndex);

                _map = new FileStream(mapPath, FileMode.Open, FileAccess.Read, FileShare.Read);
                _fileIndex = new FileStream(indexPath, FileMode.Open, FileAccess.Read, FileShare.Read);
                _staticsStream = new FileStream(staticsPath, FileMode.Open, FileAccess.Read, FileShare.Read);

                _reader = new BinaryReader(_fileIndex);
            }

            _emptyStaticBlock = new HuedTile[8][][];

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

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

            _invalidLandBlock = new Tile[196];

            _landTiles = new Tile[_blockWidth][][];
            _staticTiles = new HuedTile[_blockWidth][][][][];

            _patch = new TileMatrixPatch(this, install, mapID);

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