internal virtual void Draw(MapTile tile, Position3D position) { }
internal void drawOverheads(MapTile tile, Position3D position) { // base entities do not draw, but they can have overheads, so we draw those. foreach (KeyValuePair<int, Overhead> overhead in m_overheads) { if (!overhead.Value.IsDisposed) overhead.Value.Draw(tile, position); } }
internal override void Draw(MapTile tile, Position3D position) { // string text = Utility.WrapASCIIText(m_font, m_text, 200); // tile.Add(new TileEngine.MapObjectText(position, m_ownerEntity, text, m_hue, m_font)); }
private void loadMapCellIntotiles(int x, int y) { // get data from the tile Matrix byte[] groundData = m_tileMatrix.GetLandBlock(x >> 3, y >> 3); byte[] staticsData = m_tileMatrix.GetStaticBlock(x >> 3, y >> 3); int[] indexes = new int[64]; int thisindex = x % m_MapTilesInMemory + (y % m_MapTilesInMemory) * m_MapTilesInMemory; for (int i = 0; i < 64; ) { indexes[i++] = thisindex++; if ((i % 8) == 0) thisindex += (m_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); m_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 = m_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++) { m_tiles[indexes[i]].GroundTile.UpdateSurroundingsIfNecessary(this); } }
internal override void Draw(MapTile tile, Position3D position) { if (IsMoving) { if (IsRunning) m_animation.Animate(MobileAction.Run); else m_animation.Animate(MobileAction.Walk); } else { if (!m_animation.IsAnimating) m_animation.Animate(MobileAction.Stand); } MapObjectMobile mobtile = new MapObjectMobile(position, DrawFacing, m_animation.ActionIndex, m_animation.AnimationFrame, this); tile.AddMapObject(mobtile); int[] drawLayers = m_DrawLayerOrder; bool hasOuterTorso = m_equipment[(int)EquipLayer.OuterTorso] != null && m_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 (m_equipment[drawLayers[i]] != null && m_equipment[drawLayers[i]].AnimationDisplayID != 0) { mobtile.AddLayer(m_equipment[drawLayers[i]].AnimationDisplayID, m_equipment[drawLayers[i]].Hue); } } drawOverheads(tile, new Position3D(m_movement.Position.Tile_V3)); }
internal override void Draw(MapTile tile, Position3D position) { m_movement.ClearImmediate(); tile.AddMapObject(new MapObjectCorpse(position, DrawFacing, this, Hue, m_corpseBody, m_corpseFrame)); drawOverheads(tile, new Position3D(m_movement.Position.Point_V3)); }
internal override void Draw(MapTile tile, Position3D position) { tile.FlushObjectsBySerial(Serial); int hue = m_isHued ? m_hue : 0; tile.AddMapObject(new MapObjectDynamic(this, position, m_baseItemID, (int)(m_frameSequence * m_frameLength), hue, m_useGumpArtInsteadOfTileArt)); }
internal override void Draw(MapTile tile, Position3D position) { if (Ignored) return; tile.AddMapObject(new MapObjectItem(DisplayItemID, position, DrawFacing, this, Hue)); drawOverheads(tile, new Position3D(position.Point_V3)); }
internal override void Draw(MapTile tile, Position3D position) { if (m_unloadedTiles.Count == 0) return; List<Point> drawnTiles = new List<Point>(); foreach (Point p in m_unloadedTiles) { int x = tile.X + p.X - m_components.Center.X; int y = tile.Y + p.Y - m_components.Center.Y; MapTile t = IsometricRenderer.Map.GetMapTile(x, y, false); if (t != null) { drawnTiles.Add(p); if (!m_hasCustomTiles) { if (p.X < m_components.Width && p.Y < m_components.Height) { foreach (StaticTile s in m_components.Tiles[p.X][p.Y]) { t.AddMapObject(new MapObjectStatic(s.ID, 0, new Position3D(x, y, s.Z))); } } } else { foreach (StaticTile s in m_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 (Point p in drawnTiles) { m_unloadedTiles.Remove(p); } }