Esempio n. 1
0
        public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            int data  = Terrain.ExtractData(value);
            int?color = GetColor(data);

            if (color.HasValue)
            {
                generator.GenerateShadedMeshVertices(this, x, y, z, m_coloredBlockMeshes[GetVariant(data)], SubsystemPalette.GetColor(generator, color), null, null, geometry.SubsetOpaque);
            }
            else
            {
                generator.GenerateShadedMeshVertices(this, x, y, z, m_uncoloredBlockMeshes[GetVariant(data)], Color.White, null, null, geometry.SubsetOpaque);
            }
        }
Esempio n. 2
0
        public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            int num = Terrain.ExtractData(value);

            if (num < m_blockMeshesByData.Length && m_blockMeshesByData[num] != null)
            {
                generator.GenerateShadedMeshVertices(this, x, y, z, m_blockMeshesByData[num], Color.White, null, null, geometry.SubsetOpaque);
            }
        }
Esempio n. 3
0
        public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            if (generator.SubsystemFurnitureBlockBehavior == null)
            {
                return;
            }
            int             data        = Terrain.ExtractData(value);
            int             designIndex = GetDesignIndex(data);
            int             rotation    = GetRotation(data);
            FurnitureDesign design      = generator.SubsystemFurnitureBlockBehavior.GetDesign(designIndex);

            if (design == null)
            {
                return;
            }
            FurnitureGeometry geometry2 = design.Geometry;
            int mountingFacesMask       = design.MountingFacesMask;

            for (int i = 0; i < 6; i++)
            {
                int   num   = CellFace.OppositeFace((i < 4) ? ((i + rotation) % 4) : i);
                byte  b     = (byte)(LightingManager.LightIntensityByLightValueAndFace[15 + 16 * num] * 255f);
                Color color = new Color(b, b, b);
                if (geometry2.SubsetOpaqueByFace[i] != null)
                {
                    generator.GenerateShadedMeshVertices(this, x, y, z, geometry2.SubsetOpaqueByFace[i], color, m_matrices[rotation], m_facesMaps[rotation], geometry.OpaqueSubsetsByFace[num]);
                }
                if (geometry2.SubsetAlphaTestByFace[i] != null)
                {
                    generator.GenerateShadedMeshVertices(this, x, y, z, geometry2.SubsetAlphaTestByFace[i], color, m_matrices[rotation], m_facesMaps[rotation], geometry.AlphaTestSubsetsByFace[num]);
                }
                int num2 = CellFace.OppositeFace((i < 4) ? ((i - rotation + 4) % 4) : i);
                if ((mountingFacesMask & (1 << num2)) != 0)
                {
                    generator.GenerateWireVertices(value, x, y, z, i, 0f, Vector2.Zero, geometry.SubsetOpaque);
                }
            }
        }
Esempio n. 4
0
 public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
 {
     generator.GenerateShadedMeshVertices(this, x, y, z, m_blockMesh, Color.White, null, null, geometry.SubsetOpaque);
 }
Esempio n. 5
0
 public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
 {
     generator.GenerateShadedMeshVertices(this, x, y, z, m_blockMesh, BlockColorsMap.GrassColorsMap.Lookup(generator.Terrain, x, y, z), null, null, geometry.SubsetAlphaTest);
 }