public void Load(TileMatrixData tileData, Map map) { // get data from the tile Matrix byte[] groundData = tileData.GetLandChunk(ChunkX, ChunkY); int staticLength; byte[] staticsData = tileData.GetStaticChunk(ChunkX, ChunkY, out staticLength); // load the ground data into the tiles. int groundDataIndex = 0; for (int i = 0; i < 64; i++) { int tileID = groundData[groundDataIndex++] + (groundData[groundDataIndex++] << 8); int tileZ = (sbyte)groundData[groundDataIndex++]; Ground ground = new Ground(tileID, map); ground.Position.Set((int)ChunkX * 8 + i % 8, (int)ChunkY * 8 + (i / 8), tileZ); } // load the statics data into the tiles int countStatics = staticLength / 7; int staticDataIndex = 0; for (int i = 0; i < countStatics; i++) { int iTileID = staticsData[staticDataIndex++] + (staticsData[staticDataIndex++] << 8); int iX = staticsData[staticDataIndex++]; int iY = staticsData[staticDataIndex++]; int iTileZ = (sbyte)staticsData[staticDataIndex++]; int hue = staticsData[staticDataIndex++] + (staticsData[staticDataIndex++] * 256); StaticItem item = new StaticItem(iTileID, hue, i, map); item.Position.Set((int)ChunkX * 8 + iX, (int)ChunkY * 8 + iY, iTileZ); } }
public GroundView(Ground ground) : base(ground) { PickType = PickType.PickGroundTiles; m_NoDraw = (Entity.LandDataID < 3 || (Entity.LandDataID >= 0x1AF && Entity.LandDataID <= 0x1B5)); DrawFlip = false; if (Entity.LandData.TextureID <= 0) { m_DrawAs3DStretched = false; DrawTexture = Provider.GetLandTexture(Entity.LandDataID); DrawArea = new Rectangle(0, Entity.Z * 4, IsometricRenderer.TILE_SIZE_INTEGER, IsometricRenderer.TILE_SIZE_INTEGER); } else { m_DrawAs3DStretched = true; DrawTexture = Provider.GetTexmapTexture(Entity.LandData.TextureID); } }
public GroundView(Ground ground) : base(ground) { PickType = PickType.PickGroundTiles; NoDraw = (Entity.LandDataID < 3 || (Entity.LandDataID >= 0x1AF && Entity.LandDataID <= 0x1B5)); if (Entity.LandData.TextureID <= 0) { DrawFlip = false; DrawAs3DStretched = false; DrawTexture = IO.ArtData.GetLandTexture(Entity.LandDataID); DrawArea = new Rectangle(0, Entity.Z * 4, World.WorldViews.IsometricRenderer.TileSizeI, World.WorldViews.IsometricRenderer.TileSizeI); } else { DrawFlip = false; DrawAs3DStretched = true; DrawTexture = IO.TexmapData.GetTexmapTexture(Entity.LandData.TextureID); } }