Exemple #1
0
        int TintBlock(int col)
        {
            FastColour rgbCol = FastColour.Unpack(col);

            rgbCol *= TintColour;
            return(rgbCol.Pack());
        }
Exemple #2
0
        public static int Tint(int col, FastColour tint)
        {
            FastColour adjCol = FastColour.Unpack(col);

            adjCol *= tint;
            return(adjCol.Pack());
        }
Exemple #3
0
        protected override void PostStretchTiles(int x1, int y1, int z1)
        {
            base.PostStretchTiles(x1, y1, z1);
            for (int i = 0; i < isOccluder.Length; i++)
            {
                isOccluder[i] =
                    BlockInfo.BlocksLight[i] &&
                    BlockInfo.MinBB[i] == Vector3.Zero &&
                    BlockInfo.MaxBB[i] == Vector3.One &&
                    i != 8 && i != 9 &&
                    BlockInfo.Draw[i] != DrawType.TransparentThick; // goodlyay, did you hack this for leaves?
                //(BlockInfo.Draw[i] != DrawType.TransparentThick && BlockInfo.Draw[i] != DrawType.Translucent); // goodlyay, did you hack this for leaves?
            }

            sun        = env.Sunlight;
            sunX       = FastColour.Unpack(env.SunXSide);
            sunZ       = FastColour.Unpack(env.SunZSide);
            sunYBottom = FastColour.Unpack(env.SunYBottom);

            float darkness = 0.4f;

            dark        = FastColour.Unpack(FastColour.ScalePacked(env.Shadow, darkness));
            darkX       = FastColour.Unpack(FastColour.ScalePacked(env.ShadowXSide, darkness));
            darkZ       = FastColour.Unpack(FastColour.ScalePacked(env.ShadowZSide, darkness));
            darkYBottom = FastColour.Unpack(FastColour.ScalePacked(env.ShadowYBottom, darkness));
        }
Exemple #4
0
        protected int TintBlock(BlockID curBlock, int col)
        {
            FastColour fogCol = BlockInfo.FogColour[curBlock];
            FastColour newCol = FastColour.Unpack(col);

            newCol *= fogCol;
            return(newCol.Pack());
        }
Exemple #5
0
        FastColour GetBlockColorXSide(int X, int Y, int Z, out bool blocksLight)
        {
            blocksLight = false;
            if (map.IsValidPos(X, Y, Z))
            {
                BlockID thisBlock = map.GetBlock(X, Y, Z);
                if (isOccluder[thisBlock])
                {
                    blocksLight = true;
                }

                FastColour col = blocksLight ? darkX : FastColour.Unpack(light.LightCol_XSide_Fast(X, Y, Z));
                if (BlockInfo.FullBright[thisBlock])
                {
                    col = sun;
                }
                return(col);
            }
            return(sunX);
        }