示例#1
0
文件: Entity.cs 项目: Crwth/UltimaXNA
 internal virtual void Draw(MapTile tile, Position3D position)
 {
 }
示例#2
0
文件: Corpse.cs 项目: Crwth/UltimaXNA
 internal override void Draw(MapTile tile, Position3D position)
 {
     _movement.ClearImmediate();
     tile.AddMapObject(new TileEngine.MapObjectCorpse(position, DrawFacing, this, Hue, _corpseBody, _corpseFrame));
     drawOverheads(tile, new Position3D(_movement.Position.Point_V3));
 }
示例#3
0
        internal override void Draw(MapTile tile, Position3D position)
        {
            if (Ignored)
                return;

            tile.AddMapObject(new TileEngine.MapObjectItem(DisplayItemID, position, DrawFacing, this, Hue));
            drawOverheads(tile, new Position3D(position.Point_V3));
        }
示例#4
0
文件: Map.cs 项目: Crwth/UltimaXNA
        private void loadMapCellIntotiles(int x, int y)
        {
            // get data from the tile Matrix
            byte[] groundData = _tileMatrix.GetLandBlock(x >> 3, y >> 3);
            byte[] staticsData = _tileMatrix.GetStaticBlock(x >> 3, y >> 3);
            int[] indexes = new int[64];
            int thisindex = x % _MapTilesInMemory + (y % _MapTilesInMemory) * _MapTilesInMemory;
            for (int i = 0; i < 64; )
            {
                indexes[i++] = thisindex++;
                if ((i % 8) == 0)
                    thisindex += (_MapTilesInMemory - 8);
            }

            // load the ground data into the tiles.
            int index = 0;
            for (int i = 0; i < 64; i++)
            {
                int iTileID = groundData[index++] + (groundData[index++] << 8);
                int iTileZ = (sbyte)groundData[index++];

                MapObjectGround ground =
                    new MapObjectGround(iTileID, new Position3D(x + i % 8, y + (i >> 3), iTileZ));
                MapTile tile = new MapTile(ground.Position.X, ground.Position.Y);
                tile.AddMapObject(ground);
                _tiles[indexes[i]] = tile;
            }

            // load the statics data into the tiles
            int countStatics = staticsData.Length / 7;
            index = 0;
            for (int i = 0; i < countStatics; i++)
            {
                int iTileID = staticsData[index++] + (staticsData[index++] << 8);
                int iTileIndex = staticsData[index++] + (staticsData[index++] * 8);
                int iTileZ = (sbyte)staticsData[index++];
                index += 2; // unknown 2 byte data, not used.
                MapTile tile = _tiles[indexes[iTileIndex]];
                tile.AddMapObject(new MapObjectStatic(iTileID, i, new Position3D(tile.X, tile.Y, iTileZ)));
            }

            // now update this batch of tiles - sets their normals and surroundings as necessary.
            for (int i = 0; i < 64; i++)
            {
                _tiles[indexes[i]].GroundTile.UpdateSurroundingsIfNecessary(this);
            }
        }
示例#5
0
文件: Mobile.cs 项目: Crwth/UltimaXNA
        internal override void Draw(MapTile tile, Position3D position)
        {
            if (IsMoving)
            {
                if (IsRunning)
                    _animation.Animate(MobileAction.Run);
                else
                    _animation.Animate(MobileAction.Walk);
            }
            else
            {
                if (!_animation.IsAnimating)
                    _animation.Animate(MobileAction.Stand);
            }

            MapObjectMobile mobtile = new MapObjectMobile(position, DrawFacing, _animation.ActionIndex, _animation.AnimationFrame, this);
            tile.AddMapObject(mobtile);

            int[] drawLayers = _DrawLayerOrder;
            bool hasOuterTorso = _equipment[(int)EquipLayer.OuterTorso] != null && _equipment[(int)EquipLayer.OuterTorso].AnimationDisplayID != 0;

            for (int i = 0; i < drawLayers.Length; i++)
            {
                // when wearing something on the outer torso the other torso stuff is not drawn
                if (hasOuterTorso && (drawLayers[i] == (int)EquipLayer.InnerTorso || drawLayers[i] == (int)EquipLayer.MiddleTorso))
                {
                    continue;
                }

                if (drawLayers[i] == (int)EquipLayer.Body)
                {
                    mobtile.AddLayer(BodyID, Hue);
                }
                else if (_equipment[drawLayers[i]] != null && _equipment[drawLayers[i]].AnimationDisplayID != 0)
                {
                    mobtile.AddLayer(_equipment[drawLayers[i]].AnimationDisplayID, _equipment[drawLayers[i]].Hue);
                }
            }
            drawOverheads(tile, new Position3D(_movement.Position.Tile_V3));
        }
示例#6
0
 internal override void Draw(MapTile tile, Position3D position)
 {
     // string text = Utility.WrapASCIIText(_font, _text, 200);
     // tile.Add(new TileEngine.MapObjectText(position, _ownerEntity, text, _hue, _font));
 }
示例#7
0
文件: Multi.cs 项目: Crwth/UltimaXNA
        internal override void Draw(MapTile tile, Position3D position)
        {
            if (_unloadedTiles.Count == 0)
                return;

            List<Point2D> drawnTiles = new List<Point2D>();

            foreach (Point2D p in _unloadedTiles)
            {
                int x = tile.X + p.X - _components.Center.X;
                int y = tile.Y + p.Y - _components.Center.Y;

                MapTile t = World.Map.GetMapTile(x, y, false);
                if (t != null)
                {
                    drawnTiles.Add(p);

                    if (!_hasCustomTiles)
                    {
                        if (p.X < _components.Width && p.Y < _components.Height)
                        {
                            foreach (StaticTile s in _components.Tiles[p.X][p.Y])
                            {
                                t.AddMapObject(new MapObjectStatic(s.ID, 0, new Position3D(x, y, s.Z)));
                            }
                        }
                    }
                    else
                    {
                        foreach (StaticTile s in _customHouseTiles)
                        {
                            if ((s.X == p.X) && (s.Y == p.Y))
                            {
                                t.AddMapObject(new MapObjectStatic(s.ID, 0, new Position3D(s.X, s.Y, s.Z)));
                            }
                        }
                    }
                }
            }

            foreach (Point2D p in drawnTiles)
            {
                _unloadedTiles.Remove(p);
            }
        }
示例#8
0
 internal override void Draw(MapTile tile, Position3D position)
 {
     tile.FlushObjectsBySerial(Serial);
     int hue = _isHued ? _hue : 0;
     tile.AddMapObject(new TileEngine.MapObjectDynamic(this, position, _baseItemID, (int)(_frameSequence * _frameLength), hue, _useGumpArtInsteadOfTileArt));
 }