Esempio n. 1
0
    void FloodBetweenChunks(byte[][] chunksLight_, byte[] cLight, byte[] dcLight, int cx, int cy, int cz, int dcx, int dcy, int dcz, int xx, int yy, int zz, int dxx, int dyy, int dzz, int[] dataLightRadius, bool[] dataTransparent)
    {
        int sourceLight = cLight[Index3d(xx, yy, zz, 16, 16)];
        int target      = dcLight[Index3d(dxx, dyy, dzz, 16, 16)];

        if (target < sourceLight - 1)
        {
            dcLight[Index3d(dxx, dyy, dzz, 16, 16)] = Game.IntToByte(sourceLight - 1);
            ShadowsBase.FloodLight_(q, chunksData[Index3d(dcx, dcy, dcz, 3, 3)], dcLight, dxx, dyy, dzz, dataLightRadius, dataTransparent);
        }
    }
Esempio n. 2
0
    public ModDrawTerrain()
    {
        currentChunk        = new int[18 * 18 * 18];
        currentChunkShadows = new byte[18 * 18 * 18];
        tempnearestpos      = new int[3];
        ids         = new int[1024];
        idsCount    = 0;
        redraw      = new TerrainRendererRedraw[128];
        redrawCount = 0;
        CalculateShadowslightRadius           = new int[GlobalVar.MAX_BLOCKTYPES];
        CalculateShadowsisTransparentForLight = new bool[GlobalVar.MAX_BLOCKTYPES];
        shadowsBase          = new ShadowsBase();
        shadowsBetweenChunks = new ShadowsBetweenChunks();

        lastPerformanceInfoupdateMilliseconds = 0;
        lastchunkupdates = 0;
        started          = false;
    }